std::latch is one of the simple synchronization primitives introduced with C++20.
Latches are initialized to a specific count, can be atomically decreased and used to block until the count reaches zero.
Click to open in Compiler Explorer.
Leave a comment