
----- Original Message -----
From: Yakov Galka <ybungalobill@gmail.com> To: boost@lists.boost.org Cc: Sent: Wednesday, June 27, 2012 11:33 AM Subject: Re: [boost] [nowide] Updates and Standalone Version
Proposal: Add a sentry class that overrides std::cout/cerr/cin to work as boost::nowide::*.
Good idea, it also would allow to override std::c(in|out|err|log) globally in main() function.
I understand that it cannot be done by default since it may 'break' code that writes to std::* and assumes some other encoding. However, when writing application code it's a reasonable assumption that 3rd party libraries will not write non-ASCII text to the global streams.
The biggest problem is that if the original std::streambuf is not restored prior to destruction of std::c(out|in|err|log) than the application tends to crash :-)
-- Yakov
Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/