C++ Logo

liaison

Advanced search

Re: [wg14/wg21 liaison] [isocpp-core] Ignorability of attributes: draft wording, and concern about __has_c_attribute

From: Herring, Davis <herring_at_[hidden]>
Date: Wed, 8 Feb 2023 18:31:29 +0000
> Feel free to file a comment for CD2, but I'd be strongly opposed to
> it. I've been asking around to see what less senior programmers think
> of the EWG direction on the poll yesterday. I've yet to find someone
> who understands it, even after I explain the reasoning as best I can.
> Universally, the response has been "but I thought __has_cpp_attribute
> told me if the attribute does the thing, why would I care if it parses
> but doesn't do anything?". I think the current direction is going to
> break a lot of user expectations.

I'm not sure why this is different from any other feature-test macro. If I check __cpp_lib_execution, that means that I have that feature -- which is defined as "you can, syntactically, supply an ExecutionPolicy, and it might make the code faster". I don't find out whether it's faster; I find out whether I can ask for it to be faster. If I check __has_cpp_attribute(assume), that means that I have that feature -- which is defined as "you can, syntactically, supply assumptions, and it might make the code faster". I don't find out whether it's faster; I find out whether I can ask for it to be faster.

Davis

Received on 2023-02-08 18:31:34