
On Wed, 14 Mar 2007 15:26:11 -0400, "Braddock Gaskill" <braddock@braddock.com> said:
On Wed, 14 Mar 2007 14:09:37 -0400, Frank Mori Hess wrote:
Another suggestion is to rename promise::set() (boring) to promise::fulfill() (makes me smile). And if there is an opportunity to work the name "empty_promise" in as a class or a concept, that would be clever too.
Personally, I love your fulfill() name. I would also prefer fail() to set_exception()...it seems more descriptive since it is more than just an accessor method. I didn't want to stray TOO far from Peter's C++ language proposal though.
I totally agree on using fulfill/fail rather than set/set_exception. IMHO pithy names like that also aid in understanding the concepts. Perhaps Peter can be persuaded :) I also didn't see an operator() on the promise<T> to set the value (although I might have missed it). I think that's important because it lets a promises participate more readily in boost::bind compositions, etc. Cheers, Chris