Overloads of inherited member functions

前端 未结 3 1872
故里飘歌
故里飘歌 2020-12-16 14:42

Can a class overload methods that also exist in the publicly inherited interface? It seems like this is unambiguous and useful, but compilers (VC, Intel, GCC) all complain,

3条回答
  •  忘掉有多难
    2020-12-16 15:05

    When you declare a method in the subclass with the same name but a different signature, it actually hides the version from the parent.

    You could refer to it specifically as Bound::rebound(...) or use the using keyword.

    See here

提交回复
热议问题