
Bogdan M. wrote:
Hi Jeff, Thanks for your prompt answer. What I meant was to surround "" with something like:
string_type ("")
where string_type is a template-based type defined in the surrounding time_facet class.
Nevertheless, I tested a little bit more the code and it turned out that the crash is due to ss.str() in the same line (time_facet.hpp:308). Changing the code to :
boost::algorithm::replace_all(format, string_type (ss.str()), // <<<<<<<< use explicitly the standard string "");
seems to do the job.
What worries me is that the original/official version of the code looks correct. I checked with some folks using the same deployment(e.g., boost 1.33.1 & Visual Studio 2005) and they have the same problem with the sample I posted.
VS 2005 was released after 1.33.1 although we were regression testing on beta versions.
I am wondering whether we made a mistake while installing this particular version of boost or whether there is indeed something unusual with the way the compiler interprets the code in time_facet.hpp.
It's coming back to me now -- stupid me for relying on my memory -- completely forgotten even though it was just a few months. This problem was reported right after vc8 was released. We concluded that this was a serious problem in vc8 standard library -- someone reported it to MS. The following mails from the list might be helpful. http://lists.boost.org/Archives/boost/2006/02/101042.php http://lists.boost.org/Archives/boost/2006/02/101109.php http://lists.boost.org/Archives/boost/2006/02/101122.php Long story short is that if you pickup a few files from the current CVS head (see last link) things should be mostly better. Note, I'm NOT going to guarantee that it is 100% -- as I recall there were a couple code paths I could not easily fix. Please complain to your vendor for a bug fix -- the problem in their library is serious and needs to be fixed.
Would it be possible for you to see whether the program I posted works in your Visual Studio 2005 setup?
Nope -- I don't develop date-time on Windows. Jeff