std :: vector< T> :: pop_back的形式规范
我在C ++标准(草案n3797),我找不到任何文档 pop_back
,因为它适用于 std :: vector
,仅用于 std :: list
。是真的丢了吗?
I'm looking in the C++ Standard (draft n3797), and I can't find any documentation of pop_back
as it applies to std::vector
, only for std::list
. Is it really missing?
特别是我在寻找保证 pop_back
不会改变容量。还是有这样的保证吗? (我期望迭代器和对其他元素的引用将保持有效,但我不能找到那个保证,它不会限制删除最后一个元素的情况)
Specifically I was looking for the guarantee that pop_back
doesn't change the capacity. Or is there such a guarantee at all? (I expect that iterators and references to other elements will remain valid, but I can't find that guarantee, and it wouldn't restrict the case of removing the last element, anyway)
不错过。在101§23.2.3的表格中,您可以看到向量
存在 pop_back
。
No it doesn't missed. In a table in 101 §23.2.3, you can see pop_back
exists for vector
.
16 表101列出了为某些类型的序列容器而不是其他序列容器提供的操作。实施应为容器列中显示的所有容器类型提供这些操作,并以执行摊销的常量时间。
16 Table 101 lists operations that are provided for some types of sequence containers but not others. An implementation shall provide these operations for all container types shown in the "container" column, and shall implement them so as to take amortized constant time.
>
第16段提到他们应该实施摊还的固定时间。
Paragraph 16 mentioned they should implement to take amortized constant time.