GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • cpprefjp - C++日本語リファレンス
  • GitHub Project

This view

  • Original page
  • New address

GeezerVison is showing cpprefjp.github.io — string - cpprefjp C++日本語リファレンス

  1. リファレンス
  2. string

最終更新日時: 2026年08月19日 20時54分14秒 (JST)
Akira Takahashi が更新

履歴 編集

<string>

string

<string>ヘッダでは、文字列に関するクラス、関数、文字特性を定義する。

このヘッダでは、以下の標準ヘッダをインクルードする:

  • <initializer_list> (C++11)
  • <compare> (C++20)

フリースタンディング

このヘッダの一部の機能が、フリースタンディング処理系でも使用できる。どの機能が使用できるかは各機能のページを参照。

文字特性

名前 説明 対応バージョン
char_traits 文字特性(class template)

文字列クラス

名前 説明 対応バージョン
basic_string 汎用文字型の文字列(class template)
string マルチバイト文字列(type-alias)
wstring ワイド文字列(type-alias)
u8string UTF-8文字列(type-alias) C++20
u16string UTF-16文字列(type-alias) C++11
u32string UTF-32文字列(type-alias) C++11
pmr::basic_string 多相アロケータを用いる汎用文字型の文字列(type-alias) C++17
pmr::string 多相アロケータを用いるマルチバイト文字列(type-alias) C++17
pmr::wstring 多相アロケータを用いるワイド文字列(type-alias) C++17
pmr::u8string 多相アロケータを用いるUTF-8文字列(type-alias) C++20
pmr::u16string 多相アロケータを用いるUTF-16文字列(type-alias) C++17
pmr::u32string 多相アロケータを用いるUTF-32文字列(type-alias) C++17

数値との変換

名前 説明 対応バージョン
stoi 文字列からint型への変換(function) C++11
stol 文字列からlong型への変換(function) C++11
stoul 文字列からunsigned long型への変換(function) C++11
stoll 文字列からlong long型への変換(function) C++11
stoull 文字列からunsigned long long型への変換(function) C++11
stof 文字列からfloat型への変換(function) C++11
stod 文字列からdouble型への変換(function) C++11
stold 文字列からlong double型への変換(function) C++11
to_string 数値からstringへの変換(function) C++11
to_wstring 数値からwstringへの変換(function) C++11

関連項目

  • <string_view>
  • <charconv>

参照

  • N2930 Range-Based For Loop Wording (Without Concepts)
  • P2051R0 C++ Standard Library Issues to be moved in Prague
  • P2338R4 Freestanding Library: Character primitives and the C library
    • C++26で、文字特性やC言語ライブラリの文字・文字列関数など、このヘッダの機能がフリースタンディング処理系に対応した
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.