
"Fernando Cacciola" <fernando_cacciola@hotmail.com> writes:
"David Abrahams" <dave@boost-consulting.com> escribió en el mensaje news:uoe9abw3k.fsf@boost-consulting.com...
"Jost, Andrew" <Andrew_Jost@mentor.com> writes:
From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of Eelis van der Weegen
I am curious if there is support for what I'm calling a "dual_state" template class. From your description it sounds a lot like Boost.Optional. What are
Jost, Andrew wrote: the main differences? Eelis
I'll admit I did not even pause at Boost.optional when I scanned the library listing for previous work, a failure in my ability to connect the description, "Discriminated-union wrapper for optional values," with the concept I had in mind.
Oh, you're right! That is a terrible one-line description, because
a. It uses technical terms that many people probably don't know "discriminated union"
b. optional doesn't really act like a union (in any way that matches my intuition)! I understand the theoretical connection, of course, but nobody is thinking that way when they read brief descriptions.
Very good point. Right now I can think of
"A library to wrap and manipulate values can be be 'optional': that is, (explicitely) uninitialized"
but that doesn't sound very inspired.
Any proposals?
A container that uses no dynamic memory and holds at most one element: optional<T> can hold any value of T or none at all. -- Dave Abrahams Boost Consulting www.boost-consulting.com