lazy facet instantiation
Howard Hinnant
hhinnant@apple.com
Tue Nov 15 21:53:00 GMT 2005
On Nov 15, 2005, at 3:48 PM, Martin Sebor wrote:
>> It also affords one other really nice extension:
>
> We had this in an early version of our library but ended up
> taking it out. IIRC, one problem was that for the trick to
> work everything had to be a template or inline which would
> tend to have unpleasant consequences for compilation times.
This is a real issue. But one that I think is manageable.
> Another more serious issue with this had to do with the fact
> that user-defined facets need not have any particular kind
> of a constructor (default or otherwise), and use_facet can't
> just make an assumption that it does.
Here I think we have a minor misunderstanding. I'm only proposing
special treatment for standard facets instantiated on "reasonable
types". For example, the same restriction on character types as
basic_string imposes for charT. Likewise for iterators. No special
treatment for user-defined facets.
-Howard
More information about the Libstdc++
mailing list