header

c++ implementing friend/inline functions

瘦欲@ 提交于 2020-12-08 05:57:08
问题 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