i'm stuck with a little problem: i have a unordered_set which contain a struct. I have already implemented the hash function. But when i have first compiled my program, i 'v got some compiler error saying that i haven't implemented a overloaded "operator==".
The problem is that when i declare my overloaded:
bool operator==(mapPoint const& p1, mapPoint const& p2){
return p1.x == p2.x && p1.y == p2.y;
}
I've got some linker error. In every file where the header is included, i've got the error message (uplicate symbol __XXXX_mapPointS1_).
The fact is it works fine when it's put into the implementation file, where i use it with the unordered_set.
My question is, how can i resolve this problem? There are so much magic beyond the compiler than i can't understand it. hanks