Boost logo

Boost :

From: dan marsden (danmarsden_at_[hidden])
Date: 2007-07-06 17:08:41

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



Yahoo! Answers - Got a question? Someone out there knows the answer. Try it

Boost list run by bdawes at, gregod at, cpdaniel at, john at