Where are C++ locale facets actually defined

Viewed 65

From what I understand, as the standard says, C++ locale effectively contains a reference counted pointer to an array of facet pointers, and each facet implements locale-dependant operations.

locale's constructor I assume then needs to look up the facets in some form of database, since it is only provided a locale name. But where are the facets actually defined? I would assume that they are either created on first use and added to this database or already known at compile-time, since statically initialized streams need to access locales. Is there just a large map somewhere that stores locale instances or maybe factories?

And also, are facet types the same for each locale andd store internal state on how to actually preform their operations or are there separate facet types for different locales?

Are there, if any, major implementation differences between STL implementations (glibc vs microsoft)?

0 Answers
Related