all.hpp 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*!
  2. @file
  3. Forward declares `boost::hana::all`.
  4. Copyright Louis Dionne 2013-2022
  5. Distributed under the Boost Software License, Version 1.0.
  6. (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
  7. */
  8. #ifndef BOOST_HANA_FWD_ALL_HPP
  9. #define BOOST_HANA_FWD_ALL_HPP
  10. #include <boost/hana/config.hpp>
  11. #include <boost/hana/core/when.hpp>
  12. namespace boost { namespace hana {
  13. //! Returns whether all the keys of the structure are true-valued.
  14. //! @ingroup group-Searchable
  15. //!
  16. //! The keys of the structure must be `Logical`s. If the structure is not
  17. //! finite, a false-valued key must appear at a finite "index" in order
  18. //! for this method to finish.
  19. //!
  20. //!
  21. //! Example
  22. //! -------
  23. //! @include example/all.cpp
  24. #ifdef BOOST_HANA_DOXYGEN_INVOKED
  25. constexpr auto all = [](auto&& xs) {
  26. return tag-dispatched;
  27. };
  28. #else
  29. template <typename S, typename = void>
  30. struct all_impl : all_impl<S, when<true>> { };
  31. struct all_t {
  32. template <typename Xs>
  33. constexpr auto operator()(Xs&& xs) const;
  34. };
  35. BOOST_HANA_INLINE_VARIABLE constexpr all_t all{};
  36. #endif
  37. }} // end namespace boost::hana
  38. #endif // !BOOST_HANA_FWD_ALL_HPP