Can overloading is possible with two version of function, constant member function and function with
- by GG
Hello,
I just came across various overloading methods like type of parameter passed, varying number of parameters, return type etc. I just want to know that can I overload a function with following two version
//function which can modify member
String& MyClass::doSomething();
//constant member function
String& MyClass::doSomething() const;
Please let me know the reason behind it.
Thanks,
GG