+ 2

Can specific function hiding be removed ?

Hi Refer code below: https://code.sololearn.com/cs7akz5edxUF If we remove line using A::display; from class B, one and zero parametric display will result into compile time error. Can i have some mechanism to stop accessing one and not other? I mean i want to remove function hiding for specific function signature. Is it possible?

6th Apr 2022, 12:05 PM
Ketan Lalcheta
Ketan Lalcheta - avatar
2 Réponses
+ 2
No you can't. But there is some trick. You can hide specific signuture in derived class making it private.
9th Apr 2022, 7:29 AM
Дмитрий Золотов
Дмитрий Золотов - avatar
+ 2
Sounds good
9th Apr 2022, 7:32 AM
Ketan Lalcheta
Ketan Lalcheta - avatar