
27 Feb
2009
27 Feb
'09
7:10 p.m.
On Feb 27, 2009, at 4:08 AM, Arno Schödl wrote:
I just started using boost::optional, and this proved to be generically useful, but I believe is currently not in boost::optional:
boost::optional< TMyValue > TryToGetT(); T t;
if( !optional_assign( t, TryToGetT () ) { ... other way to get t ... }
instead of the more verbose:
boost::optional< TMyValue > TryToGetT(); T t;
So you dislike if ( !(t = TryToGetT()) ) { ...other way to get t ... } For efficiency reasons? -- David Abrahams BoostPro Computing http://boostpro.com