Boost logo

Boost Users :

Subject: Re: [Boost-users] boost::parameter -- merging two ArgPacks
From: Stjepan Rajko (stipe_at_[hidden])
Date: 2008-09-09 11:57:35


On Mon, Sep 8, 2008 at 10:36 PM, e r <erwann.rogard_at_[hidden]> 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<typename ArgPack1,typename ArgPack2>
> 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


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net