Boost C++ Libraries: Ticket #6034: Problem of the split function in boost/date_time/time_parsing.hpp https://svn.boost.org/trac10/ticket/6034 <p> If we call the function <strong>split</strong> with the string "2010-01-01" and " " as delimiter then the function sets the variables <strong>first</strong> and <strong>second</strong> with "2010-01-01" Maybe we should write this piece of code to initialize the parameter <strong>second</strong> with the correct value. </p> <pre class="wiki">bool split(const std::string&amp; s, char sep, std::string&amp; first, std::string&amp; second) { int sep_pos = static_cast&lt;int&gt;(s.find(sep)); first = s.substr(0,sep_pos); second = sep_pos == -1 ? "" : s.substr(sep_pos+1); return true; } </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/6034 Trac 1.4.3 fbriol@… Wed, 19 Oct 2011 12:21:07 GMT <link>https://svn.boost.org/trac10/ticket/6034#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6034#comment:1</guid> <description> <p> The problem was discovered by calling </p> <pre class="wiki">boost::posix_times::time_from_string("2010-05-30") </pre><p> Indeed in this case the function call parse_time_duration with "2010-05-30" ! </p> </description> <category>Ticket</category> </item> </channel> </rss>