Boost logo

Boost :

Subject: Re: [boost] What about "Maybe" ?
From: Jeffrey Hellrung (jhellrung_at_[hidden])
Date: 2009-12-21 02:11:47

OvermindDL1 wrote:
> Actually optional is pretty near to being exactly:
> optional<T> == variant<nil_t,T>
> And an easier accessor function of course.

Easier *and* faster, since "dereferencing" (via unary operator* or get)
only asserts that the optional is initialized, hence doesn't need to
access its initialization state bit. As far as I know, Boost.Variant
always needs to access its "which" state.

- Jeff

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