
21 Feb
2006
21 Feb
'06
2:33 p.m.
Something, like this:
date d(2005,06,25);
date_facet date_output;
Just as a note: this code is likely to crash when the stringstream is destroyed and date_output is deleted. You'll want to dynamically allocate these facets as shown in the date-time docs.
I'm probably not the first one to ask. But why is that behavior? Why is there a need for creating the facet in the heap instead on the stack? I'm usually a little picky when it comes to dynamically allocating memory. Thanks, Christian