std::locale::id
Aus cppreference.com
|
|
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
<metanoindex/>
<tbody> </tbody>| definiert in Header <locale>
|
||
class locale::id; |
||
Die Klasse std::locale::id bietet die Implementierung spezifischer Identifikation eines locale Facette. Jede Klasse von std::locale::facet ableiten muss eine öffentliche, statische Member des Typs std::locale::id und jeder std::locale Objekt verwaltet eine Liste der Facetten es implementiert, indiziert durch ihre
ids .Original:
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 of type std::locale::id and each std::locale object maintains a list of facets it implements, indexed by their
ids.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Member-Funktionen
baut eine neue ID Original: constructs a new id The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (öffentliche Elementfunktion) | |
operator= |
Zuweisungsoperator wird gelöscht Original: copy assignment operator is deleted The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (öffentliche Elementfunktion) |
Beispiel
Das folgende Beispiel zeigt, wie man eine minimale eigene Facette konstruieren .
Original:
The following example shows how to construct a minimal custom facet.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
#include <iostream>
#include <locale>
#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<myloc, myfacet> returns " << std::boolalpha
<< std::has_facet<myfacet>(myloc) << '\n';
}
Output:
has_facet<myloc, myfacet> returns true
Siehe auch
die Basisklasse für alle Facetten Kategorien: jede Facette jeder Kategorie wird von diesem Typ abgeleitet Original: the base class for all facet categories: each facet of any category is derived from this type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (Klasse) | |