Boost logo

Boost :

Subject: Re: [boost] [TypeErasure] Forward constructors and binded types
From: Larry Evans (cppljevans_at_[hidden])
Date: 2012-07-18 09:57:25


On 07/18/12 01:29, Vicente J. Botet Escriba wrote:
> Hi,,
>
> In the example from the doc

http://steven_watanabe.users.sourceforge.net/type_erasure/libs/type_erasure/doc/html/boost_typeerasure/multi.html

>
> typedef mpl::vector<
> copy_constructible<_a>,
> copy_constructible<_b>,
> copy_constructible<_c>,
> constructible<_a(const _b&, const _c&)>
> > construct;
>
> std::vector<double> vec;
> int i = 10;
> double d = 2.5;
> tuple<construct, _a&, _b, _c> t(vec, i, d);
> any<construct, _a> v(get<1>(t), get<2>(t));
>
> I don't see which type is constructed and stored in v and how this type
> is given. That is I don't see how _a is binded. Could you help me?
>

I'd guess that a std::vector<double>&, more specifically the
vec is stored as the _a& in the tuple<construct, _&a, _b, _c>.
Hmm... Now I'm not sure anymore. Maybe it's a new std::vector<double>
that's stored and the std::vector<double> CTOR args are
10 and double. IOW the equivalent of:

  std::vector<double> v_a(10,2.5)

is stored in v?

Could the documentation on this be clarified a bit?

TIA.

-regards,
Larry


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