I am trying to overload operator <<, but it always need to be a const function. However, I want to change values inside this overloaded function
operator <<
const
operator<< doesn't need to be a const function.
operator<<
Your real problem, though, appears to be the void return type. In order to chain insertions together, you need to return *this.
*this