Uncacheable facet testcase

Nathan Myers ncm-nospam@cantrip.org
Wed Jun 4 05:01:00 GMT 2003


On Wed, Jun 04, 2003 at 12:28:37AM -0400, Jerry Quinn wrote:
> I discovered the following (unfortunate) testcase of a facet that
> cannot be cached for later use.  The implication is that in general,
> the facets canot be cached safely.  As best as I can interpret the
> spec, this program is valid.
> ...
> bool flip = false;
> ... 
>   string_type do_truename() const
>   { if (flip) return "false"; else return "true"; }

If this example appears to be allowed, that is a defect.  We should
not attempt to support any particular semantics for such a facet.
It was a specific design goal of the locale architecture that all
facet results can be assumed to be stable and cacheable.

Note that the text defining how stable facet results must be has
been subject to revision in defect reports.

> Anyway, I'd like to add it into the test suite.  Where is the best
> place for this to go?  It doesn't really seem to fit in well with any
> of the existing subdirs in 27_io.

I don't think this should be in the test suite.

Nathan Myers
ncm@cantrip.org



More information about the Libstdc++ mailing list