
12 Mar
2006
12 Mar
'06
10:38 a.m.
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