C++ latch implementation
First the obvious stuff: the real std::latch::arrive_and_wait is specified to take a ptrdiff_t parameter that defaults to 1, but would also support e.g. myLatch.arrive_and_wait(2). Also, there are more member functions than just arrive_and_wait.

I'd call your thing a "spinlatch" (by analogy to "spinlock"), because it doesn't actually put the thread to sleep — it has an operation named arrive_and_wait that doesn't actually do any waiting! It just keeps loading and loading the atomic variable until it sees zero.

To make it actually wait, you could use the also-new-in-C++20 futex facilities of std::atomic, like this:

void arrive_and_wait(int n = 1) {
    int current = (count -= n);
    if (current == 0) {
        count.notify_all();
    } else {
        while (current != 0) {
            count.wait(current);
            current = count.load();
        }
    }
}


No comment on the memory orders.