c++ Error : non-member function cannot have cv-qualifier

When I building file: ../src/Tree.h, I got this error:

ERROR:../src/Tree.h:22: error: non-member function ‘std::ostream& operator<<(std::ostream&, const Tree&)’ cannot have cv-qualifier

REASONS:  use const on a non-member function

 error code: friend ostream& operator<< (ostream& os, const Tree& tree) const;

right code: friend ostream& operator<< (ostream& os, const Tree& tree);

 

你可能感兴趣的:(c++ Error : non-member function cannot have cv-qualifier)