I can't seem to find the answer to this newbie question. If I have a class // Header file (.h)
Class X {
public:
friend bool operator==(const X&, const X&);
inline size_type rows() const;
};
etc... when I go to implement the .cpp file of X, should I include the words inline & friend in the function names in the .cpp file. ie, should I implement my file similar to the below
// CPP file (.cpp)
#include "X.h"
friend bool operator==(const X&, const X&) {
//implementation goes here
//return true/false
}
inline size_type rows() const {
return r;
}
or should I not include these i.e. like below
#include "X.h"
bool operator==(const X&, const X&) { ... }
size_type rows() const { ... }