C++ 命名要求: ContiguousContainer (自 C++17 起)
一个 ContiguousContainer 是一个在连续内存位置存储对象的 Container。
要求
如果满足以下条件,类型 X 满足 ContiguousContainer:
- 类型 X 满足 Container
- 类型 X 支持 LegacyRandomAccessIterators
- 成员类型
X::iterator
和X::const_iterator
是 LegacyContiguousIterators (直到 C++20) contiguous_iterators (自 C++20 起)
标准库中的连续容器
公共 | basic_string | 存储和操作字符序列 |
公共 | array(C++11) | 静态连续数组 |
公共 | 向量 | 动态连续数组 |