On 05/05/2014 09:21 PM, Niall Douglas wrote:
Remind me: is proposed expected<T> still essentially the value and exception transport mechanism of promise<T>/future<T>? It may have evolved since, or I got its intent wrong.
Last I looked, yes.
Another useful example could be a one-to-one latch (as in N3666.)
I had thought Alasdair's latch a sort of inverted semaphore? Can you clarify what you mean by one to one latch?
A permit triggers on the first "count-down". The "latch" should trigger after N count-downs. This may be useful to wake up a thread for, say, every N asynchronous operation. The idea of this example is simply to illustrate how a permit can be combined with an atomic counter.
If gate is no good, we could use boost::event, though I personally think that is a bit too likely to clash.
Gate and event are probably too general-purpose to be placed directly in the boost namespace.