Boost logo

Boost :

From: Joel de Guzman (djowel_at_[hidden])
Date: 2003-08-30 23:55:25


Brian McNamara <lorgon_at_[hidden]> wrote:

> In any case, I suppose my point with both of those issues is that
> Haskell already has some kind of standard/idiomatic way to sugarize over
> the details of dealing with Maybes. I don't think we have anything
> equivalent in C++, so it's not clear to me what we can learn from
> Haskell when trying to design the interface for optional in C++.

Right. Consider that suggestion withdrawn, although it might be interesting
to see new C++ idioms in the future. Are there other languages out there
with a maybe or optional?

In any case, the optional value/pointer semantics issue is still present. I still
assert that, conceptually, the closest approximation of an optional is:

    variant<T, none>

I would very much wish that it would behave as such.

-- 
Joel de Guzman
http://www.boost-consulting.com
http://spirit.sf.net

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