Uncacheable facet testcase

Martin Sebor sebor@roguewave.com
Wed Jun 4 16:03:00 GMT 2003


Nathan Myers wrote:
> 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.

You're right, it is (or soon will likely be) a defect. We discussed
it in some detail last year. The issue that tracks it is 360:

http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#360

Martin



More information about the Libstdc++ mailing list