C++ Logo

std-proposals

Advanced search

Re: [std-proposals] [[nodiscard]] friend

From: Robert Allan Schwartz <notbob_at_[hidden]>
Date: Wed, 18 Jan 2023 18:28:09 +0000
Giuseppe,

Does that mean the current code in <stop_token> will not compile under that draft?

Thanks,

Robert

> On Jan 18, 2023, at 1:16 PM, Giuseppe D'Angelo via Std-Proposals <std-proposals_at_[hidden]> wrote:
>
> Il 18/01/23 17:51, Robert Allan Schwartz via Std-Proposals ha scritto:
>> Header <stop_token>:
>> [[nodiscard]] friend bool operator==(const stop_token& lhs, const stop_token& rhs) noexcept;
>> I would have thought that this should be:
>> friend [[nodiscard]] bool operator==(const stop_token& lhs, const stop_token& rhs) noexcept;
>
> Interestingly enough (but unrelated), both declarations as written are ill-formed as per https://eel.is/c++draft/dcl.attr#grammar-5.sentence-3 .
>
> My 2 c,
> --
> Giuseppe D'Angelo | giuseppe.dangelo_at_[hidden] | Senior Software Engineer
> KDAB (France) S.A.S., a KDAB Group company
> Tel. France +33 (0)4 90 84 08 53, http://www.kdab.com
> KDAB - The Qt, C++ and OpenGL Experts
>
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals

Received on 2023-01-18 18:28:11