/usr/include/boost/hof
NameSizeModeActions
detail/-0755rm
alias.hpp55520644editdlrm
always.hpp42610644editdlrm
apply.hpp83630644editdlrm
apply_eval.hpp44280644editdlrm
arg.hpp31480644editdlrm
capture.hpp54190644editdlrm
combine.hpp38770644editdlrm
compose.hpp50420644editdlrm
config.hpp61490644editdlrm
construct.hpp87740644editdlrm
decay.hpp17900644editdlrm
decorate.hpp63290644editdlrm
eval.hpp24000644editdlrm
first_of.hpp71000644editdlrm
fix.hpp63140644editdlrm
flip.hpp26900644editdlrm
flow.hpp50600644editdlrm
fold.hpp50000644editdlrm
function.hpp31290644editdlrm
function_param_limit.hpp16580644editdlrm
identity.hpp18840644editdlrm
if.hpp33140644editdlrm
implicit.hpp40410644editdlrm
indirect.hpp32680644editdlrm
infix.hpp60430644editdlrm
is_invocable.hpp17060644editdlrm
is_unpackable.hpp33410644editdlrm
lambda.hpp64580644editdlrm
lazy.hpp87290644editdlrm
lift.hpp37520644editdlrm
limit.hpp38170644editdlrm
match.hpp33310644editdlrm
mutable.hpp19880644editdlrm
pack.hpp127470644editdlrm
partial.hpp83070644editdlrm
pipable.hpp62270644editdlrm
placeholders.hpp137990644editdlrm
proj.hpp75170644editdlrm
protect.hpp21450644editdlrm
repeat.hpp41840644editdlrm
repeat_while.hpp51540644editdlrm
result.hpp36440644editdlrm
returns.hpp86070644editdlrm
reveal.hpp121870644editdlrm
reverse_fold.hpp52710644editdlrm
rotate.hpp25760644editdlrm
static.hpp23950644editdlrm
tap.hpp21180644editdlrm
unpack.hpp55880644editdlrm
unpack_sequence.hpp18100644editdlrm
version.hpp6790644editdlrm
Edit: /usr/include/boost/hof/apply_eval.hpp (4428B)
/*============================================================================= Copyright (c) 2015 Paul Fultz II apply_eval.h Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ==============================================================================*/ #ifndef BOOST_HOF_GUARD_APPLY_EVAL_H #define BOOST_HOF_GUARD_APPLY_EVAL_H /// apply_eval /// ========== /// /// Description /// ----------- /// /// The `apply_eval` function work like [`apply`](/include/boost/hof/apply), except it calls /// [`eval`](/include/boost/hof/eval) on each of its arguments. Each [`eval`](/include/boost/hof/eval) call is /// always ordered from left-to-right. /// /// Synopsis /// -------- /// /// template /// constexpr auto apply_eval(F&& f, Ts&&... xs); /// /// Semantics /// --------- /// /// assert(apply_eval(f)(xs...) == f(eval(xs)...)); /// /// Requirements /// ------------ /// /// F must be: /// /// * [ConstInvocable](ConstInvocable) /// /// Ts must be: /// /// * [EvaluatableFunctionObject](EvaluatableFunctionObject) /// /// Example /// ------- /// /// #include /// #include /// /// struct sum_f /// { /// template /// T operator()(T x, U y) const /// { /// return x+y; /// } /// }; /// /// int main() { /// assert(boost::hof::apply_eval(sum_f(), []{ return 1; }, []{ return 2; }) == 3); /// } /// #include #include #include #include #include #include #if BOOST_HOF_NO_ORDERED_BRACE_INIT #include #include #endif namespace boost { namespace hof { namespace detail { #if BOOST_HOF_NO_ORDERED_BRACE_INIT template constexpr R eval_ordered(const F& f, Pack&& p) { return p(f); } template constexpr R eval_ordered(const F& f, Pack&& p, T&& x, Ts&&... xs) { return boost::hof::detail::eval_ordered(f, boost::hof::pack_join(BOOST_HOF_FORWARD(Pack)(p), boost::hof::pack_forward(boost::hof::eval(x))), BOOST_HOF_FORWARD(Ts)(xs)...); } #else template struct eval_helper { R result; template constexpr eval_helper(const F& f, Ts&&... xs) : result(boost::hof::apply(f, BOOST_HOF_FORWARD(Ts)(xs)...)) {} }; template<> struct eval_helper { int x; template constexpr eval_helper(const F& f, Ts&&... xs) : x((boost::hof::apply(f, BOOST_HOF_FORWARD(Ts)(xs)...), 0)) {} }; #endif struct apply_eval_f { template(), boost::hof::eval(std::declval())...) ), class=typename std::enable_if<(!std::is_void::value)>::type > constexpr R operator()(const F& f, Ts&&... xs) const BOOST_HOF_RETURNS_DEDUCE_NOEXCEPT(boost::hof::apply(f, boost::hof::eval(BOOST_HOF_FORWARD(Ts)(xs))...)) { return #if BOOST_HOF_NO_ORDERED_BRACE_INIT boost::hof::detail::eval_ordered (f, boost::hof::pack(), BOOST_HOF_FORWARD(Ts)(xs)...); #else boost::hof::detail::eval_helper {f, boost::hof::eval(BOOST_HOF_FORWARD(Ts)(xs))...}.result; #endif } template(), boost::hof::eval(std::declval())...) ), class=typename std::enable_if<(std::is_void::value)>::type > constexpr typename detail::holder::type operator()(const F& f, Ts&&... xs) const BOOST_HOF_RETURNS_DEDUCE_NOEXCEPT(boost::hof::apply(f, boost::hof::eval(BOOST_HOF_FORWARD(Ts)(xs))...)) { return (typename detail::holder::type) #if BOOST_HOF_NO_ORDERED_BRACE_INIT boost::hof::detail::eval_ordered (f, boost::hof::pack(), BOOST_HOF_FORWARD(Ts)(xs)...); #else boost::hof::detail::eval_helper {f, boost::hof::eval(BOOST_HOF_FORWARD(Ts)(xs))...}; #endif } }; } BOOST_HOF_DECLARE_STATIC_VAR(apply_eval, detail::apply_eval_f); }} // namespace boost::hof #endif