std::basic_string
提供: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 <string>
|
||
template< class CharT, |
||
クラステンプレート
basic_string
店舗とcharのようなオブジェクト(std::char_traitsまたは互換性のある特性クラスの特殊化が提供されるオブジェクトである)のシーケンスを操作. Original:
The class template
basic_string
stores and manipulates sequences of char-like objects (that is, objects for which a specialization of std::char_traits or compatible traits class is provided). 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.
basic_string
の要素は、basic_stringのs
ため、&*(s.begin() + n) == &*s.begin() + n[0, s.size())
内の任意のnに対して、つまり、連続して格納され、または、等価s[0]
へのポインタがcharT[]
配列の最初の要素へのポインタを受け取る関数に渡すことができます。 (C + + 11以来)Original:
The elements of a
basic_string
are stored contiguously, that is, for a basic_string s
, &*(s.begin() + n) == &*s.begin() + n for any n in [0, s.size())
, or, equivalently, a pointer to s[0]
can be passed to functions that expect a pointer to the first element of a charT[]
array. (C + + 11以来)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.
一般的な文字の種類にはいくつかの特殊化が提供されています
Original:
Several specializations for common character types are provided:
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
<string> | |
タイプ
Original: Type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
Definition |
std::string | std::basic_string<char> |
std::wstring | std::basic_string<wchar_t> |
std::u16string | std::basic_string<char16_t> |
std::u32string | std::basic_string<char32_t> |
[編集] メンバータイプ
メンバー·タイプ
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 |
traits_type
|
Traits
|
value_type
|
Traits::char_type
|
allocator_type
|
Allocator
|
size_type
|
符号なし整数型(通常size_t)
Original: Unsigned integral type (usually size_t) The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
difference_type
|
Signed integer type (usually ptrdiff_t) |
reference
|
Allocator::reference (C + + 11時まで)value_type& (C + + 11以来)
|
const_reference
|
Allocator::const_reference (C + + 11時まで)const value_type& (C + + 11以来)
|
pointer
|
Allocator::pointer (C + + 11時まで)std::allocator_traits<Allocator>::pointer (C + + 11以来) |
const_pointer
|
Allocator::const_pointer (C + + 11時まで) std::allocator_traits<Allocator>::const_pointer (C + + 11以来) |
iterator
|
RandomAccessIterator
|
const_iterator
|
一定のランダムアクセス反復子を返します
Original: Constant random access iterator The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
reverse_iterator
|
std::reverse_iterator<iterator> |
const_reverse_iterator
|
std::reverse_iterator<const_iterator> |
[編集] メンバ関数
basic_string を構築します Original: constructs a basic_string The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (パブリックメンバ関数) | |
文字列に値を割り当てます Original: assigns values to the string The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (パブリックメンバ関数) | |
文字列に文字を割り当てます Original: assign characters to a string The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (パブリックメンバ関数) | |
関連したアロケータを返す Original: returns the associated allocator The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (パブリックメンバ関数) | |
Original: Element access The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
境界チェックで指定した文字にアクセスします Original: access specified character with bounds checking The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (パブリックメンバ関数) | |
指定した文字にアクセスします Original: access specified character The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (パブリックメンバ関数) | |
(C++11) |
最初の文字にアクセスします Original: accesses the first character The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (パブリックメンバ関数) |
(C++11) |
最後の文字にアクセスします Original: accesses the last character The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (パブリックメンバ関数) |
文字列の最初の文字へのポインタを返します Original: returns a pointer to the first character of a string The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (パブリックメンバ関数) | |
文字列の変更不可能な標準Cの文字配列のバージョンを返します Original: returns a non-modifiable standard C character array version of the string The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (パブリックメンバ関数) | |
Original: Iterators The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
(C++11) |
先頭を指すイテレータを返す Original: returns an iterator to the beginning The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (パブリックメンバ関数) |
(C++11) |
末尾を指すイテレータを返す Original: returns an iterator to the end The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (パブリックメンバ関数) |
(C++11) |
先頭に逆反復子を返します Original: returns a reverse iterator to the beginning The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (パブリックメンバ関数) |
(C++11) |
最後に逆反復子を返します Original: returns a reverse iterator to the end The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (パブリックメンバ関数) |
Original: Capacity The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
文字列が空であるかどうかをチェックします Original: checks whether the string is empty The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (パブリックメンバ関数) | |
returns the number of characters (パブリックメンバ関数) | |
文字の最大数を返します Original: returns the maximum number of characters The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (パブリックメンバ関数) | |
埋蔵ストレージ Original: reserves storage The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (パブリックメンバ関数) | |
現在割り当てられているストレージに保持することができる文字の数を返します Original: returns the number of characters that can be held in currently allocated storage The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (パブリックメンバ関数) | |
(C++11) |
未使用のメモリを解放してメモリ使用量を減らすことができます Original: reduces memory usage by freeing unused memory The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (パブリックメンバ関数) |
Original: Operations The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
内容をクリアします Original: clears the contents The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (パブリックメンバ関数) | |
挿入文字が Original: inserts characters The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (パブリックメンバ関数) | |
removes characters (パブリックメンバ関数) | |
末尾に追加文字 Original: appends a character to the end The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (パブリックメンバ関数) | |
(C++11) |
最後の文字を削除します Original: removes the last character The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (パブリックメンバ関数) |
末尾に追加の文字を Original: appends characters to the end The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (パブリックメンバ関数) | |
末尾に追加の文字を Original: appends characters to the end The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (パブリックメンバ関数) | |
2つの文字列を比較する Original: compares two strings The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (パブリックメンバ関数) | |
指定した文字が出現するたびに置き換えられます Original: replaces every occurrence of specified characters The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (パブリックメンバ関数) | |
部分文字列を返します Original: returns a substring The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (パブリックメンバ関数) | |
コピー文字 Original: copies characters The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (パブリックメンバ関数) | |
格納された文字の数を変更します Original: changes the number of characters stored The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (パブリックメンバ関数) | |
スワップ内容 Original: swaps the contents The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (パブリックメンバ関数) | |
Original: Search The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
文字列内の文字を見つける Original: find characters in the string The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (パブリックメンバ関数) | |
部分文字列が最後に現れる場所を見つける Original: find the last occurrence of a substring The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (パブリックメンバ関数) | |
文字が最初に現れる位置を見つける Original: find first occurrence of characters The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (パブリックメンバ関数) | |
文字の最初の不在を見つける Original: find first absence of characters The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (パブリックメンバ関数) | |
文字が最後に現れる場所を見つける Original: find last occurrence of characters The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (パブリックメンバ関数) | |
最後の文字が存在しないことを見つける Original: find last absence of characters The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (パブリックメンバ関数) | |
Original: Constants The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
[静的] |
特殊な値です。正確な意味は、文脈に依存する Original: special value. The exact meaning depends on the context The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (公共の静的メンバ定数) |
[編集] 非メンバ関数
2つの文字列を連結または文字列とchar Original: concatenates two strings or a string and a char The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (関数テンプレート) | |
辞書的に2つの文字列を比較する Original: lexicographically compares two strings The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (関数テンプレート) | |
std::swapアルゴリズムを専門としています Original: specializes the std::swap algorithm The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (関数テンプレート) | |
Original: Input/output The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
文字列上のストリームI / Oを実行します Original: performs stream I/O on strings The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (関数テンプレート) | |
文字列にI / Oストリームからデータを読み取る Original: read data from an I/O stream into a string The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (機能) | |
Original: Numeric conversions The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
(C++11) (C++11) (C++11) |
符号付き整数に文字列を変換します Original: converts a string to an signed integer The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (機能) |
(C++11) (C++11) |
符号なし整数に文字列を変換します Original: converts a string to an unsigned integer The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (機能) |
(C++11) (C++11) (C++11) |
浮動小数点値に文字列を変換します Original: converts a string to an floating point value The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (機能) |
(C++11) |
string に整数型または浮動小数点値に変換します Original: converts an integral or floating point value to string The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (機能) |
(C++11) |
wstring に整数型または浮動小数点値に変換します Original: converts an integral or floating point value to wstring The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (機能) |
[編集] ヘルパークラス
(C++11) (C++11) (C++11) (C++11) |
文字列のハッシュをサポートしています Original: hash support for strings The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (クラステンプレートの特殊化の2つの値を比較します) |