C++ Logo


Advanced search

Re: "logical name" of importable headers

From: Gabriel Dos Reis <gdr_at_[hidden]>
Date: Fri, 3 Jun 2022 21:39:59 +0000
You just reminded me why I discouraged WG21 from going with the future test macros train 😊

I will repeat what I said back then, if you're compiling with a certain standard language version set, you should just accept that the feature is available instead of playing #ifdefry games with feature test macros. They have their own ways of backfiring.

-- Gaby

-----Original Message-----
From: Daniel Ruoso <daniel_at_ruoso.com>
Sent: Friday, June 3, 2022 2:01 PM
To: Gabriel Dos Reis <gdr_at_[hidden]>
Cc: sg15_at_[hidden]
Subject: Re: [SG15] "logical name" of importable headers

Em sex., 3 de jun. de 2022 às 16:48, Gabriel Dos Reis
<gdr_at_[hidden]> escreveu:
> Do you see silent semantics change, or a loud compilation break?
> Any example?

One example is the version macros for specific things, such as
#define __cpp_lib_scoped_lock 201703
in the mutex header on libstdc++.

If that macro is no longer in scope after the code says #include
<mutex>, it could silently change behavior if anyone has an #if on
that macro.


Received on 2022-06-03 21:40:02