Boost logo

Boost :

From: Joel de Guzman (djowel_at_[hidden])
Date: 2002-12-11 15:18:40


----- Original Message -----
From: "Fernando Cacciola" <fernando_cacciola_at_[hidden]>

> > It's trivial to make that a free function like get. Or further, to make
> > a subset API for optional.
> >
> You can certainly do the same with variant. The point is that with
> optional<> it is *easier*.
> With optional<> you don't need to specify the type of the wrapped value all
> the time as with variant; and you don't need to explicitly test if the
> variant holds a "nil_t" in order to see if it is initialized.

And my point, again, is that you can easily add an *easier* API
that does exactly like your optional API *over* the variant. My
concern is primarily about redundancy of code. I don't see any
reason why the optional and the variant can't share the same
underlying infrastructure.

Joel de Guzman
joel_at_[hidden]
http://www.boost-consulting.com


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk