名前空間
変種
操作

標準ライブラリヘッダ <charconv>

提供: cppreference.com
< cpp‎ | header
 
 
 

[編集] クラス

std::to_chars および std::from_chars に対する書式を指定します
(列挙) [edit]

[編集] 関数

文字シーケンスを整数値または浮動小数点値に変換します
(関数) [edit]
(C++17)
整数値または浮動小数点値を文字シーケンスに変換します
(関数) [edit]

[編集] 概要

namespace std {
    // floating-point format for primitive numerical conversion
    enum class chars_format {
        scientific = /*unspecified*/ ,
        fixed = /*unspecified*/ ,
        hex = /*unspecified*/ ,
        general = fixed | scientific
    };
    // primitive numerical output conversion
    struct to_chars_result {
        char* ptr;
        errc ec;
    };
    to_chars_result to_chars(char* first, char* last,
                             /*see description*/ value, int base = 10);
    to_chars_result to_chars(char* first, char* last, float value);
    to_chars_result to_chars(char* first, char* last, double value);
    to_chars_result to_chars(char* first, char* last, long double value);
    to_chars_result to_chars(char* first, char* last, float value,
                             chars_format fmt);
    to_chars_result to_chars(char* first, char* last, double value, 
                             chars_format fmt);
    to_chars_result to_chars(char* first, char* last, long double value,
                             chars_format fmt);
    to_chars_result to_chars(char* first, char* last, float value,
                             chars_format fmt, int precision);
    to_chars_result to_chars(char* first, char* last, double value,
                             chars_format fmt, int precision);
    to_chars_result to_chars(char* first, char* last, long double value,
                             chars_format fmt, int precision);
    // primitive numerical input conversion
    struct from_chars_result {
        const char* ptr;
        errc ec;
    };
    from_chars_result from_chars(const char* first, const char* last,
                                 /*see description*/ & value, int base = 10);
    from_chars_result from_chars(const char* first, const char* last, float& value,
                                 chars_format fmt = chars_format::general);
    from_chars_result from_chars(const char* first, const char* last, double& value,
                                 chars_format fmt = chars_format::general);
    from_chars_result from_chars(const char* first, const char* last, long double& value,
                                 chars_format fmt = chars_format::general);
}