push_back
来自cppreference.com
Syntax:
#include <vector> void push_back( const T& val );
push_back() 函数追加成员到vector的结尾。 举个例子,下面的代码会把10个整数加进vector:
vector<int> the_vector; for( int i = 0; i < 10; i++ ) { the_vector.push_back( i ); }
显示出来,结果会是这样:
0 1 2 3 4 5 6 7 8 9
调用push_back()的最佳时机是在 constant time。