
1 Aug
2006
1 Aug
'06
3:19 p.m.
So what is needed is a "companion" facet which traps attempts to write NaNs and throws an exception. Usage of one or the other of these facets would eliminate undefined behavior.
Robert Ramey
I have uploaded such facets to the vault. They are called strict_num_put and strict_num_get. However, they do not throw exceptions, they set the failbit of the stream. I noticed that, at least with VC++ 7.1., if the facet throws an exception, then the stream catches the exception and sets the failbit anyways. --Johan