Re: [Cppcms-users] How to set default response().out() stream precision?
Brought to you by:
artyom-beilis
From: Artyom B. <art...@ya...> - 2012-06-18 09:11:41
|
----- Original Message ----- > From: "ele...@ex..." <ele...@ex...> > To: cpp...@li... > Cc: > Sent: Monday, June 18, 2012 11:56 AM > Subject: Re: [Cppcms-users] How to set default response().out() stream precision? > > I went ahead and made a patch my self. > > File attached. Goes ahead HEAD. > > Now doing response().ostream().precision(9) works. > I would not apply this patch for several reasons. 1. I keep a right to change ostream object, for example, older version of CppCMS (1.0.1) used different ostream objects for different configurations/io-modes. 2. There is a locale stuff that should be defined 3. It would be very confusing. What happens if a user writes: response().ostream() << "foo"? It is bad idea to have different ostreams in response If you want to set precision... Do it right before rendering. Or if you want to setup other settings on "some_other_stream" and than use response().out().copyfmt(some_other_stream) Don't forget to configure the locale in some_other_stream Regards, Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ |