I am compiling with g++ 10.2 using -std=c++20
but i get errors like error: ‘atomic_notify_one’ is not a member of ‘std’
. I see in the docs that those methods are supported in c++20. Do i miss something?
Asked
Active
Viewed 249 times
1

christk
- 834
- 11
- 23
-
3You miss the fact that `-std=c++20` does not mean that all C++20 features are available. According to https://gcc.gnu.org/onlinedocs/libstdc++/manual/status.html, the relevant P1135R6 has not yet been implemented in libstdc++. – Daniel Langr Apr 23 '21 at 13:19
1 Answers
0
As far as I understand neither g++-10.2 nor g++-10.3 does not support atomic_notify_one
. However, here the trunk version of the compiler (in which __cplusplus
is equal to 202002), as well as my local unstable version of the compiler g++-11.0 (in which __cplusplus
is also equal to 202002) perfectly cope with the functions atomic_notify_one
, atomic::notify_one
And BTW, unfortunately I did not find official support information. In some places it is introduced in g++-10, in some it is still not implemented yet. Cppreference says it is implemented in g++-11, so I guess it is. In general I would not rush to use atomic_notify_one
in production

Deumaudit
- 978
- 7
- 17