C++ Logo

std-proposals

Advanced search

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

From: Giuseppe D'Angelo <giuseppe.dangelo_at_[hidden]>
Date: Wed, 18 Jan 2023 19:44:42 +0100
Il 18/01/23 19:28, Robert Allan Schwartz ha scritto:
> Giuseppe,
>
> Does that mean the current code in <stop_token> will not compile under that draft?

Well, I know what the wording is aiming for there -- the functions are
meant to be hidden friends, and therefore in any actual implementation
they would be actually defined and not just declared:

https://eel.is/c++draft/hidden.friends


I'm not sure if an explicit provision is missing from
https://eel.is/c++draft/stoptoken.nonmembers , along the lines of
"Remarks: This function is to be found via argument-dependent lookup
only.". This kind of remarks get periodically refactored in more general
clauses or subclauses, to centralize the description of the intended
behaviors.


This is not to say that 100% of the code that one finds in a header
synopsis is meant to be compilable as-is -- they're full of "exposition
only", "see below" and other meta-tokens. It was just curious that that
particular line indeed is ill-formed. It should likely be clarified,
again through an editorial submission.


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

Received on 2023-01-18 18:44:45