
9 Feb
2009
9 Feb
'09
6:42 p.m.
Chris Hamilton wrote:
boost::variant currently can not handle the following code: [...] boost::variant<foo*,foo&> v; [...] My question is essentially this: why couldn't it?
I suppose it requires the types to be value types, otherwise assignment and copy don't make sense. It's just like containers really. What's wrong with using T* or reference_wrapper<T> instead of T&?