boost::variant has already the notion that it has not been set with any value. So there is no need to make it optional. -----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Igor R Sent: Thursday, October 09, 2008 12:52 To: boost-users@lists.boost.org Subject: Re: [Boost-users] boost::variant construction,assignment
I have chosen to make the private members r_ and v_ as pointers to allow for r_=0 and v_=0 (is this a "never do this" thing?).
You can also consider using boost::optionalboost::variant r_, v_; Then setR() would be just: r_ = rhs; _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users