Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::locale::facet

      From cppreference.com
      <cpp‎ |locale‎ |locale
       
       
       
      Localization library
       
       
      Defined in header<locale>
      class locale::facet;

      std::locale::facet is the base class for facets. It provides a common base class so that locales could store pointers to the facets they implement in a single indexed container, and it abstracts support for facet reference counting.

      Whenever a facet is added to a locale, the locale increments the reference count in the facet (through an implementation-specific mechanism). Whenever a locale is destructed or modified, it decrements the reference count in each facet it no longer implements. Whenever a facet's reference count becomes zero, the locale performsdeletestatic_cast<std::locale::facet*>(f); wheref is the pointer to the facet.

      Contents

      [edit]Facet class

      A class is afacet if

      static::std::locale::id id;

      [edit]Member functions

      constructs a new facet with specified reference count
      (protected member function)
      operator=
      the copy assignment operator is deleted
      (protected member function)
      (destructor)
      [virtual]
      the destructor is protected virtual
      (virtual protected member function)

      [edit]Example

      This section is incomplete
      Reason: no example

      [edit]Defect reports

      The following behavior-changing defect reports were applied retroactively to previously published C++ standards.

      DRApplied toBehavior as publishedCorrect behavior
      LWG 2694C++98the definition of 'facet' was removed by the resolution ofLWG issue 436added the definition back

      [edit]See also

      the facet index type: each facet class must declare or inherit a public static member of this type
      (class)[edit]
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/locale/locale/facet&oldid=165741"

      [8]ページ先頭

      ©2009-2025 Movatter.jp