Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-15 09:53:04

0001 /*!
0002 @file
0003 Forward declares `boost::hana::one`.
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_ONE_HPP
0011 #define BOOST_HANA_FWD_ONE_HPP
0012 
0013 #include <boost/hana/config.hpp>
0014 #include <boost/hana/core/when.hpp>
0015 
0016 
0017 namespace boost { namespace hana {
0018     //! Identity of the `Ring` multiplication.
0019     //! @ingroup group-Ring
0020     //!
0021     //! @tparam R
0022     //! The tag (must be a model of `Ring`) of the returned identity.
0023     //!
0024     //!
0025     //! Example
0026     //! -------
0027     //! @include example/one.cpp
0028 #ifdef BOOST_HANA_DOXYGEN_INVOKED
0029     template <typename R>
0030     constexpr auto one = []() -> decltype(auto) {
0031         return tag-dispatched;
0032     };
0033 #else
0034     template <typename R, typename = void>
0035     struct one_impl : one_impl<R, when<true>> { };
0036 
0037     template <typename R>
0038     struct one_t {
0039         constexpr decltype(auto) operator()() const;
0040     };
0041 
0042     template <typename R>
0043     BOOST_HANA_INLINE_VARIABLE constexpr one_t<R> one{};
0044 #endif
0045 }} // end namespace boost::hana
0046 
0047 #endif // !BOOST_HANA_FWD_ONE_HPP