Boost logo

Boost :

Subject: Re: [boost] [optional] Why was optional<T>::reset() deprecated?
From: Marcel Raad (raad_at_[hidden])
Date: 2016-03-04 16:00:27

Gavin Lambert wrote
> It still bothers me a bit that none and nullptr are separate. Do we
> really need two different ways to spell "nothing"?
> I suppose there is a use case for optional
> <some-pointer-type>
> which
> could have distinct states for "no pointer" vs. "null pointer" vs.
> "valid pointer", but how often do you really need to distinguish the
> first two states?

I have one such case in one project with optional<shared_ptr> where I have
to distinguish nullptr from none, meaning "don't know".

And I have several cases where nullptr means "override some pointer with
nullptr" and none means "don't override that pointer."

View this message in context:
Sent from the Boost - Dev mailing list archive at

Boost list run by bdawes at, gregod at, cpdaniel at, john at