From: Dave Dribin (dave-ml_at_[hidden])
Date: 2005-04-15 15:05:42
I recently discovered lexical_cast, and it's very nice and elegant.
I'd like to put in a feature request, though: the ability to use a
default value rather than throwing an exception on conversion failure.
Basically, it would take a second argument that would be the value
returned if the conversion fails. This could be used directly in the
This eliminates the throwing and catching of an exception for cases
where conversion failure is not an exceptional.
I've attached a patch to lexical_cast.hpp found in Boost 1.32.0
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk