3 Forward declares `boost::hana::all_of`.
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)
10 #ifndef BOOST_HANA_FWD_ALL_OF_HPP
11 #define BOOST_HANA_FWD_ALL_OF_HPP
13 #include <boost/hana/config.hpp>
14 #include <boost/hana/core/when.hpp>
17 BOOST_HANA_NAMESPACE_BEGIN
18 //! Returns whether all the keys of the structure satisfy the `predicate`.
19 //! @ingroup group-Searchable
21 //! If the structure is not finite, `predicate` has to return a false-
22 //! valued `Logical` after looking at a finite number of keys for this
27 //! The structure to search.
30 //! A function called as `predicate(k)`, where `k` is a key of the
31 //! structure, and returning a `Logical`.
36 //! @include example/all_of.cpp
37 #ifdef BOOST_HANA_DOXYGEN_INVOKED
38 constexpr auto all_of = [](auto&& xs, auto&& predicate) {
39 return tag-dispatched;
42 template <typename S, typename = void>
43 struct all_of_impl : all_of_impl<S, when<true>> { };
46 template <typename Xs, typename Pred>
47 constexpr auto operator()(Xs&& xs, Pred&& pred) const;
50 constexpr all_of_t all_of{};
52 BOOST_HANA_NAMESPACE_END
54 #endif // !BOOST_HANA_FWD_ALL_OF_HPP