Boost logo

Boost Users :

Subject: [Boost-users] date _facet segmentation fault
From: Kraus Philipp (philipp.kraus_at_[hidden])
Date: 2011-08-03 09:00:03


Hello,

I use this little code for formating a date value:

std::stringstream l_stream;

boost::gregorian::date_facet* l_format = new boost::gregorian::date_facet();
l_format->format("%Y-%m-%d");

l_stream.imbue(std::locale(std::locale::classic(), l_format));

If I call after the imbue a delete (delte l_format) to remove the date_facet from the heap
the program creates a segmentation fault value.

Does the std::stringstream remove the date_facet object from the heap? If not, how can I
do a correct clear of the object? I hope, that question is not off topic.
I would like to format a date value in a stringstream

Thanks alot

Phil



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net