Consider the following two lines of code:
std::atomic_flag a { }; // Since C++20
std::atomic_flag a = ATOMIC_FLAG_INIT; // Until C++20
In C++20, the first line initializes a to the clear state, but if I use that in C++17, a will be initialized to an unspecified state. The second line is deprecated in C++20, but in C++ 17, it initializes a to the clear state. How can I have them both in a code? I guess I should use a macro, but what is that macro exactly? And does it work for the initialization of all the other std::atomic<T> types?