
24 Apr
2006
24 Apr
'06
3:49 p.m.
John Maddock wrote:
boost::optional opt = mymap["fee"]["far"]["thumb"];
would never throw, and
In fact, it wouldn't even compile, because optional is a template. But I get what you mean, and I like it. boost::optional<int> opt = mymap["fee"]["far"]; throws if fee/far exists and is not convertible to int, returns none if fee/far does not exist, returns the converted value if it exists and is convertible. Sebastian Redl