std::vector<int> v{2,4,6,8,10,12,14,16,18,20};
// print the numbers
std::copy(v.cbegin(), v.cend(), std::ostream_iterator<int>(std::cout, " "));
std::cout << '\n';
here std::copy is used to write to std out. Is this faster than using std::cout for the vector elements in a for loop like
for(auto element: v) std::cout << element << " ";
I could't find much information about how they would write to output buffers for both.