Answers for "back_inserter vs push_back"

C++
0

back_inserter vs push_back

std::vector<std::string> a(100, "Hello, World");
std::vector<std::string> b;
std::copy(a.begin(), a.end(), std::back_inserter(b));
Posted by: Guest on September-21-2020

Browse Popular Code Answers by Language