]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/hana/include/boost/hana/fwd/any_of.hpp
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / hana / include / boost / hana / fwd / any_of.hpp
1 /*!
2 @file
3 Forward declares `boost::hana::any_of`.
4
5 @copyright Louis Dionne 2013-2016
6 Distributed under the Boost Software License, Version 1.0.
7 (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
8 */
9
10 #ifndef BOOST_HANA_FWD_ANY_OF_HPP
11 #define BOOST_HANA_FWD_ANY_OF_HPP
12
13 #include <boost/hana/config.hpp>
14 #include <boost/hana/core/when.hpp>
15
16
17 BOOST_HANA_NAMESPACE_BEGIN
18 //! Returns whether any key of the structure satisfies the `predicate`.
19 //! @ingroup group-Searchable
20 //!
21 //! If the structure is not finite, `predicate` has to be satisfied
22 //! after looking at a finite number of keys for this method to finish.
23 //!
24 //!
25 //! @param xs
26 //! The structure to search.
27 //!
28 //! @param predicate
29 //! A function called as `predicate(k)`, where `k` is a key of the
30 //! structure, and returning a `Logical`.
31 //!
32 //!
33 //! Example
34 //! -------
35 //! @include example/any_of.cpp
36 #ifdef BOOST_HANA_DOXYGEN_INVOKED
37 constexpr auto any_of = [](auto&& xs, auto&& predicate) {
38 return tag-dispatched;
39 };
40 #else
41 template <typename S, typename = void>
42 struct any_of_impl : any_of_impl<S, when<true>> { };
43
44 struct any_of_t {
45 template <typename Xs, typename Pred>
46 constexpr auto operator()(Xs&& xs, Pred&& pred) const;
47 };
48
49 constexpr any_of_t any_of{};
50 #endif
51 BOOST_HANA_NAMESPACE_END
52
53 #endif // !BOOST_HANA_FWD_ANY_OF_HPP