All Locale and Facet Facilities

All Locale and Facet Facilities

A compact scan page for locale objects, classic facet categories, and locale-aware text and numeric processing facilities.

How to use this reference page

Use reference pages to confirm names, categories, nearby facilities, and the constraints that matter before writing or reviewing code.

  • Scan the top of the page first to identify the primary types, functions, or algorithm families involved.
  • Use the nearby-page links when your question is really about a companion header, related algorithm family, or broader subsystem.
  • Validate tricky behavior with a small compileable example before relying on memory for details like invalidation, ordering, allocation, or lifetime rules.

All Locale and Facet Facilities

Core locale model

Major facet families

Locale-aware integration points

Practical rules

Small worked example

#include <locale>
#include <sstream>

struct comma_punct : std::numpunct<char> {
	char do_thousands_sep() const override { return ','; }
	std::string do_grouping() const override { return "\3"; }
};

int main() {
	std::ostringstream out;
	out.imbue(std::locale{std::locale::classic(), new comma_punct});
	out << 1234567;
}

The point is not to memorize facet internals. The point is to remember that locale behavior comes from an explicit locale object, which you can imbue into a stream instead of relying on hidden global settings.

Practical lookup habit

Example in practice

#include <locale>
#include <sstream>

struct comma_punct : std::numpunct<char> {
    char do_thousands_sep() const override { return ','; }
    std::string do_grouping() const override { return "\3"; }
};

int main() {
    std::ostringstream out;
    out.imbue(std::locale{std::locale::classic(), new comma_punct});
    out << 1234567;
    return out.str() == "1,234,567" ? 0 : 1;
}