From: Václav Veselý (vaclav.vesely_at_[hidden])
Date: 2006-03-12 05:38:31


Hi,

There is a common need of getting a value from an optional with possibility
to
define a default value in case of the optional is uninitialized. I suggest
two
alternatives:

    optional<int> o;
    int i = o.get(123); // a meber function get with an additional parameter
    int j = from_optional(o, 123); // a free function

Both alternatives can be implemented simultaneously.

What do you think about it?

Regards,
Vaclav