Namensräume
Varianten
Aktionen

std::use_facet

Aus cppreference.com
< cpp‎ | locale

 
 
Lokalisierungen Bibliothek
Locales und Facetten
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
Buchstaben-Klassifikation
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.
Conversions
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 Kategorie Basisklassen
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 Kategorien
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-spezifische Facetten
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.
Code-Konvertierung Facetten
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 );
Erhält einen Verweis auf eine Facette durch loc umgesetzt .
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.

Inhaltsverzeichnis

[Bearbeiten] Parameter

loc -
das Gebietsschema Objekt abzufragen
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.

[Bearbeiten] Rückgabewert

Gibt einen Verweis auf die Facette. Der Verweis von dieser Funktion zurückgegeben wird, ist so lange gültig, wie jeder std::locale Objekt existiert, dass implementiert 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.

[Bearbeiten] Ausnahmen

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

[Bearbeiten] Beispiel

Zeigen Sie das 3-Buchstaben den Namen der Währung von der vom Benutzer bevorzugten Gebietsschema verwendet
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

[Bearbeiten] Siehe auch

eingestellt von polymorphen Facetten, die kulturellen Unterschiede zu kapseln
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.

(Klasse) [edit]
prüft, ob eine locale implementiert eine spezielle Facette
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.

(Funktions-Template) [edit]