Namespace
Varianti

std::use_facet

Da cppreference.com.
< cpp‎ | locale

 
 
Localizzazioni libreria
Impostazioni internazionali e sfaccettature
Original:
Locales and facets
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
locale
use_facet
Carattere classificazione
Original:
Character classification
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Conversioni
Original:
Conversions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Facet categoria classi di base
Original:
Facet category base classes
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Facet categorie
Original:
Facet categories
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Locale specifici aspetti
Original:
Locale-specific facets
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Codice di conversione sfaccettature
Original:
Code conversion facets
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
codecvt_utf8(C++11)
codecvt_utf16(C++11)
C locale
Original:
C locale
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
 
Defined in header <locale>
template< class Facet >
const Facet& use_facet( const std::locale& loc );
Ottiene un riferimento a un aspetto attuato loc.
Original:
Obtains a reference to a facet implemented by loc.
The text has been machine-translated via Google Translate.
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 un riferimento la faccetta. Il riferimento restituito da questa funzione è valida fino a quando qualsiasi oggetto che implementa std::locale esiste Facet.
Original:
Returns a reference the facet. The reference returned by this function is valid as long as any std::locale object exists that implements Facet.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[modifica] Eccezioni

std::bad_cast if std::has_facet<Facet>(loc) == false.

[modifica] Esempio

Visualizzare il 3 lettere nome della valuta utilizzata dal locale preferita dell'utente
Original:
Display the 3-letter currency name used by the user's preferred locale
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

#include <iostream>
#include <locale>
 
int main()
{
    std::locale loc = std::locale(""); // user's preferred locale
    std::cout << "Your currency string is "
              << std::use_facet<std::moneypunct<char, true>>(loc).curr_symbol() << '\n';
}

Output:

Your currency string is USD

[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) [edit]
Verifica se un locale implementa un determinato aspetto
Original:
checks if a locale implements a specific facet
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) [edit]