
I will put together a facet that solves my problem on the platforms that I'm targeting. I don't know if it's possible to put together a general solution that works for all projects with all compilers and all processors. I was very surprised when you told me that the problem was with the streams. It is strange that std::stringstream s; double x = std::numeric_limits<double>::infinity(); double y; ss << x; ss >> y; assert(x == y); does not work (at least not with VC++ 7.1). --Johan Råde Robert Ramey wrote:
Should you decide to make the described num_put/get facets you might consider investing a little more effort to:
a) make them templated on the char/wchar_t type. b) include a boost like document - you can use the utf-8 codecvt facet as a model. c) included a test or two. d) Upload the whole package to the vault.
If you're a glutton for punishment, you can request a mini-review and maybe get it accepted into Boost.
I would be personally grateful to anyone who undertakes this as it would resolve, an issue which comes up repeatedly.
Of course nothing is easy as it first appears. There is the quesion of how such facets might interact with other locale dependent facets. Also I'm not sure that stringstream handles these facets in the same way as other ones do. Hopefully, all these questions would be addressed with a little research..... And you need to do it anyway for your own application. This is just about as close as you're ever going to get to being famous for nothing.
Good Luck
Robert Ramey
Johan Råde wrote:
I agree. This has nothing to with the serialization lib. I will use the solution that you suggest. Thanks for the help.
--Johan Råde
cgi/boost-users
------------------------------------------------------------------------
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users