3 Forward declares `boost::hana::detail::nested_than`.
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_DETAIL_NESTED_THAN_FWD_HPP
11 #define BOOST_HANA_DETAIL_NESTED_THAN_FWD_HPP
13 #include <boost/hana/config.hpp>
16 BOOST_HANA_NAMESPACE_BEGIN namespace detail {
17 template <typename Algorithm>
18 struct nested_than_t {
20 constexpr decltype(auto) operator()(X&& x) const;
23 //! @ingroup group-details
24 //! Provides a `.than` static constexpr function object.
26 //! When creating a binary function object of type `Algo` whose signature
27 //! is `A x B -> Return`, `nested_than<Algo>` can be used as a base class
28 //! of `Algo`. Doing so will provide a static constexpr member called
29 //! `than`, which has the following signature:
34 //! Note that the function object `Algo` must be default-constructible,
35 //! since it will be called as `Algo{}(arguments...)`.
38 //! This function object is especially useful because it takes care of
39 //! avoiding ODR violations caused by the nested static constexpr member.
40 template <typename Algorithm>
41 struct nested_than { static constexpr nested_than_t<Algorithm> than{}; };
43 template <typename Algorithm>
44 constexpr nested_than_t<Algorithm> nested_than<Algorithm>::than;
45 } BOOST_HANA_NAMESPACE_END
47 #endif // !BOOST_HANA_DETAIL_NESTED_THAN_FWD_HPP