|
|
|||
File indexing completed on 2025-12-15 09:53:04
0001 /*! 0002 @file 0003 Forward declares `boost::hana::lift`. 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_LIFT_HPP 0011 #define BOOST_HANA_FWD_LIFT_HPP 0012 0013 #include <boost/hana/config.hpp> 0014 #include <boost/hana/core/when.hpp> 0015 0016 0017 namespace boost { namespace hana { 0018 //! Lift a value into an `Applicative` structure. 0019 //! @ingroup group-Applicative 0020 //! 0021 //! `lift<A>` takes a normal value and embeds it into a structure whose 0022 //! shape is represented by the `A` `Applicative`. Note that the value 0023 //! may be a function, in which case the created structure may be 0024 //! `ap`plied to another `Applicative` structure containing values. 0025 //! 0026 //! 0027 //! Signature 0028 //! --------- 0029 //! Given an Applicative `A`, the signature is 0030 //! @f$ \mathtt{lift}_A : T \to A(T) @f$. 0031 //! 0032 //! @tparam A 0033 //! A tag representing the `Applicative` into which the value is lifted. 0034 //! 0035 //! @param x 0036 //! The value to lift into the applicative. 0037 //! 0038 //! 0039 //! Example 0040 //! ------- 0041 //! @include example/lift.cpp 0042 #ifdef BOOST_HANA_DOXYGEN_INVOKED 0043 template <typename A> 0044 constexpr auto lift = [](auto&& x) { 0045 return tag-dispatched; 0046 }; 0047 #else 0048 template <typename A, typename = void> 0049 struct lift_impl : lift_impl<A, when<true>> { }; 0050 0051 template <typename A> 0052 struct lift_t { 0053 template <typename X> 0054 constexpr auto operator()(X&& x) const; 0055 }; 0056 0057 template <typename A> 0058 BOOST_HANA_INLINE_VARIABLE constexpr lift_t<A> lift{}; 0059 #endif 0060 }} // end namespace boost::hana 0061 0062 #endif // !BOOST_HANA_FWD_LIFT_HPP
| [ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
|
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
|