Boost logo

Boost :

Subject: Re: [boost] [outcome] Second high level summary of review feedback accepted so far
From: Andrzej Krzemienski (akrzemi1_at_[hidden])
Date: 2017-05-30 22:55:48


2017-05-30 23:49 GMT+02:00 Peter Dimov via Boost <boost_at_[hidden]>:

> Vicente J. Botet Escriba wrote:
>
> Do you want that boost.shared_ptr checks if not null before access on
>> operator->?
>>
>
> Checking in shared_ptr::op-> is narrow, by the way, and I regret putting
> that in. Should have been wide. Now we have endless debates whether to drop
> the noexcept because LWG guideline. (A daft guideline if you ask me, but
> that's what happens when people don't understand what the words "undefined
> behavior" mean.)
>

Peter, could you clarify the above. We can see three code snippets:

>
> To expand on that a bit:
>
> T* operator->() const noexcept;
> Requires: get() != nullptr.
> Returns: get().
>
> Narrow, a mistake.
>

You say, you do not like the above, right? You call this mistake *only*
because of this LWG guideline?

>
> T* operator->() const noexcept;
> Returns: get().
>
> Wide, as it should have been.
>

You say, you like the above, right? But what does it mean? That it returns
a `(T*)nullptr` ? This is the same as your value_if?

Regards,
&rzej;


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