Closed nmcclatchey closed 1 year ago
https://www.modernescpp.com/index.php/latches-in-c-20
I have question. When I use C++2a commands in gcc 11.3.0 I have info that gcc isn't std::latch
.
workers.cpp:8:6: error: 'latch' in namespace 'std' does not name a type
8 | std::latch workDone(6);
| ^~~~~
When I use 'latch.h' gcc 11.3.0 and above hasn't problem. https://github.com/luncliff/latch
What is your question? GCC doesn't support std::latch
for MinGW, that's the whole point of this issue.
I am a programming enthusiast. I understand that the added
#if __cplusplus >= 202002L
#include <barrier>
#include <bit>
#include <compare>
#include <concepts>
#include <format>
#include <latch>
#include <numbers>
#include <ranges>
#include <span>
#include <stop_token>
#include <semaphore>
#include <source_location>
#include <syncstream>
#include <version>
#endif
Strange thing. I have no problem with std::stop_token
plus mingw modification.
Issue tracking implementation of
latch
es, introduced in C++20.See latch on cppreference.com.
Potential implementations:
condition_variable
. Mostly efficient. May have issues with cost of construction / destruction.