diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index 4d004da226..7772505b3d 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -138,16 +138,16 @@ * [link /reference/valarray.md] * std::valarray[link /reference/valarray/valarray.md] * [link /reference/vector.md] - * std::vector[link /reference/vector.md] - * v.begin()[link /reference/vector/begin.md] - * v.end()[link /reference/vector/end.md] - * v.size()[link /reference/vector/size.md] - * v1.begin()[link /reference/vector/begin.md] - * v1.end()[link /reference/vector/end.md] - * v1.size()[link /reference/vector/size.md] - * v2.begin()[link /reference/vector/begin.md] - * v2.end()[link /reference/vector/end.md] - * v2.size()[link /reference/vector/size.md] - * v3.begin()[link /reference/vector/begin.md] - * v3.end()[link /reference/vector/end.md] - * v3.size()[link /reference/vector/size.md] + * std::vector[link /reference/vector/vector.md] + * v.begin()[link /reference/vector/vector/begin.md] + * v.end()[link /reference/vector/vector/end.md] + * v.size()[link /reference/vector/vector/size.md] + * v1.begin()[link /reference/vector/vector/begin.md] + * v1.end()[link /reference/vector/vector/end.md] + * v1.size()[link /reference/vector/vector/size.md] + * v2.begin()[link /reference/vector/vector/begin.md] + * v2.end()[link /reference/vector/vector/end.md] + * v2.size()[link /reference/vector/vector/size.md] + * v3.begin()[link /reference/vector/vector/begin.md] + * v3.end()[link /reference/vector/vector/end.md] + * v3.size()[link /reference/vector/vector/size.md] diff --git a/lang/cpp11/alias_templates.md b/lang/cpp11/alias_templates.md index 883a7de3d4..83bef12cbf 100644 --- a/lang/cpp11/alias_templates.md +++ b/lang/cpp11/alias_templates.md @@ -23,7 +23,7 @@ int main() v.push_back(4); } ``` -* v.push_back[link /reference/vector/push_back.md] +* v.push_back[link /reference/vector/vector/push_back.md] `using`キーワードによる型の別名付けは、非テンプレートに対しても使用できる。この機能を「エイリアス宣言 (alias declaration)」という: @@ -73,7 +73,7 @@ struct Vec { Vec::type v; v.push_back(3); ``` -* v.push_back[link /reference/vector/push_back.md] +* v.push_back[link /reference/vector/vector/push_back.md] このような回避策は標準ライブラリでも、`std::allocator`クラスの`rebind`で使用されている。`T`型のメモリアロケータを使用している状況でほかの型をアロケートする必要ができた際には、`U`型をアロケートする`std::allocator`型を取得する機能が必要とされる。そのような状況のために用意されている`rebind`は、以下のように定義される: diff --git a/lang/cpp11/static_initialization_thread_safely.md b/lang/cpp11/static_initialization_thread_safely.md index fece7c458b..6f104e0503 100644 --- a/lang/cpp11/static_initialization_thread_safely.md +++ b/lang/cpp11/static_initialization_thread_safely.md @@ -69,7 +69,7 @@ int main() } } ``` -* push_back[link /reference/vector/push_back.md] +* push_back[link /reference/vector/vector/push_back.md] * std::move[link /reference/utility/move.md] ### 出力 diff --git a/lang/cpp20/familiar_template_syntax_for_generic_lambdas.md b/lang/cpp20/familiar_template_syntax_for_generic_lambdas.md index 139ffb6b20..8cf5bea35f 100644 --- a/lang/cpp20/familiar_template_syntax_for_generic_lambdas.md +++ b/lang/cpp20/familiar_template_syntax_for_generic_lambdas.md @@ -29,8 +29,8 @@ std::vector w; f(v); // Tの型はint f(w); // Tの型はstd::string ``` -* v.empty()[link /reference/vector/empty.md] -* v.front()[link /reference/vector/front.md] +* v.empty()[link /reference/vector/vector/empty.md] +* v.front()[link /reference/vector/vector/front.md] ## 仕様 diff --git a/reference/algorithm/copy_if.md b/reference/algorithm/copy_if.md index f9a00ebe40..00e37af27f 100644 --- a/reference/algorithm/copy_if.md +++ b/reference/algorithm/copy_if.md @@ -61,7 +61,7 @@ int main() { } ``` * std::copy_if[color ff0000] -* result.begin()[link /reference/vector/begin.md] +* result.begin()[link /reference/vector/vector/begin.md] ### 出力 ``` diff --git a/reference/algorithm/for_each.md b/reference/algorithm/for_each.md index ab5294dce1..b956ddf155 100644 --- a/reference/algorithm/for_each.md +++ b/reference/algorithm/for_each.md @@ -75,7 +75,7 @@ int main() { } ``` * std::for_each[color ff0000] -* v.push_back[link /reference/vector/push_back.md] +* v.push_back[link /reference/vector/vector/push_back.md] ### 出力 ``` diff --git a/reference/algorithm/is_permutation.md b/reference/algorithm/is_permutation.md index 7655895b6b..a1b635d131 100644 --- a/reference/algorithm/is_permutation.md +++ b/reference/algorithm/is_permutation.md @@ -66,8 +66,8 @@ int main () } ``` * std::is_permutation[color ff0000] -* good.begin()[link /reference/vector/begin.md] -* bad.begin()[link /reference/vector/begin.md] +* good.begin()[link /reference/vector/vector/begin.md] +* bad.begin()[link /reference/vector/vector/begin.md] ### 出力 ``` diff --git a/reference/algorithm/merge.md b/reference/algorithm/merge.md index 3a1c4fa3b5..73c8680a56 100644 --- a/reference/algorithm/merge.md +++ b/reference/algorithm/merge.md @@ -69,12 +69,12 @@ int main() } ``` * std::merge[color ff0000] -* a.begin()[link /reference/vector/begin.md] -* a.end()[link /reference/vector/end.md] -* b.begin()[link /reference/vector/begin.md] -* b.end()[link /reference/vector/end.md] -* result.begin()[link /reference/vector/begin.md] -* result.end()[link /reference/vector/end.md] +* a.begin()[link /reference/vector/vector/begin.md] +* a.end()[link /reference/vector/vector/end.md] +* b.begin()[link /reference/vector/vector/begin.md] +* b.end()[link /reference/vector/vector/end.md] +* result.begin()[link /reference/vector/vector/begin.md] +* result.end()[link /reference/vector/vector/end.md] ### 出力 ``` diff --git a/reference/algorithm/move.md b/reference/algorithm/move.md index 4b918a6e08..b02e278bf2 100644 --- a/reference/algorithm/move.md +++ b/reference/algorithm/move.md @@ -56,7 +56,7 @@ int main() { } ``` * std::move[color ff0000] -* v.emplace_back[link /reference/vector/emplace_back.md] +* v.emplace_back[link /reference/vector/vector/emplace_back.md] ### 出力 ``` diff --git a/reference/algorithm/move_backward.md b/reference/algorithm/move_backward.md index b24bc115ac..6d93210974 100644 --- a/reference/algorithm/move_backward.md +++ b/reference/algorithm/move_backward.md @@ -66,7 +66,7 @@ int main() { } ``` * std::move_backward[color ff0000] -* v.emplace_back[link /reference/vector/emplace_back.md] +* v.emplace_back[link /reference/vector/vector/emplace_back.md] * std::move[link move.md] ### 出力 diff --git a/reference/algorithm/partial_sort_copy.md b/reference/algorithm/partial_sort_copy.md index d23445641a..1ea7326f2b 100644 --- a/reference/algorithm/partial_sort_copy.md +++ b/reference/algorithm/partial_sort_copy.md @@ -62,8 +62,8 @@ int main() } ``` * std::partial_sort_copy[color ff0000] -* result.begin()[link /reference/vector/begin.md] -* result.end()[link /reference/vector/end.md] +* result.begin()[link /reference/vector/vector/begin.md] +* result.end()[link /reference/vector/vector/end.md] ### 出力 ``` diff --git a/reference/algorithm/pop_heap.md b/reference/algorithm/pop_heap.md index c4f9c65d63..d1e72a1063 100644 --- a/reference/algorithm/pop_heap.md +++ b/reference/algorithm/pop_heap.md @@ -61,7 +61,7 @@ int main() ``` * std::pop_heap[color ff0000] * std::make_heap[link make_heap.md] -* v.pop_back()[link /reference/vector/pop_back.md] +* v.pop_back()[link /reference/vector/vector/pop_back.md] * std::sort_heap[link sort_heap.md] ### 出力 diff --git a/reference/algorithm/push_heap.md b/reference/algorithm/push_heap.md index 84489971ea..b21a874da3 100644 --- a/reference/algorithm/push_heap.md +++ b/reference/algorithm/push_heap.md @@ -60,7 +60,7 @@ int main() ``` * std::push_heap[color ff0000] * std::make_heap[link make_heap.md] -* v.push_back[link /reference/vector/push_back.md] +* v.push_back[link /reference/vector/vector/push_back.md] * std::sort_heap[link sort_heap.md] ### 出力 diff --git a/reference/algorithm/remove.md b/reference/algorithm/remove.md index c84a347426..10d7491c8b 100644 --- a/reference/algorithm/remove.md +++ b/reference/algorithm/remove.md @@ -69,7 +69,7 @@ int main() { ``` * result[color ff0000] * std::remove[color ff0000] -* v.erase[color ff0000][link /reference/vector/erase.md] +* v.erase[color ff0000][link /reference/vector/vector/erase.md] * Erase-remove イディオム[link https://ja.wikibooks.org/wiki/More_C%2B%2B_Idioms/%E6%B6%88%E5%8E%BB%E3%83%BB%E5%89%8A%E9%99%A4(Erase-Remove)] ### 出力 diff --git a/reference/algorithm/remove_if.md b/reference/algorithm/remove_if.md index 35e94c39c6..c6e02dc7b1 100644 --- a/reference/algorithm/remove_if.md +++ b/reference/algorithm/remove_if.md @@ -68,7 +68,7 @@ int main() { ``` * result[color ff0000] * std::remove_if[color ff0000] -* v.erase[color ff0000][link /reference/vector/erase.md] +* v.erase[color ff0000][link /reference/vector/vector/erase.md] * Erase-remove イディオム[link https://ja.wikibooks.org/wiki/More_C%2B%2B_Idioms/%E6%B6%88%E5%8E%BB%E3%83%BB%E5%89%8A%E9%99%A4(Erase-Remove)] ### 出力 diff --git a/reference/algorithm/rotate.md b/reference/algorithm/rotate.md index 089470b849..f3614287a9 100644 --- a/reference/algorithm/rotate.md +++ b/reference/algorithm/rotate.md @@ -110,9 +110,9 @@ int main() } ``` * std::rotate[color ff0000] -* seq.begin()[link /reference/vector/begin.md] -* seq.end[link /reference/vector/end.md] -* seq.assign[link /reference/vector/assign.md] +* seq.begin()[link /reference/vector/vector/begin.md] +* seq.end[link /reference/vector/vector/end.md] +* seq.assign[link /reference/vector/vector/assign.md] * std::swap[link /reference/utility/swap.md] #### 出力例 diff --git a/reference/algorithm/search_n.md b/reference/algorithm/search_n.md index a6b4a8b0c6..9a90a1d5bc 100644 --- a/reference/algorithm/search_n.md +++ b/reference/algorithm/search_n.md @@ -62,8 +62,8 @@ int main() { } ``` * std::search_n[color ff0000] -* v.cbegin()[link /reference/vector/cbegin.md] -* v.cend()[link /reference/vector/cend.md] +* v.cbegin()[link /reference/vector/vector/cbegin.md] +* v.cend()[link /reference/vector/vector/cend.md] ### 出力 ``` diff --git a/reference/algorithm/transform.md b/reference/algorithm/transform.md index 7a50a977a9..cc434e9ad2 100644 --- a/reference/algorithm/transform.md +++ b/reference/algorithm/transform.md @@ -104,8 +104,8 @@ int main() { } ``` * std::transform[color ff0000] -* result.begin()[link /reference/vector/begin.md] -* result.end()[link /reference/vector/end.md] +* result.begin()[link /reference/vector/vector/begin.md] +* result.end()[link /reference/vector/vector/end.md] * std::to_string[link /reference/string/to_string.md] ### 出力 diff --git a/reference/algorithm/unique.md b/reference/algorithm/unique.md index 19b28d86b1..f26d326236 100644 --- a/reference/algorithm/unique.md +++ b/reference/algorithm/unique.md @@ -96,7 +96,7 @@ int main() { } ``` * std::unique[color ff0000] -* v.erase[link /reference/vector/erase.md] +* v.erase[link /reference/vector/vector/erase.md] ### 出力 ``` diff --git a/reference/deque/deque/emplace.md b/reference/deque/deque/emplace.md index 3e35185b3d..562bcde6c1 100644 --- a/reference/deque/deque/emplace.md +++ b/reference/deque/deque/emplace.md @@ -85,6 +85,6 @@ int main() ## 参照 - [N2345 Placement Insert for Containers (Revision 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2345.pdf) - [LWG Issue 2252. Strong guarantee on `vector::push_back()` still broken with C++11?](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2252) - - 経緯の説明は、[`vector::push_back()`](/reference/vector/push_back.md)ページを参照。 + - 経緯の説明は、[`vector::push_back()`](/reference/vector/vector/push_back.md)ページを参照。 diff --git a/reference/deque/deque/emplace_back.md b/reference/deque/deque/emplace_back.md index 7346963b92..bbc6113bf5 100644 --- a/reference/deque/deque/emplace_back.md +++ b/reference/deque/deque/emplace_back.md @@ -91,7 +91,7 @@ int main() ## 参照 - [N2680 Proposed Wording for Placement Insert (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2680.pdf) - [LWG Issue 2252. Strong guarantee on `vector::push_back()` still broken with C++11?](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2252) - - 経緯の説明は、[`vector::push_back()`](/reference/vector/push_back.md)ページを参照。 + - 経緯の説明は、[`vector::push_back()`](/reference/vector/vector/push_back.md)ページを参照。 - [P0084R0 Emplace Return Type](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0084r0.pdf) - [P0084R1 Emplace Return Type (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0084r1.pdf) - [P0084R2 Emplace Return Type (Revision 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0084r2.pdf) diff --git a/reference/deque/deque/emplace_front.md b/reference/deque/deque/emplace_front.md index 1f3ab68a82..f0a472624d 100644 --- a/reference/deque/deque/emplace_front.md +++ b/reference/deque/deque/emplace_front.md @@ -91,7 +91,7 @@ int main() ## 参照 - [N2680 Proposed Wording for Placement Insert (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2680.pdf) - [LWG Issue 2252. Strong guarantee on `vector::push_back()` still broken with C++11?](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2252) - - 経緯の説明は、[`vector::push_back()`](/reference/vector/push_back.md)ページを参照。 + - 経緯の説明は、[`vector::push_back()`](/reference/vector/vector/push_back.md)ページを参照。 - [P0084R0 Emplace Return Type](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0084r0.pdf) - [P0084R1 Emplace Return Type (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0084r1.pdf) - [P0084R2 Emplace Return Type (Revision 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0084r2.pdf) diff --git a/reference/deque/deque/insert.md b/reference/deque/deque/insert.md index dd8cc30220..ce7f3790ef 100644 --- a/reference/deque/deque/insert.md +++ b/reference/deque/deque/insert.md @@ -102,5 +102,5 @@ int main() - [N2679 Initializer Lists for Standard Containers(Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2679.pdf) - (5)の経緯となる提案文書 - [LWG Issue 2252. Strong guarantee on `vector::push_back()` still broken with C++11?](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2252) - - 経緯の説明は、[`vector::push_back()`](/reference/vector/push_back.md)ページを参照。 + - 経緯の説明は、[`vector::push_back()`](/reference/vector/vector/push_back.md)ページを参照。 diff --git a/reference/deque/deque/push_back.md b/reference/deque/deque/push_back.md index cdec7b64a3..0bb55bf002 100644 --- a/reference/deque/deque/push_back.md +++ b/reference/deque/deque/push_back.md @@ -71,5 +71,5 @@ world ## 参照 - [LWG Issue 2252. Strong guarantee on `vector::push_back()` still broken with C++11?](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2252) - - 経緯の説明は、[`vector::push_back()`](/reference/vector/push_back.md)ページを参照。 + - 経緯の説明は、[`vector::push_back()`](/reference/vector/vector/push_back.md)ページを参照。 diff --git a/reference/deque/deque/push_front.md b/reference/deque/deque/push_front.md index 82ce899912..5b75b8fb72 100644 --- a/reference/deque/deque/push_front.md +++ b/reference/deque/deque/push_front.md @@ -71,5 +71,5 @@ world ## 参照 - [LWG Issue 2252. Strong guarantee on `vector::push_back()` still broken with C++11?](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2252) - - 経緯の説明は、[`vector::push_back()`](/reference/vector/push_back.md)ページを参照。 + - 経緯の説明は、[`vector::push_back()`](/reference/vector/vector/push_back.md)ページを参照。 diff --git a/reference/iostream/cerr.md b/reference/iostream/cerr.md index ee608bb499..72c87b6eaf 100644 --- a/reference/iostream/cerr.md +++ b/reference/iostream/cerr.md @@ -44,7 +44,7 @@ int main() } ``` * std::cerr[color ff0000] -* v.at[link /reference/vector/at.md] +* v.at[link /reference/vector/vector/at.md] * std::exception[link /reference/exception/exception.md] ### 出力例 diff --git a/reference/iterator/back_insert_iterator.md b/reference/iterator/back_insert_iterator.md index 2ba19f7f87..020fcce0aa 100644 --- a/reference/iterator/back_insert_iterator.md +++ b/reference/iterator/back_insert_iterator.md @@ -73,10 +73,10 @@ int main() } ``` * std::back_inserter[color ff0000] -* dest.reserve[link /reference/vector/reserve.md] -* src.size()[link /reference/vector/size.md] -* src.begin()[link /reference/vector/begin.md] -* src.end()[link /reference/vector/end.md] +* dest.reserve[link /reference/vector/vector/reserve.md] +* src.size()[link /reference/vector/vector/size.md] +* src.begin()[link /reference/vector/vector/begin.md] +* src.end()[link /reference/vector/vector/end.md] ### 出力 ``` diff --git a/reference/iterator/back_inserter.md b/reference/iterator/back_inserter.md index 3ae53c03b7..1a1421326d 100644 --- a/reference/iterator/back_inserter.md +++ b/reference/iterator/back_inserter.md @@ -44,10 +44,10 @@ int main() } ``` * std::back_inserter[color ff0000] -* dest.reserve[link /reference/vector/reserve.md] -* src.size()[link /reference/vector/size.md] -* src.begin()[link /reference/vector/begin.md] -* src.end()[link /reference/vector/end.md] +* dest.reserve[link /reference/vector/vector/reserve.md] +* src.size()[link /reference/vector/vector/size.md] +* src.begin()[link /reference/vector/vector/begin.md] +* src.end()[link /reference/vector/vector/end.md] ### 出力 ``` diff --git a/reference/iterator/move_iterator.md b/reference/iterator/move_iterator.md index 5584486b4f..c74096348b 100644 --- a/reference/iterator/move_iterator.md +++ b/reference/iterator/move_iterator.md @@ -88,7 +88,7 @@ int main() } ``` * std::make_move_iterator[color ff0000] -* v.emplace_back[link /reference/vector/emplace_back.md] +* v.emplace_back[link /reference/vector/vector/emplace_back.md] ### 出力 ``` diff --git a/reference/iterator/move_iterator/base.md b/reference/iterator/move_iterator/base.md index 8a9dacad0a..a0116b6ecf 100644 --- a/reference/iterator/move_iterator/base.md +++ b/reference/iterator/move_iterator/base.md @@ -37,7 +37,7 @@ int main() } ``` * base()[color ff0000] -* v.emplace_back[link /reference/vector/emplace_back.md] +* v.emplace_back[link /reference/vector/vector/emplace_back.md] ### 出力 ``` diff --git a/reference/iterator/move_iterator/op_arrow.md b/reference/iterator/move_iterator/op_arrow.md index 897a30d88b..9e6e7ca531 100644 --- a/reference/iterator/move_iterator/op_arrow.md +++ b/reference/iterator/move_iterator/op_arrow.md @@ -37,7 +37,7 @@ int main() } ``` * it->get()[color ff0000] -* v.emplace_back[link /reference/vector/emplace_back.md] +* v.emplace_back[link /reference/vector/vector/emplace_back.md] ### 出力 diff --git a/reference/iterator/move_iterator/op_assign.md b/reference/iterator/move_iterator/op_assign.md index 66272abf68..4b89614311 100644 --- a/reference/iterator/move_iterator/op_assign.md +++ b/reference/iterator/move_iterator/op_assign.md @@ -40,7 +40,7 @@ int main() std::cout << **it2.base() << std::endl; } ``` -* v.emplace_back[link /reference/vector/emplace_back.md] +* v.emplace_back[link /reference/vector/vector/emplace_back.md] * it2.base()[link base.md] ### 出力 diff --git a/reference/iterator/move_iterator/op_at.md b/reference/iterator/move_iterator/op_at.md index c02d96f77c..fb23cf9971 100644 --- a/reference/iterator/move_iterator/op_at.md +++ b/reference/iterator/move_iterator/op_at.md @@ -38,7 +38,7 @@ int main() } ``` * it[2][color ff0000] -* v.emplace_back[link /reference/vector/emplace_back.md] +* v.emplace_back[link /reference/vector/vector/emplace_back.md] * std::make_move_iterator[link /reference/iterator/make_move_iterator.md] ### 出力 diff --git a/reference/iterator/move_iterator/op_constructor.md b/reference/iterator/move_iterator/op_constructor.md index b1287ed7fe..23fa9fd5b3 100644 --- a/reference/iterator/move_iterator/op_constructor.md +++ b/reference/iterator/move_iterator/op_constructor.md @@ -60,7 +60,7 @@ int main() std::cout << *p << std::endl; } ``` -* v.emplace_back[link /reference/vector/emplace_back.md] +* v.emplace_back[link /reference/vector/vector/emplace_back.md] * std::move[link /reference/utility/move.md] ### 出力 diff --git a/reference/iterator/move_iterator/op_decrement.md b/reference/iterator/move_iterator/op_decrement.md index b1473b4d0a..e3cb5664ad 100644 --- a/reference/iterator/move_iterator/op_decrement.md +++ b/reference/iterator/move_iterator/op_decrement.md @@ -54,7 +54,7 @@ int main() std::cout << *p << std::endl; } ``` -* v.emplace_back[link /reference/vector/emplace_back.md] +* v.emplace_back[link /reference/vector/vector/emplace_back.md] * std::make_move_iterator[link /reference/iterator/make_move_iterator.md] ### 出力 diff --git a/reference/iterator/move_iterator/op_deref.md b/reference/iterator/move_iterator/op_deref.md index d2d1f14905..b97721a278 100644 --- a/reference/iterator/move_iterator/op_deref.md +++ b/reference/iterator/move_iterator/op_deref.md @@ -36,7 +36,7 @@ int main() std::cout << *p << std::endl; } ``` -* v.emplace_back[link /reference/vector/emplace_back.md] +* v.emplace_back[link /reference/vector/vector/emplace_back.md] * std::make_move_iterator[link /reference/iterator/make_move_iterator.md] ### 出力 diff --git a/reference/iterator/move_iterator/op_equal.md b/reference/iterator/move_iterator/op_equal.md index cc40cef103..b0abb27a00 100644 --- a/reference/iterator/move_iterator/op_equal.md +++ b/reference/iterator/move_iterator/op_equal.md @@ -44,7 +44,7 @@ int main() } } ``` -* v.emplace_back[link /reference/vector/emplace_back.md] +* v.emplace_back[link /reference/vector/vector/emplace_back.md] * std::make_move_iterator[link /reference/iterator/make_move_iterator.md] ### 出力 diff --git a/reference/iterator/move_iterator/op_greater.md b/reference/iterator/move_iterator/op_greater.md index a94960225f..2a354ce61b 100644 --- a/reference/iterator/move_iterator/op_greater.md +++ b/reference/iterator/move_iterator/op_greater.md @@ -45,7 +45,7 @@ int main() } } ``` -* v.emplace_back[link /reference/vector/emplace_back.md] +* v.emplace_back[link /reference/vector/vector/emplace_back.md] * std::make_move_iterator[link /reference/iterator/make_move_iterator.md] ### 出力 diff --git a/reference/iterator/move_iterator/op_greater_equal.md b/reference/iterator/move_iterator/op_greater_equal.md index bdcef31cd6..51831d4901 100644 --- a/reference/iterator/move_iterator/op_greater_equal.md +++ b/reference/iterator/move_iterator/op_greater_equal.md @@ -45,7 +45,7 @@ int main() } } ``` -* v.emplace_back[link /reference/vector/emplace_back.md] +* v.emplace_back[link /reference/vector/vector/emplace_back.md] * std::make_move_iterator[link /reference/iterator/make_move_iterator.md] ### 出力 diff --git a/reference/iterator/move_iterator/op_increment.md b/reference/iterator/move_iterator/op_increment.md index a6fded27a2..19d2dce452 100644 --- a/reference/iterator/move_iterator/op_increment.md +++ b/reference/iterator/move_iterator/op_increment.md @@ -53,7 +53,7 @@ int main() std::cout << *p << std::endl; } ``` -* v.emplace_back[link /reference/vector/emplace_back.md] +* v.emplace_back[link /reference/vector/vector/emplace_back.md] * std::make_move_iterator[link /reference/iterator/make_move_iterator.md] ### 出力 diff --git a/reference/iterator/move_iterator/op_less.md b/reference/iterator/move_iterator/op_less.md index 8ba44fd5b2..e511d9b50d 100644 --- a/reference/iterator/move_iterator/op_less.md +++ b/reference/iterator/move_iterator/op_less.md @@ -46,7 +46,7 @@ int main() } } ``` -* v.emplace_back[link /reference/vector/emplace_back.md] +* v.emplace_back[link /reference/vector/vector/emplace_back.md] * std::make_move_iterator[link /reference/iterator/make_move_iterator.md] ### 出力 diff --git a/reference/iterator/move_iterator/op_less_equal.md b/reference/iterator/move_iterator/op_less_equal.md index beb0bdcaf8..790cec211f 100644 --- a/reference/iterator/move_iterator/op_less_equal.md +++ b/reference/iterator/move_iterator/op_less_equal.md @@ -45,7 +45,7 @@ int main() } } ``` -* v.emplace_back[link /reference/vector/emplace_back.md] +* v.emplace_back[link /reference/vector/vector/emplace_back.md] * std::make_move_iterator[link /reference/iterator/make_move_iterator.md] ### 出力 diff --git a/reference/iterator/move_iterator/op_minus.md b/reference/iterator/move_iterator/op_minus.md index 5368c7d35b..4f47a4b2da 100644 --- a/reference/iterator/move_iterator/op_minus.md +++ b/reference/iterator/move_iterator/op_minus.md @@ -44,7 +44,7 @@ int main() } ``` * it2 - it1[color ff0000] -* v.emplace_back[link /reference/vector/emplace_back.md] +* v.emplace_back[link /reference/vector/vector/emplace_back.md] * std::make_move_iterator[link /reference/iterator/make_move_iterator.md] ### 出力 diff --git a/reference/iterator/move_iterator/op_minus_assign.md b/reference/iterator/move_iterator/op_minus_assign.md index eb85502a8c..bef582bc98 100644 --- a/reference/iterator/move_iterator/op_minus_assign.md +++ b/reference/iterator/move_iterator/op_minus_assign.md @@ -44,7 +44,7 @@ int main() } ``` * it -= 2[color ff0000] -* v.emplace_back[link /reference/vector/emplace_back.md] +* v.emplace_back[link /reference/vector/vector/emplace_back.md] * std::make_move_iterator[link /reference/iterator/make_move_iterator.md] ### 出力 diff --git a/reference/iterator/move_iterator/op_not_equal.md b/reference/iterator/move_iterator/op_not_equal.md index 47c66dff79..6e089898fb 100644 --- a/reference/iterator/move_iterator/op_not_equal.md +++ b/reference/iterator/move_iterator/op_not_equal.md @@ -46,7 +46,7 @@ int main() } ``` * it1 != it2[color ff0000] -* v.emplace_back[link /reference/vector/emplace_back.md] +* v.emplace_back[link /reference/vector/vector/emplace_back.md] * std::make_move_iterator[link /reference/iterator/make_move_iterator.md] ### 出力 diff --git a/reference/iterator/move_iterator/op_plus.md b/reference/iterator/move_iterator/op_plus.md index f2c0f3bab7..acae2802c8 100644 --- a/reference/iterator/move_iterator/op_plus.md +++ b/reference/iterator/move_iterator/op_plus.md @@ -41,7 +41,7 @@ int main() } ``` * 2 + it[color ff0000] -* v.emplace_back[link /reference/vector/emplace_back.md] +* v.emplace_back[link /reference/vector/vector/emplace_back.md] * std::make_move_iterator[link /reference/iterator/make_move_iterator.md] ### 出力 diff --git a/reference/iterator/move_iterator/op_plus_assign.md b/reference/iterator/move_iterator/op_plus_assign.md index 0f4220d83c..e24c912b35 100644 --- a/reference/iterator/move_iterator/op_plus_assign.md +++ b/reference/iterator/move_iterator/op_plus_assign.md @@ -43,7 +43,7 @@ int main() } ``` * it += 2[color ff0000] -* v.emplace_back[link /reference/vector/emplace_back.md] +* v.emplace_back[link /reference/vector/vector/emplace_back.md] * std::make_move_iterator[link /reference/iterator/make_move_iterator.md] ### 出力 diff --git a/reference/iterator/move_iterator/op_unary_minus.md b/reference/iterator/move_iterator/op_unary_minus.md index 9187cea128..8dc2179472 100644 --- a/reference/iterator/move_iterator/op_unary_minus.md +++ b/reference/iterator/move_iterator/op_unary_minus.md @@ -38,7 +38,7 @@ int main() } ``` * it - 2[color ff0000] -* v.emplace_back[link /reference/vector/emplace_back.md] +* v.emplace_back[link /reference/vector/vector/emplace_back.md] * std::make_move_iterator[link /reference/iterator/make_move_iterator.md] ### 出力 diff --git a/reference/iterator/move_iterator/op_unary_plus.md b/reference/iterator/move_iterator/op_unary_plus.md index 85b24fc420..429f3763b5 100644 --- a/reference/iterator/move_iterator/op_unary_plus.md +++ b/reference/iterator/move_iterator/op_unary_plus.md @@ -38,7 +38,7 @@ int main() } ``` * it + 2[color ff0000] -* v.emplace_back[link /reference/vector/emplace_back.md] +* v.emplace_back[link /reference/vector/vector/emplace_back.md] * std::make_move_iterator[link /reference/iterator/make_move_iterator.md] diff --git a/reference/list/list/op_constructor.md b/reference/list/list/op_constructor.md index d9910b4f77..1a51089207 100644 --- a/reference/list/list/op_constructor.md +++ b/reference/list/list/op_constructor.md @@ -91,7 +91,7 @@ list オブジェクトの構築 ``` * std::scoped_allocator_adaptor[link ../../scoped_allocator/scoped_allocator_adaptor.md] * std::allocator[link ../../memory/allocator.md] - * emplace_back[link ../../vector/emplace_back.md] + * v.emplace_back[link /reference/vector/vector/emplace_back.md] ## 例 diff --git a/reference/mutex/lock_guard.md b/reference/mutex/lock_guard.md index 577b880d2f..bf867fd69b 100644 --- a/reference/mutex/lock_guard.md +++ b/reference/mutex/lock_guard.md @@ -83,7 +83,7 @@ int main() } ``` * std::lock_guard[color ff0000] -* data_.push_back[link /reference/vector/push_back.md] +* data_.push_back[link /reference/vector/vector/push_back.md] ### 出力 ``` diff --git a/reference/mutex/mutex.md b/reference/mutex/mutex.md index f3532aa00c..5b3e556114 100644 --- a/reference/mutex/mutex.md +++ b/reference/mutex/mutex.md @@ -74,7 +74,7 @@ int main() } ``` * std::mutex[color ff0000] -* data_.push_back[link /reference/vector/push_back.md] +* data_.push_back[link /reference/vector/vector/push_back.md] ### 出力 ``` diff --git a/reference/mutex/unique_lock.md b/reference/mutex/unique_lock.md index 6b82496146..9547cbd2dd 100644 --- a/reference/mutex/unique_lock.md +++ b/reference/mutex/unique_lock.md @@ -117,7 +117,7 @@ int main() } ``` * std::unique_lock[color ff0000] -* data_.push_back[link /reference/vector/push_back.md] +* data_.push_back[link /reference/vector/vector/push_back.md] ### 出力例 ``` diff --git a/reference/numeric/adjacent_difference.md b/reference/numeric/adjacent_difference.md index 87cdfcf4ac..323df423da 100644 --- a/reference/numeric/adjacent_difference.md +++ b/reference/numeric/adjacent_difference.md @@ -87,7 +87,7 @@ int main() } ``` * std::adjacent_difference[color ff0000] -* diffs.begin()[link /reference/vector/begin.md] +* diffs.begin()[link /reference/vector/vector/begin.md] ### 出力 ``` diff --git a/reference/numeric/inner_product.md b/reference/numeric/inner_product.md index 9d0384d279..3abc949351 100644 --- a/reference/numeric/inner_product.md +++ b/reference/numeric/inner_product.md @@ -74,7 +74,7 @@ int main() } ``` * std::inner_product[color ff0000] -* u.begin()[link /reference/vector/begin.md] +* u.begin()[link /reference/vector/vector/begin.md] ### 出力 ``` diff --git a/reference/optional/optional/op_destructor.md b/reference/optional/optional/op_destructor.md index 23415a2b25..70e15ac9ac 100644 --- a/reference/optional/optional/op_destructor.md +++ b/reference/optional/optional/op_destructor.md @@ -68,5 +68,5 @@ int main() ## 関連項目 -- [`std::vector`クラスのデストラクタ](/reference/vector/op_destructor.md) +- [`std::vector`クラスのデストラクタ](/reference/vector/vector/op_destructor.md) - [`std::is_trivially_destructible`](/reference/type_traits/is_trivially_destructible.md) diff --git a/reference/optional/optional/reset.md b/reference/optional/optional/reset.md index 75ed3f3028..1da7cdab1f 100644 --- a/reference/optional/optional/reset.md +++ b/reference/optional/optional/reset.md @@ -60,5 +60,5 @@ int main() ## 関連項目 -- [`std::vector`クラスのデストラクタ](/reference/vector/op_destructor.md) +- [`std::vector`クラスのデストラクタ](/reference/vector/vector/op_destructor.md) - [`std::is_trivially_destructible`](/reference/type_traits/is_trivially_destructible.md) diff --git a/reference/random/discrete_distribution.md b/reference/random/discrete_distribution.md index 2a72a5c7b5..12d4dd5b00 100644 --- a/reference/random/discrete_distribution.md +++ b/reference/random/discrete_distribution.md @@ -105,8 +105,8 @@ int main() } ``` * std::discrete_distribution[color ff0000] -* probabilities.begin()[link /reference/vector/begin.md] -* probabilities.end()[link /reference/vector/end.md] +* probabilities.begin()[link /reference/vector/vector/begin.md] +* probabilities.end()[link /reference/vector/vector/end.md] * std::ofstream[link /reference/fstream/basic_ofstream.md.nolink] * dist(engine)[link discrete_distribution/op_call.md] diff --git a/reference/random/discrete_distribution/op_constructor.md b/reference/random/discrete_distribution/op_constructor.md index e662d7e531..0694a4aebc 100644 --- a/reference/random/discrete_distribution/op_constructor.md +++ b/reference/random/discrete_distribution/op_constructor.md @@ -107,8 +107,8 @@ int main() } } ``` -* probabilities.begin()[link /reference/vector/begin.md] -* probabilities.end()[link /reference/vector/end.md] +* probabilities.begin()[link /reference/vector/vector/begin.md] +* probabilities.end()[link /reference/vector/vector/end.md] ### 出力例 ``` diff --git a/reference/random/seed_seq/generate.md b/reference/random/seed_seq/generate.md index 82cbedee14..ab465689c3 100644 --- a/reference/random/seed_seq/generate.md +++ b/reference/random/seed_seq/generate.md @@ -81,8 +81,8 @@ int main() } ``` * generate[color ff0000] -* seeds.begin()[link /reference/vector/begin.md] -* seeds.end()[link /reference/vector/end.md] +* seeds.begin()[link /reference/vector/vector/begin.md] +* seeds.end()[link /reference/vector/vector/end.md] * std::uint32_t[link /reference/cstdint/uint32_t.md] ### 出力 diff --git a/reference/random/seed_seq/op_constructor.md b/reference/random/seed_seq/op_constructor.md index 12d262f2ea..66e5c64782 100644 --- a/reference/random/seed_seq/op_constructor.md +++ b/reference/random/seed_seq/op_constructor.md @@ -118,8 +118,8 @@ int main() * seq.param[link param.md] * std::uint64_t[link /reference/cstdint/uint64_t.md] * max()[link /reference/limits/numeric_limits/max.md] -* seed_data.begin()[link /reference/vector/begin.md] -* seed_data.end()[link /reference/vector/end.md] +* seed_data.begin()[link /reference/vector/vector/begin.md] +* seed_data.end()[link /reference/vector/vector/end.md] ### 出力 ``` diff --git a/reference/random/seed_seq/param.md b/reference/random/seed_seq/param.md index 042dd7b3ca..4b8a59b185 100644 --- a/reference/random/seed_seq/param.md +++ b/reference/random/seed_seq/param.md @@ -63,8 +63,8 @@ int main() ``` * std::uint64_t[link /reference/cstdint/uint64_t.md] * max()[link /reference/limits/numeric_limits/max.md] -* seed_data.begin()[link /reference/vector/begin.md] -* seed_data.end()[link /reference/vector/end.md] +* seed_data.begin()[link /reference/vector/vector/begin.md] +* seed_data.end()[link /reference/vector/vector/end.md] ### 出力 ``` diff --git a/reference/scoped_allocator/scoped_allocator_adaptor.md b/reference/scoped_allocator/scoped_allocator_adaptor.md index f30396f873..4c40dff27a 100644 --- a/reference/scoped_allocator/scoped_allocator_adaptor.md +++ b/reference/scoped_allocator/scoped_allocator_adaptor.md @@ -166,9 +166,9 @@ int main() ``` * std::scoped_allocator_adaptor[color ff0000] * std::allocator[link /reference/memory/allocator.md] -* v.push_back[link /reference/vector/push_back.md] -* v.get_allocator()[link /reference/vector/get_allocator.md] -* v.front()[link /reference/vector/front.md] +* v.push_back[link /reference/vector/vector/push_back.md] +* v.get_allocator()[link /reference/vector/vector/get_allocator.md] +* v.front()[link /reference/vector/vector/front.md] ### 出力 ``` @@ -250,8 +250,8 @@ int main() ``` * std::scoped_allocator_adaptor[color ff0000] * std::allocator[link /reference/memory/allocator.md] -* v.push_back[link /reference/vector/push_back.md] -* v.get_allocator()[link /reference/vector/get_allocator.md] +* v.push_back[link /reference/vector/vector/push_back.md] +* v.get_allocator()[link /reference/vector/vector/get_allocator.md] * x.get_allocator()[link /reference/forward_list/forward_list/get_allocator.md] ### 出力 diff --git a/reference/stack/stack/op_constructor.md b/reference/stack/stack/op_constructor.md index 86840f9b6c..1f799f0342 100644 --- a/reference/stack/stack/op_constructor.md +++ b/reference/stack/stack/op_constructor.md @@ -77,7 +77,7 @@ int main() } } ``` -* v.push_back[link /reference/vector/push_back.md] +* v.push_back[link /reference/vector/vector/push_back.md] * std::move[link /reference/utility/move.md] * st.empty()[link empty.md] * st.top()[link top.md] diff --git a/reference/string/basic_string/shrink_to_fit.md b/reference/string/basic_string/shrink_to_fit.md index 3edc8076d0..0bb4510602 100644 --- a/reference/string/basic_string/shrink_to_fit.md +++ b/reference/string/basic_string/shrink_to_fit.md @@ -81,7 +81,7 @@ void basic_string::shrink_to_fit() { ## 関連項目 -- [`std::vector<>::shrink_to_fit`](../../vector/shrink_to_fit.md) +- [`std::vector<>::shrink_to_fit`](../../vector/vector/shrink_to_fit.md) - [`std::deque<>::shrink_to_fit`](../../deque/deque/shrink_to_fit.md) diff --git a/reference/vector.md b/reference/vector.md index 6d81bbf6f7..0a8fcd7f11 100644 --- a/reference/vector.md +++ b/reference/vector.md @@ -1,276 +1,9 @@ # vector * vector[meta header] -* std[meta namespace] -* class template[meta id-type] -```cpp -namespace std { - template > - class vector; -} -``` -* allocator[link /reference/memory/allocator.md] -`vector`はシーケンスコンテナの一種で、各要素は線形に、順序を保ったまま格納される。 - -`vector`コンテナは可変長配列として実装される。通常の(`new []`で確保した)配列と同じように、`vector`の各要素は連続して配置されるため、イテレータだけでなく添字による要素のランダムアクセスも高速である。 - -配列と違い、ストレージは`vector`自体が管理するため、自動的に領域の拡張が行われる。 - - -`vector`は次の点で優れている。 - -- 各要素への添字アクセス(定数時間) -- 全要素の両方向の走査(線形時間) -- 末尾への要素の追加・削除(償却定数時間) - -これらの挙動は配列と同じパフォーマンス特性を示し、加えてストレージサイズの変更が非常に簡単である。ただし、`vector`は実際の要素数より少し余分にメモリを確保する(これは拡張に備え、パフォーマンス特性を満足するための仕様である)。 - -他の標準シーケンスコンテナと比べ、`vector`は要素アクセスと(末尾に対する)追加・削除において一般的に最高の性能を誇る。末尾以外に対する挿入・削除は[`deque`](/reference/deque/deque.md)や[`list`](/reference/list/list.md)に劣り、イテレータや要素への参照の安定性(無効になる操作の数)では[`list`](/reference/list/list.md)に劣る。 - -内部的には、`vector`は(他のすべてのコンテナと同じように)サイズ用のメンバ変数を持ち、格納されている要素数を管理している。しかし`vector`の場合は、さらに確保済みのメモリサイズを管理するキャパシティ用のメンバ変数を持ち、これは常に[`size()`](vector/size.md)と同じか大きい値となる。確保済みの領域の余計な部分は、要素数の増加に備えて確保しているものである。この動作のおかげで、要素を追加するたびにメモリを再確保する必要が無くなり、単に確保済みの領域を初期化するだけでよくなる(再確保は要素数の対数の頻度で発生する)。 - -領域の再確保が発生すると、全ての要素が新しい領域にコピーされるため非常にコストがかかる。このため、最終的な要素数が大きくなると解っている場合はあらかじめ[`reserve()`](vector/reserve.md)メンバ関数でキャパシティを増加させておくことが望ましい。 - - -各テンプレートパラメータの意味は次の通りである。 - -- `T`: 格納される要素の型 -- `Allocator`: メモリ確保に使用されるアロケータの型。デフォルトでは標準の[`allocator`](/reference/memory/allocator.md)クラスが使用される。 - -リファレンス中では、これらの名前をテンプレートパラメータとして扱う。 - - -## メンバ関数 -### 構築・破棄 - -| 名前 | 説明 | 対応バージョン | -|---------------------------------------|----------------|-------| -| [`(constructor)`](vector/op_constructor.md) | コンストラクタ | | -| [`(destructor)`](vector/op_destructor.md) | デストラクタ | | -| [`operator=`](vector/op_assign.md) | 代入演算子 | | - - -### イテレータ +``ヘッダでは、可変長配列の実装である `vector` コンテナを提供する。 | 名前 | 説明 | 対応バージョン | -|----------------------------------|---------------------------------------|-------| -| [`begin`](vector/begin.md) | 先頭の要素を指すイテレータを取得する | | -| [`end`](vector/end.md) | 末尾の次を指すイテレータを取得する | | -| [`cbegin`](vector/cbegin.md) | 先頭の要素を指す読み取り専用イテレータを取得する | C++11 | -| [`cend`](vector/cend.md) | 末尾の次を指す読み取り専用イテレータを取得する | C++11 | -| [`rbegin`](vector/rbegin.md) | 末尾を指す逆イテレータを取得する | | -| [`rend`](vector/rend.md) | 先頭の前を指す逆イテレータを取得する | | -| [`crbegin`](vector/crbegin.md) | 末尾を指す読み取り専用逆イテレータを取得する | C++11 | -| [`crend`](vector/crend.md) | 先頭の前を指す読み取り専用逆イテレータを取得する | C++11 | - - -### 領域 - -| 名前 | 説明 | 対応バージョン | -|----------------------------------------------|------------------|-------| -| [`size`](vector/size.md) | 要素数を取得する | | -| [`max_size`](vector/max_size.md) | 格納可能な最大の要素数を取得する | | -| [`resize`](vector/resize.md) | 要素数を変更する | | -| [`capacity`](vector/capacity.md) | メモリを再確保せずに格納できる最大の要素数を取得する | | -| [`empty`](vector/empty.md) | コンテナが空かどうかを判定する | | -| [`reserve`](vector/reserve.md) | capacityを変更する | | -| [`shrink_to_fit`](vector/shrink_to_fit.md) | capacityをsizeまで縮小する | C++11 | - - -### 要素アクセス - -| 名前 | 説明 | 対応バージョン | -|-----------------------------------|---------------|-------| -| [`operator[]`](vector/op_at.md) | 要素アクセス | | -| [`at`](vector/at.md) | 要素アクセス | | -| [`data`](vector/data.md) | 配列の先頭へのポインタを取得する | C++11 | -| [`front`](vector/front.md) | 先頭要素への参照を取得する | | -| [`back`](vector/back.md) | 末尾要素への参照を取得する | | - - -### コンテナの変更 - -| 名前 | 説明 | 対応バージョン | -|--------------------------------------------|------------------|-------| -| [`assign`](vector/assign.md) | コンテナの再代入 | | -| [`push_back`](vector/push_back.md) | 末尾へ要素追加 | | -| [`emplace_back`](vector/emplace_back.md) | 末尾へ直接構築 | C++11 | -| [`pop_back`](vector/pop_back.md) | 末尾から要素削除 | | -| [`insert`](vector/insert.md) | 要素の挿入 | | -| [`emplace`](vector/emplace.md) | 要素の直接構築による挿入 | C++11 | -| [`erase`](vector/erase.md) | 要素の削除 | | -| [`swap`](vector/swap.md) | コンテナの交換 | | -| [`clear`](vector/clear.md) | 全要素削除 | | - - -### アロケータ - -| 名前 | 説明 | 対応バージョン | -|----------------------------------------------|------------------------------|-------| -| [`get_allocator`](vector/get_allocator.md) | アロケータオブジェクトの取得 | | - - -## メンバ型 - -| 名前 | 説明 | 対応バージョン | -|--------------------------|-----------------------------------------------------------------------|-------| -| `reference` | `T&` | | -| `const_reference` | `const T&` | | -| `iterator` | ランダムアクセスイテレータ | | -| `const_iterator` | 読み取り専用ランダムアクセスイテレータ | | -| `size_type` | 符号なし整数型 (通常は[`size_t`](/reference/cstddef/size_t.md)) | | -| `difference_type` | 符号付き整数型 (通常は[`ptrdiff_t`](/reference/cstddef/ptrdiff_t.md)) | | -| `value_type` | 要素型 `T` | | -| `allocator_type` | アロケータの型 `Allocator` | | -| `pointer` | `Allocator::pointer` | | -| `const_pointer` | `Allocator::const_pointer` | | -| `reverse_iterator` | [`reverse_iterator`](/reference/iterator/reverse_iterator.md)`` | | -| `const_reverse_iterator` | [`reverse_iterator`](/reference/iterator/reverse_iterator.md)`` | | - - -## 非メンバ関数 - -| 名前 | 説明 | 対応バージョン | -|----------------------------------------------|------------------------------------|-------| -| [`operator==`](vector/op_equal.md) | 等値比較 | | -| [`operator!=`](vector/op_not_equal.md) | 非等値比較 | | -| [`operator<`](vector/op_less.md) | 左辺が右辺より小さいかの判定を行う | | -| [`operator<=`](vector/op_less_equal.md) | 左辺が右辺以下かの判定を行う | | -| [`operator>`](vector/op_greater.md) | 左辺が右辺より大きいかの判定を行う | | -| [`operator>=`](vector/op_greater_equal.md) | 左辺が右辺以上かの判定を行う | | -| [`swap`](vector/swap_free.md) | 2つの`vector`オブジェクトを入れ替える | | - - -## 推論補助 - -| 名前 | 説明 | 対応バージョン | -|---------------------------------------------|------------------------------------|-------| -| [`(deduction_guide)`](vector/op_deduction_guide.md) | クラステンプレートの推論補助 | C++17 | - - -## 例 (C++11) -```cpp example -#include -#include -#include - -int main() -{ - // int型を要素とする可変長配列の変数を定義し、 - // 初期状態の要素を設定 - std::vector v = {1, 99, 4}; - - v[1] = 3; // 1番目の要素を参照し、書き換える - v.push_back(5); // 末尾に値5を追加 - v.insert(v.begin() + 1, 2); // 1番目に値2を挿入 - - int* p = v.data(); // 内部表現のポインタを取得 - std::size_t size = v.size(); // 要素数を取得 - assert(p[0] == 1); - assert(size == 5u); - - // 各要素に対して操作を行う - for (int x : v) { - std::cout << x << std::endl; - } -} -``` -* v[1][link vector/op_at.md] -* v.push_back[link vector/push_back.md] -* v.insert[link vector/insert.md] -* v.data()[link vector/data.md] -* for[link /lang/cpp11/range_based_for.md] - -### 出力 -``` -1 -2 -3 -4 -5 -``` - - -## `vector`特殊化 -`vector`は`bool`型に対して特殊化されている。 - -この特殊化はメモリ領域を最小化するために提供されていて、各要素は1bitの領域のみを必要とする。 - -`vector::reference`は`bool`への参照ではなく、領域内の1bitを指す型であり、以下のようなインタフェースである。 - -```cpp -class vector::reference { - friend class vector; - reference(); // コンストラクタは非公開 -public: - ~reference(); - operator bool() const; // boolへの暗黙変換 - reference& operator=(const bool x); // boolからの代入 - reference& operator=(const reference& x); // vectorのビットからの代入 - void flip(); // ビットの反転 -} -``` - -### ハッシュサポート - -| 名前 | 説明 | 対応バージョン | -|--------------------------------------------------------------------|------------------------------------------|-------| -| `template struct hash;` | `hash`クラスの先行宣言 | C++11 | -| `template struct hash>;` | `hash`クラスの`vector`に対する特殊化 | C++11 | - - -### `vector`の基本操作: -```cpp example -#include -#include -#include - -int main() -{ - std::vector v(8, false); - v[5] = true; // ビットを立てる - v[7].flip(); // ビット反転(1だったら0、0だったら1にする) - -//bool& x = v[3]; // エラー!プロキシオブジェクトのため、bool&には変換できない - bool x = v[3]; // OK : コピーはできる - std::cout << "v[3] : " << x << std::endl; - - // イテレータ操作は可能 - std::for_each(v.begin(), v.end(), [](bool x) { - std::cout << x << std::endl; - }); -} -``` -* v[5][link vector/op_at.md] -* v[7][link vector/op_at.md] -* v[3][link vector/op_at.md] - -### 出力 -``` -v[3] : 0 -0 -0 -0 -0 -0 -1 -0 -1 -``` - -`vector`の要素は参照するとプロキシオブジェクトのコピーが返ってくるため、RandomAccessIteratorの要件を満たさない。 - - -## 参照 -- `vector`のメモリ効率について - - [2倍だけじゃない - Derive Your Dreams](http://www.kmonos.net/wlog/111.html#_2334100705) - - [それでも2倍だ - Derive Your Dreams](http://www.kmonos.net/wlog/111.html#_1001100720) -- [LWG Issue 69. Must elements of a `vector` be contiguous?](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#69) - - C++03から、`vector`の要素のメモリが連続していることが保証された。 -- [N1211 - `vector`: More Problems, Better Solutions](http://www.gotw.ca/publications/N1211.pdf) -- ビット配列に関しては、[`bitset`](/reference/bitset/bitset.md)(ビットを格納する固定長コンテナ)も参照。 -- 可変長のビット配列の実装としては、Boost C++ Librariesの[`dynamic_bitset`](http://www.boost.org/doc/libs/release/libs/dynamic_bitset/dynamic_bitset.html)がある。 -- [N2669 Thread-Safety in the Standard Library (Rev 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2669.htm) - - +|-----------------------------|----------------------------|-------| +| [`vector`](vector/vector.md) | 可変長配列(class template) | | diff --git a/reference/vector/vector.md b/reference/vector/vector.md new file mode 100644 index 0000000000..6d81bbf6f7 --- /dev/null +++ b/reference/vector/vector.md @@ -0,0 +1,276 @@ +# vector +* vector[meta header] +* std[meta namespace] +* class template[meta id-type] + +```cpp +namespace std { + template > + class vector; +} +``` +* allocator[link /reference/memory/allocator.md] + +`vector`はシーケンスコンテナの一種で、各要素は線形に、順序を保ったまま格納される。 + +`vector`コンテナは可変長配列として実装される。通常の(`new []`で確保した)配列と同じように、`vector`の各要素は連続して配置されるため、イテレータだけでなく添字による要素のランダムアクセスも高速である。 + +配列と違い、ストレージは`vector`自体が管理するため、自動的に領域の拡張が行われる。 + + +`vector`は次の点で優れている。 + +- 各要素への添字アクセス(定数時間) +- 全要素の両方向の走査(線形時間) +- 末尾への要素の追加・削除(償却定数時間) + +これらの挙動は配列と同じパフォーマンス特性を示し、加えてストレージサイズの変更が非常に簡単である。ただし、`vector`は実際の要素数より少し余分にメモリを確保する(これは拡張に備え、パフォーマンス特性を満足するための仕様である)。 + +他の標準シーケンスコンテナと比べ、`vector`は要素アクセスと(末尾に対する)追加・削除において一般的に最高の性能を誇る。末尾以外に対する挿入・削除は[`deque`](/reference/deque/deque.md)や[`list`](/reference/list/list.md)に劣り、イテレータや要素への参照の安定性(無効になる操作の数)では[`list`](/reference/list/list.md)に劣る。 + +内部的には、`vector`は(他のすべてのコンテナと同じように)サイズ用のメンバ変数を持ち、格納されている要素数を管理している。しかし`vector`の場合は、さらに確保済みのメモリサイズを管理するキャパシティ用のメンバ変数を持ち、これは常に[`size()`](vector/size.md)と同じか大きい値となる。確保済みの領域の余計な部分は、要素数の増加に備えて確保しているものである。この動作のおかげで、要素を追加するたびにメモリを再確保する必要が無くなり、単に確保済みの領域を初期化するだけでよくなる(再確保は要素数の対数の頻度で発生する)。 + +領域の再確保が発生すると、全ての要素が新しい領域にコピーされるため非常にコストがかかる。このため、最終的な要素数が大きくなると解っている場合はあらかじめ[`reserve()`](vector/reserve.md)メンバ関数でキャパシティを増加させておくことが望ましい。 + + +各テンプレートパラメータの意味は次の通りである。 + +- `T`: 格納される要素の型 +- `Allocator`: メモリ確保に使用されるアロケータの型。デフォルトでは標準の[`allocator`](/reference/memory/allocator.md)クラスが使用される。 + +リファレンス中では、これらの名前をテンプレートパラメータとして扱う。 + + +## メンバ関数 +### 構築・破棄 + +| 名前 | 説明 | 対応バージョン | +|---------------------------------------|----------------|-------| +| [`(constructor)`](vector/op_constructor.md) | コンストラクタ | | +| [`(destructor)`](vector/op_destructor.md) | デストラクタ | | +| [`operator=`](vector/op_assign.md) | 代入演算子 | | + + +### イテレータ + +| 名前 | 説明 | 対応バージョン | +|----------------------------------|---------------------------------------|-------| +| [`begin`](vector/begin.md) | 先頭の要素を指すイテレータを取得する | | +| [`end`](vector/end.md) | 末尾の次を指すイテレータを取得する | | +| [`cbegin`](vector/cbegin.md) | 先頭の要素を指す読み取り専用イテレータを取得する | C++11 | +| [`cend`](vector/cend.md) | 末尾の次を指す読み取り専用イテレータを取得する | C++11 | +| [`rbegin`](vector/rbegin.md) | 末尾を指す逆イテレータを取得する | | +| [`rend`](vector/rend.md) | 先頭の前を指す逆イテレータを取得する | | +| [`crbegin`](vector/crbegin.md) | 末尾を指す読み取り専用逆イテレータを取得する | C++11 | +| [`crend`](vector/crend.md) | 先頭の前を指す読み取り専用逆イテレータを取得する | C++11 | + + +### 領域 + +| 名前 | 説明 | 対応バージョン | +|----------------------------------------------|------------------|-------| +| [`size`](vector/size.md) | 要素数を取得する | | +| [`max_size`](vector/max_size.md) | 格納可能な最大の要素数を取得する | | +| [`resize`](vector/resize.md) | 要素数を変更する | | +| [`capacity`](vector/capacity.md) | メモリを再確保せずに格納できる最大の要素数を取得する | | +| [`empty`](vector/empty.md) | コンテナが空かどうかを判定する | | +| [`reserve`](vector/reserve.md) | capacityを変更する | | +| [`shrink_to_fit`](vector/shrink_to_fit.md) | capacityをsizeまで縮小する | C++11 | + + +### 要素アクセス + +| 名前 | 説明 | 対応バージョン | +|-----------------------------------|---------------|-------| +| [`operator[]`](vector/op_at.md) | 要素アクセス | | +| [`at`](vector/at.md) | 要素アクセス | | +| [`data`](vector/data.md) | 配列の先頭へのポインタを取得する | C++11 | +| [`front`](vector/front.md) | 先頭要素への参照を取得する | | +| [`back`](vector/back.md) | 末尾要素への参照を取得する | | + + +### コンテナの変更 + +| 名前 | 説明 | 対応バージョン | +|--------------------------------------------|------------------|-------| +| [`assign`](vector/assign.md) | コンテナの再代入 | | +| [`push_back`](vector/push_back.md) | 末尾へ要素追加 | | +| [`emplace_back`](vector/emplace_back.md) | 末尾へ直接構築 | C++11 | +| [`pop_back`](vector/pop_back.md) | 末尾から要素削除 | | +| [`insert`](vector/insert.md) | 要素の挿入 | | +| [`emplace`](vector/emplace.md) | 要素の直接構築による挿入 | C++11 | +| [`erase`](vector/erase.md) | 要素の削除 | | +| [`swap`](vector/swap.md) | コンテナの交換 | | +| [`clear`](vector/clear.md) | 全要素削除 | | + + +### アロケータ + +| 名前 | 説明 | 対応バージョン | +|----------------------------------------------|------------------------------|-------| +| [`get_allocator`](vector/get_allocator.md) | アロケータオブジェクトの取得 | | + + +## メンバ型 + +| 名前 | 説明 | 対応バージョン | +|--------------------------|-----------------------------------------------------------------------|-------| +| `reference` | `T&` | | +| `const_reference` | `const T&` | | +| `iterator` | ランダムアクセスイテレータ | | +| `const_iterator` | 読み取り専用ランダムアクセスイテレータ | | +| `size_type` | 符号なし整数型 (通常は[`size_t`](/reference/cstddef/size_t.md)) | | +| `difference_type` | 符号付き整数型 (通常は[`ptrdiff_t`](/reference/cstddef/ptrdiff_t.md)) | | +| `value_type` | 要素型 `T` | | +| `allocator_type` | アロケータの型 `Allocator` | | +| `pointer` | `Allocator::pointer` | | +| `const_pointer` | `Allocator::const_pointer` | | +| `reverse_iterator` | [`reverse_iterator`](/reference/iterator/reverse_iterator.md)`` | | +| `const_reverse_iterator` | [`reverse_iterator`](/reference/iterator/reverse_iterator.md)`` | | + + +## 非メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|----------------------------------------------|------------------------------------|-------| +| [`operator==`](vector/op_equal.md) | 等値比較 | | +| [`operator!=`](vector/op_not_equal.md) | 非等値比較 | | +| [`operator<`](vector/op_less.md) | 左辺が右辺より小さいかの判定を行う | | +| [`operator<=`](vector/op_less_equal.md) | 左辺が右辺以下かの判定を行う | | +| [`operator>`](vector/op_greater.md) | 左辺が右辺より大きいかの判定を行う | | +| [`operator>=`](vector/op_greater_equal.md) | 左辺が右辺以上かの判定を行う | | +| [`swap`](vector/swap_free.md) | 2つの`vector`オブジェクトを入れ替える | | + + +## 推論補助 + +| 名前 | 説明 | 対応バージョン | +|---------------------------------------------|------------------------------------|-------| +| [`(deduction_guide)`](vector/op_deduction_guide.md) | クラステンプレートの推論補助 | C++17 | + + +## 例 (C++11) +```cpp example +#include +#include +#include + +int main() +{ + // int型を要素とする可変長配列の変数を定義し、 + // 初期状態の要素を設定 + std::vector v = {1, 99, 4}; + + v[1] = 3; // 1番目の要素を参照し、書き換える + v.push_back(5); // 末尾に値5を追加 + v.insert(v.begin() + 1, 2); // 1番目に値2を挿入 + + int* p = v.data(); // 内部表現のポインタを取得 + std::size_t size = v.size(); // 要素数を取得 + assert(p[0] == 1); + assert(size == 5u); + + // 各要素に対して操作を行う + for (int x : v) { + std::cout << x << std::endl; + } +} +``` +* v[1][link vector/op_at.md] +* v.push_back[link vector/push_back.md] +* v.insert[link vector/insert.md] +* v.data()[link vector/data.md] +* for[link /lang/cpp11/range_based_for.md] + +### 出力 +``` +1 +2 +3 +4 +5 +``` + + +## `vector`特殊化 +`vector`は`bool`型に対して特殊化されている。 + +この特殊化はメモリ領域を最小化するために提供されていて、各要素は1bitの領域のみを必要とする。 + +`vector::reference`は`bool`への参照ではなく、領域内の1bitを指す型であり、以下のようなインタフェースである。 + +```cpp +class vector::reference { + friend class vector; + reference(); // コンストラクタは非公開 +public: + ~reference(); + operator bool() const; // boolへの暗黙変換 + reference& operator=(const bool x); // boolからの代入 + reference& operator=(const reference& x); // vectorのビットからの代入 + void flip(); // ビットの反転 +} +``` + +### ハッシュサポート + +| 名前 | 説明 | 対応バージョン | +|--------------------------------------------------------------------|------------------------------------------|-------| +| `template struct hash;` | `hash`クラスの先行宣言 | C++11 | +| `template struct hash>;` | `hash`クラスの`vector`に対する特殊化 | C++11 | + + +### `vector`の基本操作: +```cpp example +#include +#include +#include + +int main() +{ + std::vector v(8, false); + v[5] = true; // ビットを立てる + v[7].flip(); // ビット反転(1だったら0、0だったら1にする) + +//bool& x = v[3]; // エラー!プロキシオブジェクトのため、bool&には変換できない + bool x = v[3]; // OK : コピーはできる + std::cout << "v[3] : " << x << std::endl; + + // イテレータ操作は可能 + std::for_each(v.begin(), v.end(), [](bool x) { + std::cout << x << std::endl; + }); +} +``` +* v[5][link vector/op_at.md] +* v[7][link vector/op_at.md] +* v[3][link vector/op_at.md] + +### 出力 +``` +v[3] : 0 +0 +0 +0 +0 +0 +1 +0 +1 +``` + +`vector`の要素は参照するとプロキシオブジェクトのコピーが返ってくるため、RandomAccessIteratorの要件を満たさない。 + + +## 参照 +- `vector`のメモリ効率について + - [2倍だけじゃない - Derive Your Dreams](http://www.kmonos.net/wlog/111.html#_2334100705) + - [それでも2倍だ - Derive Your Dreams](http://www.kmonos.net/wlog/111.html#_1001100720) +- [LWG Issue 69. Must elements of a `vector` be contiguous?](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#69) + - C++03から、`vector`の要素のメモリが連続していることが保証された。 +- [N1211 - `vector`: More Problems, Better Solutions](http://www.gotw.ca/publications/N1211.pdf) +- ビット配列に関しては、[`bitset`](/reference/bitset/bitset.md)(ビットを格納する固定長コンテナ)も参照。 +- 可変長のビット配列の実装としては、Boost C++ Librariesの[`dynamic_bitset`](http://www.boost.org/doc/libs/release/libs/dynamic_bitset/dynamic_bitset.html)がある。 +- [N2669 Thread-Safety in the Standard Library (Rev 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2669.htm) + + diff --git a/reference/vector/assign.md b/reference/vector/vector/assign.md similarity index 100% rename from reference/vector/assign.md rename to reference/vector/vector/assign.md diff --git a/reference/vector/at.md b/reference/vector/vector/at.md similarity index 100% rename from reference/vector/at.md rename to reference/vector/vector/at.md diff --git a/reference/vector/back.md b/reference/vector/vector/back.md similarity index 100% rename from reference/vector/back.md rename to reference/vector/vector/back.md diff --git a/reference/vector/begin.md b/reference/vector/vector/begin.md similarity index 100% rename from reference/vector/begin.md rename to reference/vector/vector/begin.md diff --git a/reference/vector/capacity.md b/reference/vector/vector/capacity.md similarity index 100% rename from reference/vector/capacity.md rename to reference/vector/vector/capacity.md diff --git a/reference/vector/cbegin.md b/reference/vector/vector/cbegin.md similarity index 100% rename from reference/vector/cbegin.md rename to reference/vector/vector/cbegin.md diff --git a/reference/vector/cend.md b/reference/vector/vector/cend.md similarity index 100% rename from reference/vector/cend.md rename to reference/vector/vector/cend.md diff --git a/reference/vector/clear.md b/reference/vector/vector/clear.md similarity index 100% rename from reference/vector/clear.md rename to reference/vector/vector/clear.md diff --git a/reference/vector/crbegin.md b/reference/vector/vector/crbegin.md similarity index 100% rename from reference/vector/crbegin.md rename to reference/vector/vector/crbegin.md diff --git a/reference/vector/crend.md b/reference/vector/vector/crend.md similarity index 100% rename from reference/vector/crend.md rename to reference/vector/vector/crend.md diff --git a/reference/vector/data.md b/reference/vector/vector/data.md similarity index 100% rename from reference/vector/data.md rename to reference/vector/vector/data.md diff --git a/reference/vector/emplace.md b/reference/vector/vector/emplace.md similarity index 98% rename from reference/vector/emplace.md rename to reference/vector/vector/emplace.md index 85b90744d8..5a031b7eac 100644 --- a/reference/vector/emplace.md +++ b/reference/vector/vector/emplace.md @@ -82,5 +82,5 @@ int main() - [N2345 Placement Insert for Containers (Revision 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2345.pdf) - [LWG Issue 2187. `vector` is missing emplace and `emplace_back` member functions](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2187) - [LWG Issue 2252. Strong guarantee on `vector::push_back()` still broken with C++11?](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2252) - - 経緯の説明は、[`vector::push_back()`](/reference/vector/push_back.md)ページを参照。 + - 経緯の説明は、[`vector::push_back()`](/reference/vector/vector/push_back.md)ページを参照。 diff --git a/reference/vector/emplace_back.md b/reference/vector/vector/emplace_back.md similarity index 98% rename from reference/vector/emplace_back.md rename to reference/vector/vector/emplace_back.md index e5e268ba79..51eb1229ad 100644 --- a/reference/vector/emplace_back.md +++ b/reference/vector/vector/emplace_back.md @@ -87,7 +87,7 @@ int main() - [N2680 Proposed Wording for Placement Insert (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2680.pdf) - [LWG Issue 2187. `vector` is missing emplace and `emplace_back` member functions](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2187) - [LWG Issue 2252. Strong guarantee on `vector::push_back()` still broken with C++11?](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2252) - - 経緯の説明は、[`vector::push_back()`](/reference/vector/push_back.md)ページを参照。 + - 経緯の説明は、[`vector::push_back()`](/reference/vector/vector/push_back.md)ページを参照。 - [P0084R0 Emplace Return Type](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0084r0.pdf) - [P0084R1 Emplace Return Type (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0084r1.pdf) - [P0084R2 Emplace Return Type (Revision 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0084r2.pdf) diff --git a/reference/vector/empty.md b/reference/vector/vector/empty.md similarity index 100% rename from reference/vector/empty.md rename to reference/vector/vector/empty.md diff --git a/reference/vector/end.md b/reference/vector/vector/end.md similarity index 100% rename from reference/vector/end.md rename to reference/vector/vector/end.md diff --git a/reference/vector/erase.md b/reference/vector/vector/erase.md similarity index 100% rename from reference/vector/erase.md rename to reference/vector/vector/erase.md diff --git a/reference/vector/front.md b/reference/vector/vector/front.md similarity index 100% rename from reference/vector/front.md rename to reference/vector/vector/front.md diff --git a/reference/vector/get_allocator.md b/reference/vector/vector/get_allocator.md similarity index 100% rename from reference/vector/get_allocator.md rename to reference/vector/vector/get_allocator.md diff --git a/reference/vector/insert.md b/reference/vector/vector/insert.md similarity index 99% rename from reference/vector/insert.md rename to reference/vector/vector/insert.md index 8ac977d753..e44eac4138 100644 --- a/reference/vector/insert.md +++ b/reference/vector/vector/insert.md @@ -131,5 +131,5 @@ ccc - [N2679 Initializer Lists for Standard Containers(Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2679.pdf) - (5)の経緯となる提案文書 - [LWG Issue 2252. Strong guarantee on `vector::push_back()` still broken with C++11?](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2252) - - 経緯の説明は、[`vector::push_back()`](/reference/vector/push_back.md)ページを参照。 + - 経緯の説明は、[`vector::push_back()`](/reference/vector/vector/push_back.md)ページを参照。 diff --git a/reference/vector/max_size.md b/reference/vector/vector/max_size.md similarity index 100% rename from reference/vector/max_size.md rename to reference/vector/vector/max_size.md diff --git a/reference/vector/op_assign.md b/reference/vector/vector/op_assign.md similarity index 100% rename from reference/vector/op_assign.md rename to reference/vector/vector/op_assign.md diff --git a/reference/vector/op_at.md b/reference/vector/vector/op_at.md similarity index 100% rename from reference/vector/op_at.md rename to reference/vector/vector/op_at.md diff --git a/reference/vector/op_constructor.md b/reference/vector/vector/op_constructor.md similarity index 100% rename from reference/vector/op_constructor.md rename to reference/vector/vector/op_constructor.md diff --git a/reference/vector/op_deduction_guide.md b/reference/vector/vector/op_deduction_guide.md similarity index 100% rename from reference/vector/op_deduction_guide.md rename to reference/vector/vector/op_deduction_guide.md diff --git a/reference/vector/op_destructor.md b/reference/vector/vector/op_destructor.md similarity index 100% rename from reference/vector/op_destructor.md rename to reference/vector/vector/op_destructor.md diff --git a/reference/vector/op_equal.md b/reference/vector/vector/op_equal.md similarity index 100% rename from reference/vector/op_equal.md rename to reference/vector/vector/op_equal.md diff --git a/reference/vector/op_greater.md b/reference/vector/vector/op_greater.md similarity index 100% rename from reference/vector/op_greater.md rename to reference/vector/vector/op_greater.md diff --git a/reference/vector/op_greater_equal.md b/reference/vector/vector/op_greater_equal.md similarity index 100% rename from reference/vector/op_greater_equal.md rename to reference/vector/vector/op_greater_equal.md diff --git a/reference/vector/op_less.md b/reference/vector/vector/op_less.md similarity index 92% rename from reference/vector/op_less.md rename to reference/vector/vector/op_less.md index be3a26035e..73dbf320e0 100644 --- a/reference/vector/op_less.md +++ b/reference/vector/vector/op_less.md @@ -19,7 +19,7 @@ namespace std { ## 戻り値 -[`lexicographical_compare`](/reference/algorithm/lexicographical_compare.md)`(x.`[`begin`](begin.md)`(), x.`[`end`](end.md)`(), y.`[`begin`](begin.md)`(), y.`[`end`](/reference/vector/end.md)`());` +[`lexicographical_compare`](/reference/algorithm/lexicographical_compare.md)`(x.`[`begin`](begin.md)`(), x.`[`end`](end.md)`(), y.`[`begin`](begin.md)`(), y.`[`end`](end.md)`());` ## 計算量 diff --git a/reference/vector/op_less_equal.md b/reference/vector/vector/op_less_equal.md similarity index 100% rename from reference/vector/op_less_equal.md rename to reference/vector/vector/op_less_equal.md diff --git a/reference/vector/op_not_equal.md b/reference/vector/vector/op_not_equal.md similarity index 100% rename from reference/vector/op_not_equal.md rename to reference/vector/vector/op_not_equal.md diff --git a/reference/vector/pop_back.md b/reference/vector/vector/pop_back.md similarity index 100% rename from reference/vector/pop_back.md rename to reference/vector/vector/pop_back.md diff --git a/reference/vector/push_back.md b/reference/vector/vector/push_back.md similarity index 100% rename from reference/vector/push_back.md rename to reference/vector/vector/push_back.md diff --git a/reference/vector/rbegin.md b/reference/vector/vector/rbegin.md similarity index 100% rename from reference/vector/rbegin.md rename to reference/vector/vector/rbegin.md diff --git a/reference/vector/rend.md b/reference/vector/vector/rend.md similarity index 100% rename from reference/vector/rend.md rename to reference/vector/vector/rend.md diff --git a/reference/vector/reserve.md b/reference/vector/vector/reserve.md similarity index 100% rename from reference/vector/reserve.md rename to reference/vector/vector/reserve.md diff --git a/reference/vector/resize.md b/reference/vector/vector/resize.md similarity index 100% rename from reference/vector/resize.md rename to reference/vector/vector/resize.md diff --git a/reference/vector/shrink_to_fit.md b/reference/vector/vector/shrink_to_fit.md similarity index 100% rename from reference/vector/shrink_to_fit.md rename to reference/vector/vector/shrink_to_fit.md diff --git a/reference/vector/size.md b/reference/vector/vector/size.md similarity index 100% rename from reference/vector/size.md rename to reference/vector/vector/size.md diff --git a/reference/vector/swap.md b/reference/vector/vector/swap.md similarity index 100% rename from reference/vector/swap.md rename to reference/vector/vector/swap.md diff --git a/reference/vector/swap_free.md b/reference/vector/vector/swap_free.md similarity index 100% rename from reference/vector/swap_free.md rename to reference/vector/vector/swap_free.md