Original Post
I am getting an error when I try to define an == function.
Are you even alowed to do this in a Header file?
'bool operator==(Position&)' must take exactly two arguments
||=== Build finished: 1 errors, 0 warnings ===|
#ifndef POSITION_H_INCLUDED
#define POSITION_H_INCLUDED
struct Position{
float Xpos;
float Ypos;
};
bool operator==(Position& other) {
return (Xpos == other.Xpos && Ypos == other.Ypos);
}
#endif // POSITION_H_INCLUDED
Are you even alowed to do this in a Header file?
'bool operator==(Position&)' must take exactly two arguments
||=== Build finished: 1 errors, 0 warnings ===|
#ifndef POSITION_H_INCLUDED
#define POSITION_H_INCLUDED
struct Position{
float Xpos;
float Ypos;
};
bool operator==(Position& other) {
return (Xpos == other.Xpos && Ypos == other.Ypos);
}
#endif // POSITION_H_INCLUDED