Boost logo

Boost :

From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2008-07-07 12:25:29


AMDG

oliver wrote:
> what i really wanna do is not to name the objects i put i the
> fusion vector.
> they should be constructed in place and only be accessed through the
> fusion vector.
> should look something like this:
>
> typedef boost::fusion::vector<JobA, JobB, JobC> tJobs;
> struct System
> {
> System(Da& da) : fJobs(JobA(da), JobB(da, 2), JobC(da, 3))
> {}
> private:
> tJobs fJobs;
> };
>

This exact syntax cannot be implemented without a copy constructor.
JobA(da) creates a temporary JobA which is then copied into the
fusion::vector. You would have to use something like

fJobs(boost::in_place(da), boost::in_place(da, 2), boost::in_place(da, 3))

In Christ,
Steven Watanabe


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk