|
Boost Users : |
Subject: Re: [Boost-users] boost::variant construction,assignment
From: peter_foelsche_at_[hidden]
Date: 2008-10-09 16:31:30
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_at_[hidden] [mailto:boost-users-bounces_at_[hidden]] On Behalf Of Igor R
Sent: Thursday, October 09, 2008 12:52
To: boost-users_at_[hidden]
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::optional<boost::variant> r_, v_;
Then setR() would be just: r_ = rhs;
_______________________________________________
Boost-users mailing list
Boost-users_at_[hidden]
http://lists.boost.org/mailman/listinfo.cgi/boost-users
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net