Namespaces
Variants

std::basic_ios<CharT,Traits>:: imbue

From cppreference.net
std:: locale imbue ( const std:: locale & loc ) ;

Ersetzt die aktuelle Locale. Ruft effektiv ios_base :: imbue ( loc ) auf und falls ein assoziierter Streampuffer vorhanden ist ( rdbuf ( ) ! = 0 ), ruft es rdbuf ( ) - > pubimbue ( loc ) auf.

Inhaltsverzeichnis

Parameter

loc - das neue Gebietsschema

Rückgabewert

Das vorherige Gebietsschema, wie zurückgegeben von ios_base :: imbue ( loc ) .

Exceptions

Kann implementierungsdefinierte Ausnahmen auslösen.

Beispiel

#include <iostream>
#include <locale>
#include <sstream>
int main()
{
    std::istringstream iss;
    iss.imbue(std::locale("en_US.UTF8"));
    std::cout << "Current locale: " << iss.getloc().name() << '\n';
    iss.imbue(std::locale());
    std::cout << "Global locale : " << iss.getloc().name() << '\n';
}

Ausgabe:

Current locale: en_US.UTF8
Global locale : C