【C++】template 統合スレ -- Part3
■ このスレッドは過去ログ倉庫に格納されています
0070デフォルトの名無しさん
NGNGstd::ostream& operator<<(std::ostream& os, const Pairs& p)
{
os << p.first << ' ' << p.second;
return os;
}
std::copy(pairs.begin(), pairs.end(), std::ostream_iterator<Pairs>(std::cout, "\n"));
このコードBCCでは通るけど、VC7.1、gcc3.1.1(MinGW)では通らねーな。
std::coutなどに<<を食わせるのと、std::ostream_iteratorに食わせるのでは
何が違うのかな。
■ このスレッドは過去ログ倉庫に格納されています