Sign in to follow this  
kbundy023

C++ vector problem

Recommended Posts

kbundy023    122
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

Share this post


Link to post
Share on other sites
_goat    804
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this