Boost logo

Boost :

From: Robert Ramey (ramey_at_[hidden])
Date: 2006-08-02 11:25:37


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


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk