friend declaration declares a non-template function [duplicate]
问题 This question already has an answer here: overloading friend operator<< for template class 5 answers I have a base Class akin to the code below. I'm attempting to overload << to use with cout. However, g++ is saying: base.h:24: warning: friend declaration ‘std::ostream& operator<<(std::ostream&, Base<T>*)’ declares a non-template function base.h:24: warning: (if this is not what you intended, make sure the function template has already been declared and add <> after the function name here)