无涯教程-C++ 向量 - shrink_to_fit()函数

91 阅读1分钟

此函数用于更改向量的容量,并使其等于向量的大小。

shrink_to_fit - 语法

v.shrink_to_fit();

shrink_to_fit - 返回值

它不返回任何值。

参考链接

www.learnfk.com/c++/cpp-vec…