有下面两个C++结构:
struct Vertex3D{
GLfloat x;
GLfloat y;
GLfloat z;
Vertex3D(GLfloat a, GLfloat b, GLfloat c){
x = a;
y = b;
z = c;
}
};
struct Triangle3D{
Vertex3D v1;
Vertex3D v2;
Vertex3D v3;
Triangle3D(Vertex3D vt1, Vertex3D vt2, Vertex3D vt3){
};
};
Vertex3D
的构造函数正常,Triangle3D
的构造出现警告:“Constructor for 'Triangle3D'' must explicitly initialise member 'v2' which does not have default constructor”
但是我已经为Vertex3D
类型结构创建了一构造函数,为什么还会出现这类错误呢?应该怎么解决?谢谢