|
Boost : |
Subject: Re: [boost] [TypeErasure] Forward constructors and binded types
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2012-07-18 14:23:32
AMDG
On 07/18/2012 10:47 AM, Vicente Botet wrote:
>
> Is the following correct?
>
> class X {
> public:
> X(int, double);
> };
>
> std::vector<double> vec;
> int i = 10;
> double d = 2.5;
> X x;
>
> tuple<construct, _a&, _b, _c> t1(vec, i, d);
> tuple<construct, _a&, _b, _c> t2(x, i, d);
> any<construct, _a> v1(get<1>(t1), get<2>(t1));
> any<construct, _a> v2(get<1>(t2), get<2>(t2));
>
> If yes, how v1 is bound to vec and v2 to x?
>
It isn't. v1 stores a std::vector<double> which
is constructed in place and is not related to vec
in any way.
v2 again hold a separate object of type X,
which is created using X(int, double).
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