Boost C++ Libraries: Ticket #2811: date_time iostream dependencies https://svn.boost.org/trac10/ticket/2811 <p> For footprint and performance reasons our codebase uses boost with BOOST_NO_IOSTREAM. However, date_time has some iostream dependency in the form of std::ostringstream used for formatting string outputs. For example, the method partial_date::to_string uses std::ostringstream to convert an integer to a string. </p> <p> An alternative is as follows: </p> <pre class="wiki"> //! Returns string suitable for use in POSIX time zone string /*! Returns string formatted with up to 3 digits: * Jan-01 == "0" * Feb-29 == "58" * Dec-31 == "365" */ virtual std::string to_string() const { date_type d(2004, month_, day_); unsigned short c = d.day_of_year() - 1; // numbered 0-365 while day_of_year is 1 based... std::string ret; if (c/100) { ret += '0' + c/100; c = c%100; } if (c/10) { ret += '0' + c/10; c = c%10; } ret += '0' + c; return ret; } </pre><p> Would you be likely to accept a patch that simply omits all the iostream-dependent API, if BOOST_NO_IOSTREAM is defined? </p> <p> Is there a boost-friendly alternative to std::ostringstream? </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/2811 Trac 1.4.3