| geekocoder (88) | |||
i am having a hard time understanding overloading of functions in this code..i am not able to understand why isnt the compiler able to detect the same declaration of fun()....further i didnt even understand line9 where a constructor is inherited....how is it inherited???plz help me in understanding this...
| |||
|
|
|||
| vlad from moscow (3112) | |||||
|
Non-static member functions have one more implicit parameter of type either SomeClass * or const SomeClass * depending on whether the trailing const qualifier is present. So in fact the definitions
can be considered as equivalent to the following definitions
So when a const object is used the compiler selects the first function. Otherwise it selects the second function. As for "inherited constructor" then there is no any inherited constructor. | |||||
|
Last edited on
|
|||||