9 template <
class Type >
14 constexpr
Constant( Type&& t_ ) noexcept( std::is_nothrow_move_constructible_v< Type > )
15 : t( std::move( t_ ) )
19 constexpr
Constant(
const Type& t_ ) noexcept(
20 std::is_nothrow_copy_constructible_v< Type > )
40 template <
class Arg >
41 auto const_ref(
const Arg& x ) noexcept( std::is_nothrow_copy_constructible_v< Arg > )
50 template <
class Arg >
52 (std::is_rvalue_reference_v< Arg > && std::is_nothrow_move_constructible_v< Arg >) ||
53 (std::is_lvalue_reference_v< Arg > && std::is_nothrow_copy_constructible_v< Arg >))
55 return Constant( std::forward< Arg >( x ) );
auto const_ref(const Arg &x) noexcept(std::is_nothrow_copy_constructible_v< Arg >)
Generate a constant function that stores its argument as constant reference.
Definition: constant.h:41
Main namespace of the funcy library.
constexpr auto constant(Arg &&x) noexcept((std::is_rvalue_reference_v< Arg > &&std::is_nothrow_move_constructible_v< Arg >)||(std::is_lvalue_reference_v< Arg > &&std::is_nothrow_copy_constructible_v< Arg >))
Wrap a constant.
Definition: constant.h:51
Wrap a constant.
Definition: constant.h:10
constexpr const Type & operator()() const noexcept
Function value.
Definition: constant.h:26