C++ vector problem
Hello
I have a header file with the code like this with name maths.h:
class Polygon {
public:
vector<Point3> vecs;
Polygon () { };
void insert(Point3 point);
void remove();
Point3 fetch(int index);
Vector3 normalized();
int classifyPoint(Point3& point);
bool InFront(Polygon& poly);
};
I have a code file
class BSPTreeNode
{
public:
vector<Polygon> PolygonSet;
BSPTreeNode* RightNode;
BSPTreeNode* LeftNode;
//void insert(vector polygons, Polygon divider);
};
The problem here when I compile it, I received an error saying :
Error 1 error C2923: 'std::vector' : 'Polygon' is not a valid template type argument for parameter '_Ty'
What does that mean? In my maths.h, I have a class say Point3 or Vector3. When I replace the <Polygon> with <Vector3> or <Point3>, the program can compile without error.
Do anyone know what the problem is? Thank you
There is something int windows.h that is called Polygon, which you cannot use as a template parameter. I don't know what exactly it is though. Rename your polygon class.
Quote:Original post by Brother Bob
There is something int windows.h that is called Polygon, which you cannot use as a template parameter. I don't know what exactly it is though. Rename your polygon class.
@OP: Or put yours in a namespace, although with the lack of "std::" in your header file (read: bad practice), you may not understand/like this idea.
Quote:
There is something int windows.h that is called Polygon, which you cannot use as a template parameter. I don't know what exactly it is though. Rename your polygon class.
The GDI Polygon() function.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement