C++ friends in template classes, separation of interface and implementation

<>

This question already has an answer here:

Answers


Just provide the definitions of the template functions in the .hpp files. I believe the following should work:

template <class T> class Class {
    SubClass member;
public:
    class SubClass {
        public:

        friend std::ostream& operator<<(std::ostream& Stream, const Class<T>& Op) {
            return Stream;
        }
    };
}

Need Your Help