C++ Logo

std-discussion

Advanced search

Re: Inconsistency in Examples

From: Jens Maurer <jens.maurer_at_[hidden]>
Date: Fri, 24 Nov 2023 19:04:51 +0100
On 24/11/2023 12.33, Bjorn Reese via Std-Discussion wrote:
> On 11/23/23 22:38, Jens Maurer via Std-Discussion wrote:
>
>> You're looking at the declaration of "operator new", but you've
>> written a new-expression in your example. It's not clear to me
>> that [[nodiscard]] on the former has any effect on the latter.
>
> Related to this, placement-new operators are marked nodiscard
> [new.delete.placement], but the function construct_at() is not
> [specialized.construct]. Is that deliberate or an oversight?

I think we're generally lacking a plan for [[nodiscard]] throughout
the library, meaning we're occasionally inconsistent.

Jens

Received on 2023-11-24 18:05:04