std::locale::combine
De cppreference.com
|
|
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
<metanoindex/>
<tbody> </tbody>| Definido no cabeçalho <locale>
|
||
template< class Facet > locale combine( const locale& other ) const; |
||
Constrói um objeto de localidade, que é uma cópia do
*this exceto para a faceta de Facet tipo, que é copiado de other.Original:
Constructs a locale object which is a copy of
*this except for the facet of type Facet, which is copied from other.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.
Valor de retorno
O novo, sem nome, localidade.
Original:
The new, nameless, locale.
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.
Exceções
std::runtime_error se
other não implementar FacetOriginal:
std::runtime_error if
other does not implement FacetThe 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.
Exemplo
#include <iostream>
#include <locale>
int main()
{
const double number = 1000.25;
std::cout << "\"C\" locale: " << number << '\n';
std::locale loc = std::locale().combine<std::numpunct<char>>(std::locale("en_US.UTF8"));
std::cout.imbue(loc);
std::cout << "\"C\" locale with en_US numpunct: " << number << '\n';
}
Saída:
"C" locale: 1000.25
"C" locale with en_US numpunct: 1,000.25
Veja também
constrói uma nova localidade Original: constructs a new locale The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (função pública membro) | |