-
Notifications
You must be signed in to change notification settings - Fork 7
Description
Review comment:
Without a constructor or conversion mechanism from string, when using
decimal to store numbers received off the wire one would either have to
round trip through (lossy) strtod or write a conversion function, which is
tiresome.
While I largely agree with this - lets make the easy stuff easy - I accept that cohorts and the error handling question make this harder and more controversial than it should be.
I'm inclined to suggest that an explicit constructor would be useful, with thrown exception on error in exception-enabled environments. When exception handling is off we have an issue as you rightly point out, and while we do have boost::throw_exception that aborts by default without exceptions which is non-useful, so I think I agree with your suggestion to set to NaN in that case.
Cohort behaviour needs to be clearly documented for all these conversion functions.