Boost logo

Boost :

From: oliver (oliver.mueller_at_[hidden])
Date: 2008-07-08 07:45:04


Steven Watanabe <watanabesj <at> gmail.com> writes:

> oliver wrote:
> > 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))
>

i wasn't aware of boost::in_place, thanks for pointing that out.
i guess that is as good as it gets...or can get...although something like this
would of course be almost too sweet:
fJobs(da, (da, 2), (da, 3))

anyway, the in_place solution is very appealing to me.


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