Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-15 09:53:03

0001 /*!
0002 @file
0003 Forward declares `boost::hana::all_of`.
0004 
0005 Copyright Louis Dionne 2013-2022
0006 Distributed under the Boost Software License, Version 1.0.
0007 (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
0008  */
0009 
0010 #ifndef BOOST_HANA_FWD_ALL_OF_HPP
0011 #define BOOST_HANA_FWD_ALL_OF_HPP
0012 
0013 #include <boost/hana/config.hpp>
0014 #include <boost/hana/core/when.hpp>
0015 
0016 
0017 namespace boost { namespace hana {
0018     //! Returns whether all the keys of the structure satisfy the `predicate`.
0019     //! @ingroup group-Searchable
0020     //!
0021     //! If the structure is not finite, `predicate` has to return a false-
0022     //! valued `Logical` after looking at a finite number of keys for this
0023     //! method to finish.
0024     //!
0025     //!
0026     //! @param xs
0027     //! The structure to search.
0028     //!
0029     //! @param predicate
0030     //! A function called as `predicate(k)`, where `k` is a key of the
0031     //! structure, and returning a `Logical`.
0032     //!
0033     //!
0034     //! Example
0035     //! -------
0036     //! @include example/all_of.cpp
0037 #ifdef BOOST_HANA_DOXYGEN_INVOKED
0038     constexpr auto all_of = [](auto&& xs, auto&& predicate) {
0039         return tag-dispatched;
0040     };
0041 #else
0042     template <typename S, typename = void>
0043     struct all_of_impl : all_of_impl<S, when<true>> { };
0044 
0045     struct all_of_t {
0046         template <typename Xs, typename Pred>
0047         constexpr auto operator()(Xs&& xs, Pred&& pred) const;
0048     };
0049 
0050     BOOST_HANA_INLINE_VARIABLE constexpr all_of_t all_of{};
0051 #endif
0052 }} // end namespace boost::hana
0053 
0054 #endif // !BOOST_HANA_FWD_ALL_OF_HPP