C++ Logo

liaison

Advanced search

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

From: Uecker, Martin <Martin.Uecker_at_[hidden]>
Date: Wed, 8 Feb 2023 19:57:32 +0000
Am Mittwoch, dem 08.02.2023 um 19:31 +0000 schrieb Herring, Davis:
> > > I'm not sure why this is different from any other feature-test macro.
> > > [...]
> >
> > What would be the use case for this?
>
> Well, certainly some feature-test macros indicate the presence of significant portable functionality: __cpp_lib_ranges_iota, for example. It is equally certain that feature-test macros are
> of less value when they indicate the presence of things that do not have such portable functionality. Set against this is the questionable value that a "really does what I ask" test has in
> a context where "really" isn't very meaningful.

You seem to be arguing against having something
like __has_c_attribute at all. But in practice
people found it useful.

But testing for an attribute where then only syntax
is checked by the compiler seems completely useless
to me. I was asking for an example where this make
sense, because I could not come up with one.

So is there one?


Martin

Received on 2023-02-08 19:57:36