C++20 introduces barriers, where a specified number of threads must arrive at the barrier, by calling arrive_and_wait(). Once all have arrived a completion function is called from one thread to reset the barrier. Then all the threads are released, perhaps to iterate and hit the barrier again. An example of barrier usage is found at https://en.cppreference.com/w/cpp/thread/barrier . How would you cleanly implement this same example in C++14? C++17 would also be of interest, but my constraint is really C++14.
Note that I am able to use C++20 in my VS 2019 by setting /std:c++latest but I have to also support VS 2015, which I assume doesn't offer std::barrier.