In a code a professor of mine developed, there's a class called Node
. In that class, operators <<
and >>
are overloaded as follows:
// Overloaded write operator
friend std::ostream& operator<<(std::ostream& os, const Node& obj);
// Overloaded input operator
friend std::istream& operator>>(std::istream& is, Node& obj);
Does anyone know:
- The meaning of
const
in the first signature, and why is not possible to useconst
in the second one? - The purpose of
&
afterNode
in the second signature.