
21 Dec
2009
21 Dec
'09
7:11 a.m.
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