|
|
|||
File indexing completed on 2025-12-15 09:52:46
0001 /*! 0002 @file 0003 Forward declares `boost::hana::detail::nested_than`. 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_DETAIL_NESTED_THAN_FWD_HPP 0011 #define BOOST_HANA_DETAIL_NESTED_THAN_FWD_HPP 0012 0013 #include <boost/hana/config.hpp> 0014 0015 0016 namespace boost { namespace hana { namespace detail { 0017 template <typename Algorithm> 0018 struct nested_than_t { 0019 template <typename X> 0020 constexpr decltype(auto) operator()(X&& x) const; 0021 }; 0022 0023 //! @ingroup group-details 0024 //! Provides a `.than` static constexpr function object. 0025 //! 0026 //! When creating a binary function object of type `Algo` whose signature 0027 //! is `A x B -> Return`, `nested_than<Algo>` can be used as a base class 0028 //! of `Algo`. Doing so will provide a static constexpr member called 0029 //! `than`, which has the following signature: 0030 //! @code 0031 //! B -> A -> Return 0032 //! @endcode 0033 //! 0034 //! Note that the function object `Algo` must be default-constructible, 0035 //! since it will be called as `Algo{}(arguments...)`. 0036 //! 0037 //! @note 0038 //! This function object is especially useful because it takes care of 0039 //! avoiding ODR violations caused by the nested static constexpr member. 0040 template <typename Algorithm> 0041 struct nested_than { static constexpr nested_than_t<Algorithm> than{}; }; 0042 0043 template <typename Algorithm> 0044 constexpr nested_than_t<Algorithm> nested_than<Algorithm>::than; 0045 } }} // end namespace boost::hana 0046 0047 #endif // !BOOST_HANA_DETAIL_NESTED_THAN_FWD_HPP
| [ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
|
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
|