> > std::ostream &operator<<(std::ostream &lhs, const std::vector &rhs) > > { > > for (int i = 0; i < rhs.size(); i++) > > lhs << "vector[" << i << "]" << rhs[i] << std::endl; > > return rhs; > > } > > を用意しておけば > > std::cout << vector << std::endl; > > のように書ける > つか彼は標準出力を簡単に書きたいだけでしょ?(;´Д`) C++のストリームの記法は変態的なので今すぐ消えればいい(;´Д`) 参考:2007/10/07(日)00時20分31秒