Boost logo

Boost :

Subject: Re: [boost] [optional] std::tr2::optional
From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2011-11-18 10:48:13


On Friday, November 18, 2011 16:24:35 Andrzej Krzemienski wrote:
>
> * Use nullptr instead of boost::none? - this will make some uses of
> optional pointers harder, but will make usage more clear in other cases.

I don't think nullptr is a good choice here because of the complications you
mentioned. Actually, I would prefer traditional clear() and empty() methods
for clearing and testing for value presence. The operator safe_bool() and
operator!() may also be present in the interface for brevity in conditional
expressions.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk