Skip to content

Instantly share code, notes, and snippets.

@cengiz-io
Created January 16, 2015 18:37
Show Gist options
  • Save cengiz-io/7a1fa51a0fdc4346211b to your computer and use it in GitHub Desktop.
Save cengiz-io/7a1fa51a0fdc4346211b to your computer and use it in GitHub Desktop.
#include <iostream>
#include <string>
#include <vector>
template<typename T>
std::ostream& operator<<(std::ostream& os, const std::vector<T>& vec)
{
for (auto& el : vec)
{
os << el << ' ';
}
return os;
}
int main()
{
std::vector<std::string> words = {
"Hello", "from", "GCC", __VERSION__, "!"
};
std::cout << words << std::endl;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment