meganz / mingw-std-threads

Standard threads implementation currently still missing on MinGW GCC on Windows
BSD 2-Clause "Simplified" License
439 stars 137 forks source link

C++20 feature: latch #67

Closed nmcclatchey closed 1 year ago

nmcclatchey commented 4 years ago

Issue tracking implementation of latches, introduced in C++20.

See latch on cppreference.com.

Potential implementations:

Jamaika1 commented 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

jwakely commented 1 year ago

What is your question? GCC doesn't support std::latch for MinGW, that's the whole point of this issue.

Jamaika1 commented 1 year ago

I am a programming enthusiast. I understand that the added function is mingw's internal function. What are features not supported in gcc 13.0.0 for C++20?

#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.