<分区>
我真的不明白为什么要这段代码
#include <map>
template<typename T, typename U> std::ostream& operator<<(std::ostream& o,
const std::map<T,U>& input)
{
for (std::map<typename T,typename U>::iterator it=input.begin(); it!=input.end(); ++it)
{
o << it->first << " => " << it->second << '\n';
}
return o;
}
返回此编译错误:
error: wrong number of template arguments (1, should be 4)
error: provided for ‘template<class _Key, class _Tp, class _Compare, class _Alloc> class std::map’
谁能帮帮我??