Boost logo

Boost :

From: Vaclav Vesely (vaclav.vesely_at_[hidden])
Date: 2006-03-11 17:13:36


Hi,

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

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

Both alternatives can be implemented simultaneously.

What do you think about it?

Regards,
Vaclav


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