13 #ifndef RANGES_V3_FUNCTIONAL_PIPEABLE_HPP
14 #define RANGES_V3_FUNCTIONAL_PIPEABLE_HPP
22 #include <range/v3/utility/static_const.hpp>
24 #include <range/v3/detail/prologue.hpp>
34 RANGES_INLINE_VAR constexpr
bool is_pipeable_v = META_IS_BASE_OF(pipeable_base, T);
37 RANGES_INLINE_VAR constexpr
bool is_pipeable_v<T &> = META_IS_BASE_OF(pipeable_base,
40 RANGES_INLINE_VAR constexpr
bool is_pipeable_v<T &&> = META_IS_BASE_OF(pipeable_base,
47 template<
typename Fun,
typename PipeableBase = pipeable_base>
48 constexpr
auto operator()(Fun fun)
const
54 constexpr
explicit local(Fun && f)
55 : Fun(
static_cast<Fun &&
>(f))
58 return local{
static_cast<Fun &&
>(fun)};
68 template<
typename Pipeable>
81 template(
typename Arg,
typename Pipe)(
82 requires (!is_pipeable_v<Arg>) AND is_pipeable_v<Pipe> AND
84 friend constexpr
auto operator|(Arg &&arg, Pipe pipe)
86 return static_cast<Pipe &&
>(pipe)(
static_cast<Arg &&
>(arg));
90 template(
typename Pipe0,
typename Pipe1)(
91 requires is_pipeable_v<Pipe0> AND is_pipeable_v<Pipe1>)
92 friend constexpr
auto operator|(Pipe0 pipe0, Pipe1 pipe1)
94 return make_pipeable(compose(detail::move(pipe1), detail::move(pipe0)));
97 template<
typename Arg,
typename Pipe>
98 friend auto operator|=(Arg & arg, Pipe pipe)
99 -> CPP_broken_friend_ret(Arg &)(
100 requires (is_pipeable_v<Pipe>) &&
101 (!is_pipeable_v<Arg>) && invocable<Pipe, Arg &>)
103 static_cast<Pipe &&
>(pipe)(arg);
110 template<
typename Arg,
typename Pipe>
111 static constexpr
auto CPP_auto_fun(pipe)(Arg && arg, Pipe p)
113 return static_cast<Pipe &&
>(p)(
static_cast<Arg &&
>(arg))
119 using pipeable RANGES_DEPRECATED(
"Please use pipeable_base instead") =
pipeable_base;
126 #include <range/v3/detail/epilogue.hpp>
RANGES_INLINE_VARIABLE(detail::to_container_fn< detail::from_range< std::vector >>, to_vector) template< template< typename... > class ContT > auto to(RANGES_HIDDEN_DETAIL(detail
For initializing a container of the specified type with the elements of an Range.
Definition: conversion.hpp:399
std::integral_constant< bool, B > bool_
An integral constant wrapper for bool.
Definition: meta.hpp:168
Definition: pipeable.hpp:46
Definition: pipeable.hpp:70
Definition: pipeable.hpp:67
Definition: pipeable.hpp:76