
On Sunday 13 April 2008 22:06, vicente.botet wrote:
1) First - future<T>::add_callback(f).
add_callback is a hook called when the future is fulfilled. End users probably shouldn't have to touch it, but framework authors (who write schedulers, asio, co-routines, etc) will DEFINITELY need it.
I agree with Braddock, although in libpoet I chose to make poet::future depend on thread_safe_signals and so used signals/slots instead of rolling yet another callback mechanism. The schedulers in libpoet rely on the signals coming from futures to know when one of the method requests in their queue has become ready so they can wake up and process it.
add_callback() enables the following:
-Future Operators ((f1 && f2) || (f3 && f2) etc) - With add_callback, custom future_operators can be written by users.
From the new documentation these operators are already provided by your
library. I don't like too much the overloading of the && and || operators when they don't have logical semantics, but this is only a question of style
I too dislike the operator|| and && overloading. Hopefully, these overloads are only enabled when the user deliberately includes a separate header for them, making them optional. -- Frank