id summary reporter owner description type status milestone component version severity resolution keywords cc 4846 streaming gregorian::date objects to std::cout leaks memory robbie@… az_sw_dude "there seems to be a problem streaming boost::gregorian::date objects to std::cout, but not to std::ostringstream / whilst noting that this could be a valgrind issue consider the following code {{{ // build : $ g++ -ggdb -Wall -pedantic -Weffc++ test.cc -o test // run : $ valgrind ./test // compiler : g++ (Ubuntu 4.4.3-4ubuntu5) 4.4.3 // library : Boost 1.44.0 #include // standard io #include // string-streams #include int main() { namespace bg = boost::gregorian; // namespace alias const bg::date today(2010, bg::Nov, 12); // 'const' not significant std::ostringstream oss; oss << today; std::cout << ""today (1) : "" << oss.str() << std::endl; // okay std::cout << ""today (2) : "" << today << std::endl; // faulty } }}} valgrind output {{{ ==15924== Memcheck, a memory error detector ==15924== Copyright (C) 2002-2009, and GNU GPL'd, by Julian Seward et al. ==15924== Using Valgrind-3.6.0.SVN-Debian and LibVEX; rerun with -h for copyright info ==15924== Command: ./test ==15924== today (1) : 2010-Nov-12 today (2) : 2010-Nov-12 ==15924== ==15924== HEAP SUMMARY: ==15924== in use at exit: 1,544 bytes in 26 blocks ==15924== total heap usage: 64 allocs, 38 frees, 4,609 bytes allocated ==15924== ==15924== LEAK SUMMARY: ==15924== definitely lost: 0 bytes in 0 blocks ==15924== indirectly lost: 0 bytes in 0 blocks ==15924== possibly lost: 568 bytes in 19 blocks ==15924== still reachable: 976 bytes in 7 blocks ==15924== suppressed: 0 bytes in 0 blocks ==15924== Rerun with --leak-check=full to see details of leaked memory ==15924== ==15924== For counts of detected and suppressed errors, rerun with: -v ==15924== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 4 from 4) }}} " Bugs new To Be Determined date_time Boost 1.44.0 Problem