I have this member function
std::ostream& operator<<(std::ostream &stream) const
in Histogram<T>.
then in another class I have
static void write(const RGBHistogram<T> &hist, Output &output)
{
std::cout << hist.redHist << std::endl;
}
redHist, greenHist and blueHist are Histogram.
Why it complains that no operator found which takes a right-hand operand of type Histogram?
You should pass referece of you class and it should be friend not member function.