Whenever boost's numeric_cast<>
conversion fails, it throws an exception. Is there a similar template in boost that lets me specify a default value instead, or is catching the exception the only thing I can do in this case?
I'm not too worried about the performance of all the extra exception handling, but I'd rather use a standard template than write useless wrapper functions. Besides, from past experience, I thought it's likely that boost actually has what I'm thinking of, and I simply haven't found it.