C++ コンセプト: SequenceContainer
提供: cppreference.com
![]() |
このページは、Google 翻訳を使って英語版から機械翻訳されました。
翻訳には誤りや奇妙な言い回しがあるかもしれません。文章の上にポインタをおくと、元の文章が見れます。誤りを修正して翻訳を改善する手助けをしてください。翻訳についての説明は、ここをクリックしてください。 |
SequenceContainer
は直線配置で、同じタイプのオブジェクトを格納Container
です.Original:
A
SequenceContainer
is a Container
that stores objects of the same type in a linear arrangement.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: Legend The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
X
|
コンテナ型
Original: Container type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
T
|
要素の型
Original: Element type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
a , b
|
タイプ
X のオブジェクトOriginal: Objects of type X The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
t
|
タイプ
T のオブジェクト Original: Object of type T The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
n
|
正の整数
Original: Positive integer The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
i , j
|
有効範囲を示す
InputIterator sOriginal: InputIterator s denoting a valid rangeThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
il
|
std::initializer_list<T> |
args
|
パラメーターパック
Original: Parameter pack The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
p , q
|
a でconst_iterators Original: const_iterators in a The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
expression | return type | effects | precondition | postcondition |
---|---|---|---|---|
X(n,t) | Constructs a SequenceContainer containing n copies of t |
T CopyInsertable |
std::distance(begin(),end()) == n | |
X(i,j) | Constructs a SequenceContainer equivalent to the range [i,j)
|
|
std::distance(begin(),end()) == std::distance(i,j) | |
X(il) | X(il.begin(),il.end) | |||
a = il | X& | Assigns the range represented by il into a
|
T CopyInsertable and CopyAssignable
|
Existing elements of a are destroyed or assigned to
|
a.emplace(p,args) | iterator | Insert an object constructed with std::forward<Args>(args) before p
|
|
|
a.emplace(p,t) | iterator | Inserts a copy of t before i
|
|
|
a.insert(p,n,t) | iterator | Inserts n copies of t before i
|
T CopyInsertable and CopyAssignable
|
|
a.insert(p,i,j) | iterator | Inserts copies of elements in [i, j) before p
|
|
Each iterator in [i,j) is dereferenced once
|
a.insert(p, il) | iterator | a.insert(p,il.begin(),il.end()) | ||
a.erase(q) | iterator | Erases the element pointed to by q | (はstd :: dequeの、std :: vectorは) T MoveAssignable
|
|
a.erase(p,q) | iterator | Erases elements in [p,q) |
(はstd :: dequeの、std :: vectorは) T MoveAssignable |
|
a.clear() | void | Destroys all elements in a |
| |
a.assign(i,j) | void | Replaces elements in a with a copy of [i, j)
|
|
Each iterator in [i,j) is dereferenced once
|
a.assign(il) | void | a.assign(il.begin(),il.end()) | ||
a.assign(n,t) | void | Replaces elements in a with n copies of t
|
T CopyInsertable and CopyAssignable
|
[編集] 省略可能な操作
This section is incomplete |
[編集] 標準ライブラリでSequenceContainers
(C++11) |
要素が隣接した静的な配列 (クラステンプレート) |
要素が隣接した動的な配列 (クラステンプレート) | |
両端キュー (クラステンプレート) | |
(C++11) |
片方向連結リスト (クラステンプレート) |
双方向連結リスト (クラステンプレート) |
[編集] トレードオフ/使用上の注意
std::array | 高速アクセスが、要素数は固定されています
Original: Fast access but fixed number of elements The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
std::vector | 高速アクセスが、ほとんどは非効率的な挿入/欠失
Original: Fast access but mostly inefficient insertions/deletions The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
std::list std::forward_list |
シーケンスの途中で効率的な挿入/削除
Original: Efficient insertion/deletion in the middle of the sequence The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
std::deque | シーケンスの始めと終わりには効率的な挿入/削除
Original: Efficient insertion/deletion at the beginning and at the end of the sequence The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |