GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
std::locale::id(3) C++ Standard Libary std::locale::id(3)

std::locale::id - std::locale::id


Defined in header <locale>
class locale::id;


The class std::locale::id provides implementation-specific identification of a
locale facet. Each class derived from std::locale::facet must have a public static
member named id of type std::locale::id and each std::locale object maintains a list
of facets it implements, indexed by their ids.


Facets with the same id belong to the same facet category and replace each other
when added to a locale object.


constructor constructs a new id
(public member function)
operator= copy assignment operator is deleted
(public member function)


The following example shows how to construct a minimal custom facet.

// Run this code


#include <iostream>
#include <locale>


struct myfacet : std::locale::facet
{
myfacet(std::size_t refs = 0) : facet(refs) {}
static std::locale::id id;
};


std::locale::id myfacet::id;


int main()
{
std::locale myloc(std::locale(), new myfacet);
std::cout << "has_facet<myfacet>(myloc) returns " << std::boolalpha
<< std::has_facet<myfacet>(myloc) << '\n';
}


has_facet<myfacet>(myloc) returns true


the base class for all facet categories: each facet of any category is derived
facet from this type
(class)

2022.07.31 http://cppreference.com

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.