[Solved] Operator Overloading Error: no match for ‘operator>>’

Introduction Operator overloading is a powerful feature of C++ that allows you to redefine the behavior of operators for user-defined types. However, when using operator overloading, you may encounter errors such as “no match for ‘operator>>’”. This error occurs when the compiler cannot find a suitable definition for the overloaded operator. In this article, we … Read more

[Solved] Operator Overloading Error: no match for ‘operator>>’

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 friends do. And don’t forget to return the stream is. 1 solved Operator Overloading Error: no match … Read more