On Tue, 2 Mar 2021 at 00:21, Thiago Macieira <thiago.macie...@intel.com> wrote:
> But the code I posted, if people are careful to use write like I did, would > allow us to have the experimental "we're not sure this is right" > implementation of atomic waits, latches, barriers and semaphores right now. The code assumes that as soon as __cplusplus bumps and a header is present, things are stable. I don't think that's a safe assumption to make. Furthermore, the second #if tries to check a feature-testing macro without including either the corresponding header or <version>. That doesn't work. You need to either include <version> and check a macro, or check that <latch> exists, then include <latch> and then check the macro. But other than that, sure, as QoI, vendors could already provide the standard macros with numbers that are lower than the standard ever specified. Going forward, if existing facilities are changed, this stops working because now you'd have to track the WPs to see which values are "vendor-bogus". I find it better to just change the macros whose facilities changed during a standard cycle, and in those cases bump the IS macro, that'll then work going forward. In the meanwhile, when vendors can, they could use the technique you describe, but that's barely worth proposing as an SG10 guideline because they would've needed to do it already, but didn't. :P