, , vector<pair<T,T>> vector<array<T,2>>. push_back, . boost::multi_array overkill, otoh:
- push_back , , N - , N-1 . , . . resize .
// std::vector<> equivalent (with vector<>, it considered bad style)
v.resize( v.size() + 1 );
v[v.size()-1] = newElement;
// boost::multi_array (from the tutorial)
typedef boost::multi_array<int, 3> array_type;
array_type::extent_gen extents;
array_type A(extents[3][3][3]);
A[0][0][0] = 4;
A[2][2][2] = 5;
// here, it the only way:
A.resize(extents[2][3][4]);
assert(A[0][0][0] == 4);
// A[2][2][2] is no longer valid.
: N - , N>2, , (- ). , , size()>capacity().