Ada*_*gin 1 c++ iterator stl map
这是我的功能:
friend std::ostream& operator<< (std::ostream& stream, const Path& path) {
std::map<double, glm::vec3>::iterator iter;
for (iter = path.points.begin(); iter != path.points.end(); iter++){
stream << "test" << "\n";
}
}
Run Code Online (Sandbox Code Playgroud)
这是我的错误:
Error 1 error C2679: binary '=' : no operator found which takes a right-hand operand of type 'std::_Tree_const_iterator<std::_Tree_val<std::_Tree_simple_types<std::pair<const _Kty,_Ty>>>>' (or there is no acceptable conversion) c:\users\adam\skydrive\documents\proj\ray\ray\path.h 22 1 ray
Run Code Online (Sandbox Code Playgroud)
我以前从未遇到过这种问题.说实话,我不知道从哪里开始.我尝试了一些获取迭代器的方法,包括typedef方法,但同样的问题仍然存在.
有什么建议?