Namespaces
Variants

Standard library header <charconv> (C++17)

From cppreference.net
Standard library headers

이 헤더는 텍스트 처리 라이브러리의 일부입니다.

클래스

std::to_chars std::from_chars 의 서식을 지정합니다
(열거형)
std::from_chars 의 반환 타입
(클래스)
std::to_chars 의 반환 타입
(클래스)

함수

(C++17)
문자 시퀀스를 정수 또는 부동 소수점 값으로 변환합니다
(함수)
(C++17)
정수 또는 부동 소수점 값을 문자 시퀀스로 변환합니다
(함수)

시놉시스

namespace std {
  // 기본 수치 변환을 위한 부동소수점 형식
  enum class chars_format {
    scientific = /* unspecified */,
    fixed = /* unspecified */,
    hex = /* unspecified */,
    general = fixed | scientific
  };
  // 기본 수치 출력 변환
  struct to_chars_result { // freestanding
    char* ptr;
    errc ec;
    friend bool operator==(const to_chars_result&, const to_chars_result&) = default;
    constexpr explicit operator bool() const noexcept { return ec == errc{}; }
  };
  constexpr
  to_chars_result to_chars(char* first, char* last, // freestanding
                           /* integer-type */ value, int base = 10);
  to_chars_result to_chars(char* first, char* last, // freestanding
                           bool value, int base = 10) = delete;
  to_chars_result to_chars(char* first, char* last, // freestanding-deleted
                           /* floating-point-type */ value);
  to_chars_result to_chars(char* first, char* last, // freestanding-deleted
                           /* floating-point-type */ value, chars_format fmt);
  to_chars_result to_chars(char* first, char* last, // freestanding-deleted
                           /* floating-point-type */ value,
                           chars_format fmt, int precision);
  // 기본 수치 입력 변환
  struct from_chars_result { // freestanding
    const char* ptr;
    errc ec;
    friend bool operator==(const from_chars_result&, const from_chars_result&) = default;
    constexpr explicit operator bool() const noexcept { return ec == errc{}; }
  };
  constexpr
  from_chars_result from_chars(const char* first, // freestanding
                               const char* last, /* integer-type */& value,
                               int base = 10);
  from_chars_result from_chars(const char* first, // freestanding-deleted
                               const char* last, /* floating-point-type */& value,
                               chars_format fmt = chars_format::general);
}