
Hello,
#include <iostream> #include <boost/date_time/posix_time/posix_time.hpp>
int main() { std::cout << boost::posix_time::microsec_clock::local_time() << std::endl; return 0; }
Generally boost::posix_time imbues its own facet into the locale std::cout steam. So this facet remains reachable because AFAIK std::cout is not destroyed at all. So if you do: std::cout.imbue(std::locale::classic()); Before return, no "leaks" would be at all. Same as if you would write to any destroyable stream like std::ostringstream; std::ostringstream tmp; tmp << boost::posix_time::microsec_clock::local_time(); std::cout << tmp.str() << std::endl; So it is rather C++ design question why std::cout does not destroy its own locale. Artyom