Ok so I have scoured the deepest recesses of the internet to find an example of how to define the implementation of a member function that is overloading an operator for a class that is with in a namespace.
interface looks like this
namespace A
{
class dog
{
public:
dog();
bool operator == ( const dog & other ) const;
};
private:
float hieght;
float weight;
}
If I define the implementation with in the header it would look like this which works. but i want it in the Cpp file
namespace A
{
class dog
{
public:
dog();
bool operator == ( const dog & other ) const
{
return weight == other.weight && hieght == other.hieght;
}
};
private:
float hieght;
float weight;
}
If I wanted to separate the implementation from the header to the cpp file how would I write the implementation of this overloaded function?
just to show how i am writing the other member function's emplimetation in the cpp file here is an example.
bool A::dog::bark() {}
Thanks