Boost logo

Boost :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2004-04-14 02:15:10


Robert Ramey wrote:

> I have a simple question regarding basic_stream::imbue(locale &)
>
> Can it be applied after a file is opened?
>
> The state saver libray seems to suggest that it can.
>
> Some information suggests that it can if the file is position at the
> start.

Well, the standard says that:

   void imbue(const locale& loc);
Precondition: If the file is not positioned at its beginning and the
encoding of the current locale as determined by a_codecvt.encoding() is
state-dependent, then that facet is the same as the corresponding facet of
loc.

So the question is whether facet in default-constructed wifstream is
state-dependent or not. I've tried the following program with g++ and it
prints '0' (not state-dependent). Would be interesting to see what it
prints for you.

- Volodya




Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk