std::locale::id
Da cppreference.com.
|
|
Questa pagina è stata tradotta in modo automatico dalla versione in ineglese della wiki usando Google Translate.
La traduzione potrebbe contenere errori e termini strani. Muovi il puntatore sopra al testo per vedere la versione originale. Puoi aiutarci a correggere gli gli errori. Per ulteriori istruzioni clicca qui. |
<metanoindex/>
<tbody> </tbody>| Elemento definito nell'header <locale>
|
||
class locale::id; |
||
La classe fornisce std::locale::id attuazione specifica identificazione di un aspetto locale. Ogni classe derivata da std::locale::facet deve avere un membro pubblico statico di std::locale::id tipo e ogni oggetto std::locale mantiene una lista di aspetti da essa svolte, indicizzato da loro
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.
Membri funzioni
costruisce un nuovo 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. (metodo pubblico) | |
operator= |
operatore di assegnazione di copia viene eliminata 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. (metodo pubblico) |
Esempio
L'esempio seguente mostra come costruire un aspetto minimale personalizzato .
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
Vedi anche
la classe di base per tutte le categorie di facet: ogni aspetto di qualsiasi categoria è derivato da questo tipo 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. (classe) | |