Joel, Joel de Guzman wrote: [snip] > Also, is there a reason why we can't allow: > > variant<int&, double&> var;
Nothing fundamental no, just some additional metaprogramming ;) It's supported now (see variant_reference_test). See below for a note on the semantics of the resultant variant type, though. > IIUC, internally, it's just a matter of storing a boost.reference_wrapper > if T is a reference. Well, IMO reference_wrapper isn't exactly the right solution since it is Assignable whereas references aren't. So I introduced (in the variant detail namespace) reference_content. It stores a reference, but allows placement new to occur in the variant implementation. The ultimate result of all this: variant< int& > is not Assignable, while variant< reference_wrapper<int> > is. I believe this is as it should be, but please disagree if you don't. [snip] > Am I missing something? > > TIA, > -- > Joel de Guzman Nope, thanks for the idea. Eric _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
