↑: [[zk/core/c++]]
- 以下のように定義することで`std::cout << a;`のような形で対応できます。
- 以下の定義の場合出力は`{1,2}`のような出力になります。
```c++
// header
std::ostream& operator<<(std::ostream& os,const vect2& obj);
// impl
std::ostream& operator<<(std::ostream& os,const vect2& obj){
os << "{" << obj[0] << ", " << obj[1] << "}";
return os;
}
```