1、emplace
1)emplace (pos, args):在某个迭代器位置插入(构建)一个新对象
std::vector<int> myvector = {10,20,30};
// -> 10,100,20,30
auto it = myvector.emplace ( myvector.begin()+1, 100 );
// 10 200 100 20 30
myvector.emplace ( it, 200 );
// -> // 10 200 100 20 30 300
myvector.emplace ( myvector.end(), 300 );
2、emplace_back
1)emplace_back(args):在数组末尾插入(构建)一个新对象
std::vector<int> myvector = {10,20,30};
myvector.emplace_back (100);
myvector.emplace_back (200);
// 10 20 30 100 200
标签:10,myvector,emplace,30,vector,20,100 From: https://www.cnblogs.com/wllwqdeai/p/17241951.html