boost::parameter -- merging two ArgPacks

hello,
here's what i'm looking to do:
template<typename ArgPack>
result_type unary_fun(const ArgPack& args){
//typically calls args[some_tag]
}
template

On Mon, Sep 8, 2008 at 10:36 PM, e r
hello,
here's what i'm looking to do:
template<typename ArgPack> result_type unary_fun(const ArgPack& args){ //typically calls args[some_tag] }
template
result_type binary_fun(const ArgPack1& args1,const ArgPack2& args2){ return unary_fun(merge(args1,args2)); } i'm looking to define merge. not familiar enough with arg_list.hpp any help would be appreciated.
The comma operator will merge two argument packs, but in a function call you have to enclose the comma expression in an extra set of parentheses: return unary_fun((args1,args2)); HTH, Stjepan

Stjepan Rajko wrote:
On Mon, Sep 8, 2008 at 10:36 PM, e r
wrote: hello,
here's what i'm looking to do:
template<typename ArgPack> result_type unary_fun(const ArgPack& args){ //typically calls args[some_tag] }
template
result_type binary_fun(const ArgPack1& args1,const ArgPack2& args2){ return unary_fun(merge(args1,args2)); } i'm looking to define merge. not familiar enough with arg_list.hpp any help would be appreciated.
The comma operator will merge two argument packs, but in a function call you have to enclose the comma expression in an extra set of parentheses:
return unary_fun((args1,args2));
HTH,
Stjepan
It sure helps, thanks!
participants (2)
-
e r
-
Stjepan Rajko