回答編集履歴

2

リンク追加

2020/04/22 03:19

投稿

SHOMI
SHOMI

スコア4079

test CHANGED
@@ -21,3 +21,7 @@
21
21
  d.pop_front();
22
22
 
23
23
  ```
24
+
25
+
26
+
27
+ どのようなコンテナがあるか、一度[コンテナライブラリ](https://cpprefjp.github.io/reference.html#container)を眺めてみるとよいでしょう。

1

リンク追加、先頭要素削除追記

2020/04/22 03:19

投稿

SHOMI
SHOMI

スコア4079

test CHANGED
@@ -1 +1,23 @@
1
- `std::vector`,`std::list`,`std::deque`等お好にどうぞ
1
+ [`std::vector`](https://cpprefjp.github.io/reference/vector/vector.html),[`std::list`](https://cpprefjp.github.io/reference/list/list.html),[`std::deque`](https://cpprefjp.github.io/reference/deque/deque.html)いずれも`push_back()`でます
2
+
3
+ 先頭要素の削除は
4
+
5
+ ```C++
6
+
7
+ std::vector<int> v;
8
+
9
+ v.erase(v.begin());
10
+
11
+
12
+
13
+ std::list<int> l;
14
+
15
+ l.pop_front();
16
+
17
+
18
+
19
+ std::deque<int> d;
20
+
21
+ d.pop_front();
22
+
23
+ ```