
2 Aug
2006
2 Aug
'06
3:25 p.m.
Johan RĂ¥de wrote:
What do you thing of Robert Ramey's idea of making it possible to configure a stream to report an error when a non-finite number is inserted or extracted? This could be done with a new stream flag and corresponding manipulators.
Actually I was envisioning that one would just add the desired facet after the stream was created. I don't see that this would require any new stream flags or manipulators. Something like // make a new locale std::locale float_locale(std::locale::global(), new codecvt_strict_float()); fostream os("filename"); os.imbue(float_locale); //... operations on os use fixed or strict floating point output Robert Ramey