You have to change the get_name()
to return a non-const reference, like string& get_name();
to get it working/compile. But will look strange.
What you can do instead is pass the member name
directly
iss >> employee.name;
that’s what friend
s do.
And don’t forget to return the stream is
.
1
solved Operator Overloading Error: no match for ‘operator>>’