Created
March 31, 2019 15:39
-
-
Save catupper/772f2055b4ee0615ab2c993fedd55179 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
#include<vector> | |
using namespace std; | |
//1 | |
#define view_vector1(vec) for(auto v:vec)cout << vec << " ";cout << endl; | |
//2 | |
template<typename T> | |
ostream& operator<<(ostream& stream, vector<T>& vec){ | |
for(T v:vec)stream << v << " "; | |
return stream; | |
} | |
int main(){ | |
vector<int> hoge = {3, 1, 4, 1, 5, 9, 2}; | |
view_vector1(hoge); | |
cout << hoge << endl; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment