From: Thorsten Schuett (schuett_at_[hidden])
Date: 2005-08-17 10:32:08
On Wednesday 17 August 2005 16:06, Martin Wille wrote:
> Hartmut Kaiser wrote:
> > Martin Wille wrote:
> >>>future<int> f3 = f1 || f2;
> >>We'll probably need more than operator ||.
> >>E.g. consider f1 and f2 implement operations that consume
> >>time and may fail, e.g.:
> >>future<whatever> x = query_google_and_check_links_returned ||
> >>The local archive is faster than searching something over the
> >>but the search may fail. Having an or-operation that waits
> >>for the first
> >>function to return a *success* would be useful.
> > Interesting idea! Could we signal that by requesting the function to
> > throw a special exception?
> I think that would be viable. Another approach would be to pass a
> combiner (similar to what Boost.Signals does) and to use
> optional<whatever> as return types.
As I wrote above, I would prefer using optional<T> in this case.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk