Boost logo

Boost :

Subject: Re: [boost] optional<optional<T>>
From: OvermindDL1 (overminddl1_at_[hidden])
Date: 2009-09-02 23:05:19


On Wed, Sep 2, 2009 at 8:52 PM, Joel de Guzman<joel_at_[hidden]> wrote:
> Andrei Alexandrescu wrote:
>>
>> Hello,
>>
>>
>> I'm defining an "optional" type for D's standard library modeled similarly
>> to Boost.optional. An interesting question came up - should
>> optional<optional<T>> fold itself into optional<T>, or is "double optional"
>> an interesting concept of its own?
>>
>> I thought I'd ask here because by now there's a significant body of
>> experience with optional<T>. I perused the online documentation and the
>> forum and couldn't find information about that specific detail.
>
> We use boost.optional extensively in Boost.Spirit. IIRC, we collapse
> such things. Usually they occur in generic code. I see no real need
> for optional<optional<T>>. If there's a use for it, I too would like
> to hear it.

Slightly off-topic, but I consider D to be a *fascinating* language,
kind of like how C++ should have been. It would actually be *much*
easier to create Spirit in D then it would have been in C++, and you
could have used real PEG syntax instead of C++/D'ifying it. I never
really played around with D due to the lack of a Visual Assist quality
IDE for it though, but I have read through the language spec (much
better read then C++'s) multiple times just for the heck of it, and it
is absolutely fascinating! Kind of bugs me that it has two 'generic'
libraries that do the same things in different ways though, and you
cannot mix code that uses both...


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