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::any_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_ANY_OF_HPP
0011 #define BOOST_HANA_FWD_ANY_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 any key of the structure satisfies the `predicate`.
0019     //! @ingroup group-Searchable
0020     //!
0021     //! If the structure is not finite, `predicate` has to be satisfied
0022     //! after looking at a finite number of keys for this method to finish.
0023     //!
0024     //!
0025     //! @param xs
0026     //! The structure to search.
0027     //!
0028     //! @param predicate
0029     //! A function called as `predicate(k)`, where `k` is a key of the
0030     //! structure, and returning a `Logical`.
0031     //!
0032     //!
0033     //! Example
0034     //! -------
0035     //! @include example/any_of.cpp
0036 #ifdef BOOST_HANA_DOXYGEN_INVOKED
0037     constexpr auto any_of = [](auto&& xs, auto&& predicate) {
0038         return tag-dispatched;
0039     };
0040 #else
0041     template <typename S, typename = void>
0042     struct any_of_impl : any_of_impl<S, when<true>> { };
0043 
0044     struct any_of_t {
0045         template <typename Xs, typename Pred>
0046         constexpr auto operator()(Xs&& xs, Pred&& pred) const;
0047     };
0048 
0049     BOOST_HANA_INLINE_VARIABLE constexpr any_of_t any_of{};
0050 #endif
0051 }} // end namespace boost::hana
0052 
0053 #endif // !BOOST_HANA_FWD_ANY_OF_HPP