Skip to content

Instantly share code, notes, and snippets.

@yifu
Created September 21, 2012 15:02
Show Gist options
  • Select an option

  • Save yifu/3762006 to your computer and use it in GitHub Desktop.

Select an option

Save yifu/3762006 to your computer and use it in GitHub Desktop.
#include <iostream>
#include <iterator>
#include <vector>
int main()
{
std::vector<int> vec;
vec.push_back(1);
vec.push_back(2);
vec.push_back(3);
vec.push_back(4);
std::vector<int> empty;
vec.insert(vec.begin(), empty.begin(), empty.end());
std::copy(vec.begin(), vec.end(), std::ostream_iterator<int>(std::cout, " "));
std::cout << std::endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment