std::locale::id(3cxx)
πΈ NAME πΈ
okay so welcome to the std::locale::id(3cxx) page, bestie β this one is all about std::locale::id, aka the Facet ID class β¨. No cap, itβs the tiny backstage-pass class that gives locale facets their unique ID energy π
.
β¨ SYNOPSIS β¨
#include <locale>
π Public Member Functions π
id ()β Constructor. Thatβs it, thatβs the whole vibe.size_t _M_id () const throw ()β no description attached in the source, so weβre respecting the mystery π«Ά. The exact signature stays exactly as written.
π¦ Friends π¦
template<typename _Facet > const _Facet * __try_use_facet (const locale &) noexceptβ friend of the ID class, with itsnoexceptenergy intact.template<typename _Facet > bool has_facet (const locale &) throw ()β Test for the presence of a facet.class localeβ friend of the ID class.class locale::_Implβ also a friend.template<typename _Facet > const _Facet & use_facet (const locale &)β Return a facet.
π Detailed Description π
Facet ID class.
The ID class provides facets with an index used to identify them. Every facet class must define a public static member locale::id, or be derived from a facet that provides this member, otherwise the facet cannot be used in a locale. And the locale::id ensures that each class type gets a unique identifier. periodt π
.
π§ Constructor & Destructor Documentation π§
πΈ std::locale::id::id () [inline] πΈ
Constructor. Short, sweet, iconic.
π₯ Friends And Related Symbol Documentation π₯
β template<typename _Facet > bool has_facet (const locale &) [friend] β
Test for the presence of a facet. has_facet tests the locale argument for the presence of the facet type provided as the template parameter. Facets derived from the facet parameter will also return true π.
- Template Parameters
_Facetβ The facet type to test the presence of.
- Parameters
__locβ The locale to test.
- Returns
trueif__loccontains a facet of type_Facet, elsefalse.
π« template<typename _Facet > const _Facet & use_facet (const locale &) [friend] π«
Return a facet. use_facet looks for and returns a reference to a facet of type Facet where Facet is the template parameter. If has_facet(locale) is true, there is a suitable facet to return. It throws std::bad_cast if the locale doesnβt contain a facet of type Facet π.
- Template Parameters
_Facetβ The facet type to access.
- Parameters
__locβ The locale to use.
- Returns
- Reference to facet of type
Facet.
- Reference to facet of type
- Exceptions
std::bad_castif__locdoesnβt contain a facet of type_Facet.
π Author π
This page was generated automatically by Doxygen for libstdc++ from the source code. Not me hand-writing it at 3am, but Iβm still giving it main character energy π
.
signed off with love by libstdc++ β thatβs the source/version β and the page is std::locale::id(3cxx); the footer doesnβt print a date, so weβre calling it timeless π«Άβ¨
π¦ where this page comes from
- ubuntu noble: libstdc++-14-doc 14-20240412-0ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms