Boost logo

Boost Users :

From: Christian Henning (chhenning_at_[hidden])
Date: 2006-02-21 09:33:02


> > 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


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