I have a class called Point
and an other namespace containing a tree class.
this tree is a balanced binary search tree, and uses the function compare
to compare its keys and puts them in the right place. My tree contains Point
s, and for each point I have to know which tree it belongs to, so I tried to add a pointer to the tree in my Point
class like this:
class Point{
public:
double x, y;
std::set<std::multiset<Point,Tree::compare()>*>s; //Tree is the name of the namespace
// some other data
}
My problem is that since my tree uses Point.h
(because it stores Point
s) I cant add LayerThree.h
to my it so I cant use Tree::compare()
in my Point.h
. I tried to add a new file like cmp.h
and put my compare function in it, But It did not help. What should I do?
EDIT: I can not put both my tree and my Point
class together in the same file because there are other files that needs to include Point.h