Why should I use the “using” keyword to access my base class method?

后端 未结 4 1919
无人共我
无人共我 2020-11-27 11:19

I wrote the below code in order to explain my issue. If I comment the line 11 (with the keyword \"using\"), the compiler does not compile the file and displays this error: <

4条回答
  •  爱一瞬间的悲伤
    2020-11-27 11:49

    Surprisingly this is standard behavior. If a derived class declares a method with the same name as a method defined by the base class, the derived class' method hides the base class' one.

    See C++ FAQ

提交回复
热议问题