Boost logo

Boost Users :

Subject: Re: [Boost-users] [fusion] creating fusion-vectors of references
From: Oswin Krause (Oswin.Krause_at_[hidden])
Date: 2012-08-03 12:10:46


Thanks,

The problem was successfully located between keyboard and chair.
*Awards two points bonus for immediately knowing, that there can't be a
Problem in fusion* :)

Have a nice weekend,
Oswin Krause

On 2012-08-03 16:53, Christopher Schmidt wrote:
> "Oswin Krause" <Oswin.Krause_at_[hidden]> writes:
>> Unfortunately my problem is not calculating the correct types (like
>> fusion::vector<A&,B&,C&> from the Tuple). As my example suggests, I
>> have a
>> problem of creating the actual object after deducing the correct
>> types.
>>
>> One of the errors I get is for example( after using const_cast to
>> get the
>> correct reference, see problem 1.):
>>
>> boost/include/boost/fusion/container/vector/detail/preprocessed/vector10.hpp:101:9:
>> error: value-initialization of ‘int&
>> boost::fusion::vector_data2<int&, double&>
>>>::m0’, which has reference type
>>
>> in the sequence constructor of vector_data2. So what happens is that
>> fusion::vector assumes, that m0 is default constructible (references
>> are not)
>> and that then every object can be set to the correct value with
>> operator= (which
>> is not possible for references).
>
> Initialise from a fusion sequence of objects that are convertible to
> your target references.
>
> Christopher
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net