C++ Logo

sg10

Advanced search

Re: [SG10] Feature test macro for init-statements

From: Jason Merrill <jason_at_[hidden]>
Date: Thu, 28 May 2020 10:59:54 -0400
On Fri, Mar 20, 2020 at 9:51 PM Richard Smith via SG10 <
sg10_at_[hidden]> wrote:

> On Fri, Mar 20, 2020 at 6:41 PM Leo Carreon via SG10 <
> sg10_at_[hidden]> wrote:
>
>> Are there any feature test macros for the following?
>>
>> 1. init-statement for if and while statements (P0614R1)
>> 2. init-statement for range-for (P0305R1)
>>
>> I’m asking because I couldn’t find any reference to them in the C++20
>> draft or in SD-6.
>>
>
> No, there are no feature test macros for those features. Generally we
> don't provide feature test macros in the case where you could use the
> "feature not available" version of the code unconditionally with no loss of
> functionality, which would generally be the case for these features.
>

FWIW one of my users was disappointed with this response, because he wants
to static_assert all the features he depends on, and leaving some features
out "makes C++ look less uniform". I told him I'd pass his feedback along.

Jason

Received on 2020-05-28 10:03:14