Subject: Re: [boost] What about "Maybe" ?
From: Larry Evans (cppljevans_at_[hidden])
Date: 2009-12-20 21:30:43
On 12/20/09 20:11, OvermindDL1 wrote:
> On Sun, Dec 20, 2009 at 6:48 PM, Arnaud Masserann <arnaud1602_at_[hidden]> wrote:
>> Is there any interest for a "Maybe" utility class, like the one in Haskell ?
>> For those who don't know about Maybe, here is the Haskell ref :
>> And a code snippet showing its use :
> It looks like Boost.Optional from how it is used in your pastebin
> snippet. How is it different from Boost.Optional?
Boost Optional looks like variant with a single component and
*without* the never empty guarantee:
Instead of Optional, why not adapt variant to do both what variant does
and what optional does? All that would be required is simply allowing
an empty variant which could always be detected with a test for
which() == -1.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk