
So you dislike
if ( !(t = TryToGetT()) ) { ...other way to get t ... }
In my example, t is not boost::optional but the underlying type, and TryToGetT returns boost::optional, so this does not compile. Or do you mean making t a boost::optional? This would work, but in my case, t is not meant to be "optional". For example, it may be a member which is set in the constructor, so making it a boost::optional seems wrong in the context of the class. Arno -- Dr. Arno Schoedl · aschoedl@think-cell.com Technical Director think-cell Software GmbH · Invalidenstr. 34 · 10115 Berlin, Germany http://www.think-cell.com · phone +49-30-666473-10 · toll-free (US) +1-800-891-8091 Directors: Dr. Markus Hannebauer, Dr. Arno Schoedl · Amtsgericht Charlottenburg, HRB 85229