FAQ 19.12 Should friend functions be declared in the private:, protected:, or public: section of a class?For documentation purposes, they should be declared in the public: section of a class. The compiler ignores the access level (private:, protected:, or public:) where friend functions are declared. However, for documentation purposes, they should normally be declared in the public: part of the class since friend functions are inherently public: (most friend functions are non-member functions and are therefore conceptually declared outside the class). For an exception to this guideline, see FAQ 19.08. |