std::numpunct
提供: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. |
| Defined in header <locale>
|
||
| template< class CharT > class numpunct; |
||
ファセットstd::numpunctは、数値、句読点設定をカプセル化します。 std::numpunct通ってstd::num_get数値の入力と書式設定の数値の出力を解析するためのストリームI / O操作の使用std::num_put.
Original:
The facet std::numpunct encapsulates numeric punctuation preferences. Stream I/O operations use std::numpunct through std::num_get and std::num_put for parsing numeric input and formatting numeric output.
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.
2つの専門分野は、標準ライブラリで提供されています
Original:
Two specializations are provided by the standard library
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.
| Defined in header
<locale> | |
| std::numpunct<char> | "C"ロケール·プリファレンスの同等物を提供しています
Original: provides equivalents of the "C" locale preferences The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
| std::numpunct<wchar_t> | "C"ロケール·プリファレンスのワイド文字同等物を提供しています
Original: provides wide character equivalents of the "C" locale preferences The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
目次 |
[編集] メンバータイプ
| メンバー·タイプ
Original: Member type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
Definition |
char_type
|
charT
|
string_type
|
std::basic_string<charT> |
[編集] メンバ関数
| 新しいnumpunctファセットを構築します Original: constructs a new numpunct facet The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (パブリックメンバ関数) | |
| numpunctファセットを破棄します Original: destructs a numpunct facet The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (メンバー関数を保護しました) | |
| | |
do_decimal_pointを呼び出します Original: invokes do_decimal_point The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (パブリックメンバ関数) | |
do_thousands_sepを呼び出します Original: invokes do_thousands_sep The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (パブリックメンバ関数) | |
do_groupingを呼び出します Original: invokes do_grouping The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (パブリックメンバ関数) | |
do_truenameを呼び出します Original: invokes do_truename The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (パブリックメンバ関数) | |
do_falsenameを呼び出します Original: invokes do_falsename The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (パブリックメンバ関数) | |
[編集] メンバ関数を保護しました
| [仮想] |
小数点として使用する文字を提供します Original: provides the character to use as decimal point The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (仮想protectedメンバ関数) |
| [仮想] |
桁区切り記号として使用する文字を提供します Original: provides the character to use as thousands separator The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (仮想protectedメンバ関数) |
| [仮想] |
何千人もの各ペア間の桁の数字を提供しています
セパレータ Original: provides the numbers of digits between each pair of thousands
separators The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (仮想protectedメンバ関数) |
| [仮想] |
ブールtrueの名前として使用する文字列を提供します Original: provides the string to use as the name of the boolean true The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (仮想protectedメンバ関数) |
| [仮想] |
ブールfalseの名前として使用する文字列を提供します Original: provides the string to use as the name of the boolean false The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (仮想protectedメンバ関数) |
[編集] メンバーオブジェクト
| static std::locale::id id |
idはロケールの Original: id of the locale The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (パブリックメンバオブジェクト) |
[編集] 例
次の例では、変更trueとfalseの文字列表現
Original:
The following example changes the string representations of true and false
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.
#include <iostream> #include <locale> struct french_bool : std::numpunct<char> { string_type do_truename() const { return "oui"; } string_type do_falsename() const { return "non"; } }; int main() { std::cout << "default locale: " << std::boolalpha << true << ", " << false << '\n'; std::cout.imbue(std::locale(std::cout.getloc(), new french_bool())); std::cout << "locale with modified numpunct: " << std::boolalpha << true << ", " << false << '\n'; }
Output:
default locale: true, false locale with modified numpunct: oui, non
[編集] も参照してください
| 名前のロケール用numpunctファセットを作成します Original: creates a numpunct facet for the named locale The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (クラステンプレート) | |
