Boost logo

Boost :

Subject: Re: [boost] [optional] little addition
From: Arno Schödl (aschoedl_at_[hidden])
Date: 2009-02-27 14:57:40

> 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.


Dr. Arno Schoedl · aschoedl_at_[hidden] 
Technical Director 
think-cell Software GmbH · Invalidenstr. 34 · 10115 Berlin, Germany · phone +49-30-666473-10 · toll-free (US) +1-800-891-8091
Directors: Dr. Markus Hannebauer, Dr. Arno Schoedl · Amtsgericht Charlottenburg, HRB 85229

Boost list run by bdawes at, gregod at, cpdaniel at, john at