Boost logo

Boost :

From: cppljevans_at_[hidden]
Date: 2003-10-07 15:38:32

On 10/07/2003 03:05 PM, Fernando Cacciola wrote:
> cppljevans_at_[hidden] wrote:
>>>Any ideas how to enable an arbitrary number and types of args to
>>>new_policied CTOR?
> Hi, sorry for the late response, I've been busy as usual.
No problem :)
> I don't think I undestand your problem.
> What doesn't work with new_policied.cpp exactly?
> The code in the attachement alone looks fine to me,
> so why desn't it work?
Well, the code as presented works; however, I wanted something
that would work for an arbitrary number of arguments, just like
your in_place. For example, suppose:

struct T0{ T0();}; struct T1{T1(int);}; struct T2{T2(int,int);};

Now I want the following to work:

   new_policied<T0,S> np0();
   new_policied<T1,S> np1(0);
   new_policied<T2,S> np2(0,0);

However, the code which I posted requires three arguments.
Is that not similar to what in_place<T>(...) does? In other words,
for each CTOR argument signature, S, in T, there is a
corresponding CTOR argument signature for
new_policied<T>::new_policied(S); where S can be replaced with
any arglist for T's CTOR's.

Boost list run by bdawes at, gregod at, cpdaniel at, john at