|
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: http://boost.2283326.n4.nabble.com/optional-Why-was-optional-T-reset-deprecated-tp4684033p4684172.html Sent from the Boost - Dev mailing list archive at Nabble.com.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk