
On Feb 4, 2009, at 10:53 AM, Alexander Nasonov wrote:
Andrew Troschinetz <ast <at> arlut.utexas.edu> writes:
Here's some example usage: http://codepad.org/hn6MjKjm
It's not clear from the example that this inliner
lexical_cast< optional<int> >("x").get_value_or(-1);
is a replacement for
lexical_cast("x", -1);
I actually hadn't thought of that inliner, but now that I see it I prefer it because I think it's cleaner conceptually and from an interface standpoint. It also means there's no need for a lexical_cast specialization for optional types, which I wrote all the while with a feeling of "there must be a better way to do this." But that inliner still doesn't get around the problem of types that aren't default constructible. -- Andrew Troschinetz Applied Research Laboratories