Boost logo

Boost :

From: Michael Marcin (mmarcin_at_[hidden])
Date: 2007-07-06 21:23:53


dan marsden wrote:
> Stjepan Rajko wrote:
>> Found a case where it doesn't compile - adapting your example to how
> ...
>> However, if I change this to:
>>
>> typedef fusion::vector<> vec;
>> vec v;
>> fusion::transform_view<vec, make_ref> t(v, make_ref());
>> fusion::vector<> vec_of_references(t); // does not compile
>>
>> The problem is that since vec_of_references is a vector of size 0 then
>> it can't initialize from the transform_view because vector0 has no
>> constructors defined (so only copy constructible).
>>
>> For sake of consistency, would it be possible to add a templated
>> constructor to vector0 that could take a fusion sequence and do
>> nothing with it? I'm using this from a templated class and it would
>> be helpful if I didn't have to specially treat the size 0 case.
>
> Vector, list and deque (experimental) all have converting ctors for
> the zero length case now.
>
>> Or, perhaps there is another simple solution I'm missing... :-)
>
> No, I think your solution is simple and the right one, it definitely
> improves the uniformity of container behaviour in Fusion.
>
> Thanks for pointing this one out
>

Hmm after updating I now can't

#include <boost/fusion/sequence/container/vector.hpp>

in my source code on RVCT. It complains with:

boost/fusion/sequence/conversion/detail/as_vector.hpp", line 41: Error:
  #70: incomplete type is not allowed
               return vector<>();
                      ^

:(

Any Ideas?

Thanks,

Michael Marcin


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