测试两个std::pair
BOOST_CHECK_EQUAL(std::make_pair(0.0,0.0), std::make_pair(1.0,1.0));
我重载了operator<<
forstd::pair
std::ostream& operator<< (std::ostream& os, const std::pair<double,double>& t)
{
return os << "( " << t.first << ", " << t.second << ")";
}
出现以下错误
error C2679: binary '<<' : no operator found which takes a right-hand operand of type 'const std::pair<_Ty1,_Ty2>' (or there is no acceptable conversion)
怎么了?