14#ifndef RANGES_V3_FUNCTIONAL_BIND_HPP
15#define RANGES_V3_FUNCTIONAL_BIND_HPP
26#include <range/v3/utility/static_const.hpp>
28#include <range/v3/detail/prologue.hpp>
36 std::is_lvalue_reference<T>,
37 std::reference_wrapper<meta::_t<std::remove_reference<T>>>, T &&>>
38 U bind_forward(
meta::_t<std::remove_reference<T>> & t)
noexcept
40 return static_cast<U
>(t);
44 T && bind_forward(
meta::_t<std::remove_reference<T>> && t)
noexcept
47 static_assert(!std::is_lvalue_reference<T>::value,
"You didn't just do that!");
48 return static_cast<T &&
>(t);
53 : meta::if_c<RANGES_IS_SAME(detail::decay_t<T>, T), meta::id<T>,
54 bind_element<detail::decay_t<T>>>
66 using type =
typename reference_wrapper<T>::reference;
72 template<
typename Bind>
84 template<
typename...Ts>
85 auto CPP_auto_fun(
operator())(Ts &&...ts)
87 return bind_(
static_cast<Ts &&
>(ts)...)
90 template<typename...Ts>
91 auto CPP_auto_fun(
operator())(Ts &&...ts) (
const)
93 return bind_(
static_cast<Ts &&
>(ts)...)
100 template(
typename F)(
101 requires std::is_bind_expression<uncvref_t<F>>::value)
104 return {
static_cast<F &&
>(f)};
107 template(
typename F)(
108 requires (!std::is_bind_expression<uncvref_t<F>>::value))
109 F
operator()(F && f)
const
111 return static_cast<F &&
>(f);
123#include <range/v3/detail/epilogue.hpp>
typename T::type _t
Type alias for T::type.
Definition meta.hpp:141
_t< detail::_if_< list< Args... > > > if_
Select one type or another depending on a compile-time Boolean.
Definition meta.hpp:1247
Definition reference_wrapper.hpp:76