📄 functional.qbk
字号:
#include <boost/fusion/include/make_fused_procedure.hpp>[heading Example] __vector__<int,int,int> v(1,2,3); using namespace boost::lambda; make_fused_procedure(_1 += _2 - _3)(v); assert(__front__(v) == 0);[heading See also]* __fused_procedure__* __deduce__* __result_of_make_fused_procedure__[endsect][section:mk_fused_fobj make_fused_function_object][heading Description]Creates a __fused_function_object__ adapter for a given __def_callable_obj__.The usual __element_conversion__ is applied to the target function.[heading Synopsis] template <typename F> inline typename __result_of_make_fused_function_object__<F>::type make_fused_function_object(F const & f);[heading Parameters][table [[Parameter] [Requirement] [Description]] [[`f`] [Model of __poly_func_obj__] [The function to transform.]]][heading Expression Semantics] make_fused_function_object(f);[*Return type]: A specialization of __fused_function_object__.[*Semantics]: Returns a __fused_function_object__ adapter for `f`.[heading Header] #include <boost/fusion/functional/generation/make_fused_function_object.hpp> #include <boost/fusion/include/make_fused_function_object.hpp>[heading Example] struct sub { template <typename Sig> struct result; template <class Self, typename T> struct result< Self(T,T) > { typedef typename remove_reference<T>::type type; }; template<typename T> T operator()(T lhs, T rhs) const { return lhs - rhs; } }; void try_it() { __vector__<int,float> a(2,2.0f); __vector__<int,float> b(1,1.5f); __vector__<int,float> c(1,0.5f); assert(c == __transform__(__zip__(a,b), make_fused_function_object(sub()))); }[heading See also]* __fused_function_object__* __deduce__* __result_of_make_fused_function_object__[endsect][section:mk_unfused_genrc make_unfused_generic][heading Description]Creates a __unfused_generic__ adapter for a given, unary __poly_func_obj__.The usual __element_conversion__ is applied to the target function.[heading Synopsis] template <typename F> inline typename __result_of_make_unfused_generic__<F>::type make_unfused_generic(F const & f);[heading Parameters][table [[Parameter] [Requirement] [Description]] [[`f`] [Model of __poly_func_obj__] [The function to transform.]]][heading Expression Semantics] make_unfused_generic(f);[*Return type]: A specialization of __unfused_generic__.[*Semantics]: Returns a __unfused_generic__ adapter for `f`.[heading Header] #include <boost/fusion/functional/generation/make_unfused_generic.hpp> #include <boost/fusion/include/make_unfused_generic.hpp>[heading Example] struct bottles_song { typedef void result_type; template<class Seq> void operator()(Seq & s) const { typename result_of::at_c<Seq,0>::type n = at_c<0>(s); typename result_of::at_c<Seq,1>::type what = at_c<1>(s); std::cout << n << " bottles of " << what << " on the wall.\n" << n << " bottles of " << what << "!\n" << "Take one down - pass it around.\n"; n -= 1; // glug glug... std::cout << n << " bottles of " << what << " on the wall.\n" << std::endl; } }; void try_it() { unsigned n_milk = 99; for(int i = 0; i < 3; ++i) make_unfused_generic(bottles_song())(n_milk,"milk"); // 96 bottles left for me }[heading See also]* __unfused_generic__* __deduce__* __result_of_make_unfused_generic__[endsect][section:mk_unfused_lvargs make_unfused_lvalue_args][heading Description]Creates a __unfused_lvalue_args__ adapter for a given, unary __poly_func_obj__.The usual __element_conversion__ is applied to the target function.[heading Synopsis] template <typename F> inline typename __result_of_make_unfused_lvalue_args__<F>::type make_unfused_lvalue_args(F const & f);[heading Parameters][table [[Parameter] [Requirement] [Description]] [[`f`] [Model of __poly_func_obj__] [The function to transform.]]][heading Expression Semantics] make_unfused_lvalue_args(f);[*Return type]: A specialization of __unfused_lvalue_args__.[*Semantics]: Returns a __unfused_lvalue_args__ adapter for `f`.[heading Header] #include <boost/fusion/functional/generation/make_unfused_lvalue_args.hpp> #include <boost/fusion/include/make_unfused_lvalue_args.hpp>[heading Example] struct fused_incrementer { template <class Seq> struct result { typedef void type; }; template <class Seq> void operator()(Seq const & s) const { __for_each__(s,++boost::lambda::_1); } }; void try_it() { int a = 2; char b = 'X'; make_unfused_lvalue_args(fused_incrementer())(a,b); assert(a == 3 && b == 'Y'); }[heading See also]* __unfused_lvalue_args__* __deduce__* __result_of_make_unfused_lvalue_args__[endsect][section:mk_unfused_rvargs make_unfused_rvalue_args][heading Description]Creates a __unfused_rvalue_args__ adapter for a given, unary __poly_func_obj__.The usual __element_conversion__ is applied to the target function.[heading Synopsis] template <typename F> inline typename __result_of_make_unfused_rvalue_args__<F>::type make_unfused_rvalue_args(F const & f);[heading Parameters][table [[Parameter] [Requirement] [Description]] [[`f`] [Model of __poly_func_obj__] [The function to transform.]]][heading Expression Semantics] make_unfused_rvalue_args(f);[*Return type]: A specialization of __unfused_rvalue_args__.[*Semantics]: Returns a __unfused_rvalue_args__ adapter for `f`.[heading Header] #include <boost/fusion/functional/generation/make_unfused_rvalue_args.hpp> #include <boost/fusion/include/make_unfused_rvalue_args.hpp>[heading Example] struct sequence_printer { template <class Seq> struct result { typedef void type; }; template <class Seq> void operator()(Seq const & s) const { std::cout << s << std::endl; } }; void try_it() { make_unfused_rvalue_args(sequence_printer()) (24,"bottles of beer in",'a',"box."); }[heading See also]* __unfused_rvalue_args__* __deduce__* __result_of_make_unfused_rvalue_args__[endsect][endsect] [/ Functions][section Metafunctions][section:mk_fused make_fused][heading Description]Returns the result type of __make_fused__.[heading Header] #include <boost/fusion/functional/generation/make_fused.hpp> #include <boost/fusion/include/make_fused.hpp>[heading Synopsis] namespace result_of { template<typename Function> struct make_fused { typedef __unspecified__ type; }; }[heading See also]* __make_fused__[endsect][section:mk_fused_proc make_fused_procedure][heading Description]Returns the result type of __make_fused_procedure__.[heading Header] #include <boost/fusion/functional/generation/make_fused_procedure.hpp> #include <boost/fusion/include/make_fused_procedure.hpp>[heading Synopsis] namespace result_of { template<typename Function> struct make_fused_procedure { typedef __unspecified__ type; }; }[heading See also]* __make_fused_procedure__[endsect][section:mk_fused_fobj make_fused_function_object][heading Description]Returns the result type of __make_fused_function_object__.[heading Header] #include <boost/fusion/functional/generation/make_fused_function_object.hpp> #include <boost/fusion/include/make_fused_function_object.hpp>[heading Synopsis] namespace result_of { template<typename Function> struct make_fused_function_object { typedef __unspecified__ type; }; }[heading See also]* __make_fused_function_object__[endsect][section:mk_unfused_genrc make_unfused_generic][heading Description]Returns the result type of __make_unfused_generic__.[heading Header] #include <boost/fusion/functional/generation/make_unfused_generic.hpp> #include <boost/fusion/include/make_unfused_generic.hpp>[heading Synopsis] namespace result_of { template<typename Function> struct make_unfused_generic { typedef __unspecified__ type; }; }[heading See also]* __make_unfused_generic__[endsect][section:mk_unfused_lvargs make_unfused_lvalue_args][heading Description]Returns the result type of __make_unfused_lvalue_args__.[heading Header] #include <boost/fusion/functional/generation/make_unfused_lvalue_args.hpp> #include <boost/fusion/include/make_unfused_lvalue_args.hpp>[heading Synopsis] namespace result_of { template<typename Function> struct make_unfused_lvalue_args { typedef __unspecified__ type; }; }[heading See also]* __make_unfused_lvalue_args__[endsect][section:mk_unfused_rvargs make_unfused_rvalue_args][heading Description]Returns the result type of __make_unfused_rvalue_args__.[heading Header] #include <boost/fusion/functional/generation/make_unfused_rvalue_args.hpp> #include <boost/fusion/include/make_unfused_rvalue_args.hpp>[heading Synopsis] namespace result_of { template<typename Function> struct make_unfused_rvalue_args { typedef __unspecified__ type; }; }[heading See also]* __make_unfused_rvalue_args__[endsect][endsect] [/ Metafunctions][endsect] [/ Generation][endsect] [/ Functional ]
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -