c++向量类问题错误求解答啊 10
#include#includeusingnamespacestd;classVector3{public:floatx,y,z;//构造函数//默认构造函数,不执行任何...
#include#includeusing namespace std;class Vector3{ public: float x,y,z; // 构造函数 // 默认构造函数,不执行任何操作 Vector3() {} // 复制构造函数 Vector3(const Vector3 &a) : x(a.x), y(a.y), z(a.z) {} // 带三个参数的构造函数,三个值完成初始化 Vector3(float nx, float ny, float nz) : x(nx), y(ny), z(nz) {} // 重载比较运算符 bool operator==(const Vector3 &a) const { return x==a.x&& y==a.y&&z==a.z; } bool operator !=(const Vector3 &a) const { return x!=a.x||y!=a.y||z!=a.z; }
发不出来 呜呜 问题是
:\vc2005\main\vc\include\xutility(572) : error C2039: 'iterator_category' : is not a member of 'Vector3'
1> d:\documents\visual studio 2005\projects\3d\3d\1.cpp(5) : see declaration of 'Vector3'
1> d:\documents\visual studio 2005\projects\3d\3d\1.cpp(154) : see reference to class template instantiation 'std::iterator_traits<_Iter>' being compiled
1> with 展开
发不出来 呜呜 问题是
:\vc2005\main\vc\include\xutility(572) : error C2039: 'iterator_category' : is not a member of 'Vector3'
1> d:\documents\visual studio 2005\projects\3d\3d\1.cpp(5) : see declaration of 'Vector3'
1> d:\documents\visual studio 2005\projects\3d\3d\1.cpp(154) : see reference to class template instantiation 'std::iterator_traits<_Iter>' being compiled
1> with 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询