Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2005-07-11 08:01:03


Andrey Melnikov <melnikov_at_[hidden]> writes:

> David Abrahams wrote:
>> "Jost, Andrew" <Andrew_Jost_at_[hidden]> writes:
>>
>>
>>>>From: boost-bounces_at_[hidden]
>>>
>>>[mailto:boost-bounces_at_[hidden]] On Behalf Of Eelis van der Weegen
>>>
>>>
>>>>Jost, Andrew wrote:
>>>>
>>>>>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
>>>
>>>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.
>>
> Well, even despite I do understand what "discriminated union" is, it's
> more an implementation detail than a brief descripton of practical
> applications for the library.
>
> I found Boost.Optional very useful for myself.
>
> http://www.boost.org/libs/optional/doc/optional.html#inplace describes a
> usage scenario which has almost nothing to do with optionality.

Yeah, I wanted to use that, but the documentation seemed incomplete.
I reported it (http://lists.boost.org/MailArchives/boost/msg71490.php)
but it's not clear that the docs have been updated since then.

-- 
Dave Abrahams
Boost Consulting
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