Sign in to follow this  

operator overloading needs class type

Recommended Posts

Does anyone know why there must be at least one variable a class type to do operator overloading? something like std::string operator + (const char*, int) is not allowed in C++. Is there a reason for this? Tx! - Constantin

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this