std::has_facet
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. |
| Defined in header <locale>
|
||
| template< class Facet > bool has_facet( const locale& loc ); |
||
Controlla se il
loc locale implementa il Facet aspetto.Original:
Checks if the locale
loc implements the facet 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.
Indice |
[modifica] Parametri
| loc | - | l'oggetto locale per eseguire una query
Original: the locale object to query The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
[modifica] Valore di ritorno
Restituisce true se il
Facet aspetto è stato installato nel locale loc, false altrimenti.Original:
Returns true if the facet
Facet was installed in the locale loc, false otherwise.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.
[modifica] Eccezione specifica
[modifica] Esempio
#include <iostream> #include <locale> // minimal custom facet struct myfacet : public std::locale::facet { static std::locale::id id; }; std::locale::id myfacet::id; int main() { // loc is a "C" locale with myfacet added std::locale loc(std::locale::classic(), new myfacet); std::cout << std::boolalpha << "Can loc classify chars? " << std::has_facet<std::ctype<char>>(loc) << '\n' << "Can loc classify char32_t? " << std::has_facet<std::ctype<char32_t>>(loc) << '\n' << "Does loc implement myfacet? " << std::has_facet<myfacet>(loc) << '\n'; }
Output:
Can loc classify chars? true Can loc classify char32_t? false Does loc implement myfacet? true
[modifica] Vedi anche
| serie di aspetti polimorfi che incapsulano le differenze culturali Original: set of polymorphic facets that encapsulate cultural differences The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe) | |
| ottiene un aspetto da un locale Original: obtains a facet from a locale The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (funzione di modello) | |