std::vector(对于bool以外的T)满足容器(Container)、知分配器容器(AllocatorAwareContainer)、序列容器(SequenceContainer)、连续容器(ContiguousContainer)(C++17 起)及可逆容器(ReversibleContainer)的要求。 std::vector的全部成员函数均为constexpr:在常量表达式求值中创建并使用std::vector对象是可能的。
>classvector; (1) namespace { template<classT> usingvector=std::vector<T,std::pmr::polymorphic_allocator<T>>; } (2) (since C++17) 1)std::vectoris a sequence container that encapsulates dynamic size arrays. 2)std::pmr::vectoris an alias template that uses apolymorphic allocator. ...
std::vector<bool> C++ 容器库 std::vector<bool> 在标头<vector>定义 template< classAllocator >classvector<bool, Allocator>; std::vector<bool>是std::vector对类型bool为空间提效的特化。 std::vector<bool>中对空间提效的行为(以及它是否有优化)是实现定义的。一种潜在优化涉及到 vector 的元素联合,使得...
constexpr std::vector<T, Alloc>::size_type erase_if( std::vector<T, Alloc>& c, Pred pred ); (2) (since C++20) 1) Erases all elements that compare equal to value from the container. Equivalent to auto it = std::remove(c.begin(), c.end(), value); auto r = c.end() ...
std::inplace_vectoriterator invalidation guarantees differ fromstd::vector: moving aninplace_vectorinvalidates all iterators; swapping twoinplace_vectors invalidates all iterators (during swap, the iterator will continue to point to the same array element, and may thus change its value). ...
inplace_vector(C++26) hive(C++26) map−multimap−set−multiset unordered_map(C++11) unordered_multimap(C++11) unordered_set(C++11) unordered_multiset(C++11) Container adaptors span(C++20)−mdspan(C++23) Iterators library Ranges library(C++20) ...
basic_string_view (C++17) Chaînes terminées par null: byte − multibyte − wide Conteneurs array (C++11) − vector map − unordered_map (C++11) priority_queue − span (C++20) Autres conteneurs: sequence − associative unordered associative − adaptors Itérate...
array(C++11)−vector map−unordered_map(C++11) priority_queue−span(C++20) その他のコンテナ: シーケンス−連想 非順序連想−アダプタ イテレータライブラリ 範囲ライブラリ(C++20) アルゴリズムライブラリ 数値演算ライブラリ ...
array(C++11)−vector −deque list−forward_list(C++11) map−multimap set−multiset unordered_map(C++11) unordered_multimap(C++11) unordered_set(C++11) unordered_multiset(C++11) stack−queue−priority_queue span(C++20) Biblioteca de iteradores ...
编译(compilation):对 .i 文件进行编译,生成 .s 汇编文件。 汇编(assembly):对 .s 文件进...