Boost logo

Boost :

Subject: Re: [boost] [TypeErasure] Forward constructors and binded types
From: Vicente Botet (vicente.botet_at_[hidden])
Date: 2012-07-18 12:54:04


Vicente Botet wrote
>
>
> Steven Watanabe-4 wrote
>>
>> AMDG
>>
>> On 07/18/2012 06:57 AM, Larry Evans wrote:
>>> 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&lt;construct, _a&amp;, _b, _c&gt; t(vec, i, d);
>>>> any&lt;construct, _a&gt; 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&lt;construct, _&amp;a, _b, _c&gt;.
>>> 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?
>>>
>>
>> Yes.
>>
>>> Could the documentation on this be clarified a bit?
>>>
>>
>> What needs to be clarified? This is the
>> only reasonable behavior:
>> The arguments obviously match
>> constructible<_a(const _b&, const _c&)> right?
>> Therefore this constructor is the one called.
>> _a was bound to std::vector<double>,
>> so this is the type created.
>>
>> In Christ,
>> Steven Watanabe
>>
>
> My question is how the bind of _a to std::vector<double> if the t variable
> is not passed in the constructor of any? I'm sure I'm missing something
> evident.
>
>

Sorry I wanted to say, how the bind of _a to std::vector<double> *is know by
v* if the t variable is not passed in the constructor of any?

Vicente

--
View this message in context: http://boost.2283326.n4.nabble.com/TypeErasure-Forward-constructors-and-binded-types-tp4633181p4633216.html
Sent from the Boost - Dev mailing list archive at Nabble.com.

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