< cpp‎ | locale‎ | locale
Revision as of 19:59, 2 November 2012 by P12bot (Talk | contribs)

Template:ddcl list begin <tr class="t-dsc-header">

Defined in header <locale>

<td></td> <td></td> <tr class="t-dcl ">

<td class="t-dcl-nopad">
class locale::facet;

<td class="t-dcl-nopad"> </td> <td class="t-dcl-nopad"> </td> </tr> Template:ddcl list end

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 performs delete static_cast<std::locale::facet*>(f) where f is the pointer to the facet.

Member functions

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


See also

Template:cpp/locale/locale/dcl list id