Making sure the method declaration is inherited

前端 未结 3 1915
无人共我
无人共我 2021-01-18 18:27

How can I protect from accidental definition of non-inherited method where inherited definition is intended. I am told there is trick to express it, but nobody can recall it

3条回答
  •  耶瑟儿~
    2021-01-18 18:55

    You have compilation errors -

    • int VeryLongFunctionName(int VeryLongArgumentList) supposed to return an int which none of the method definitions is doing so.
    • int VeryLongFunctionName(int VeryLongArgumentList) supposed to receive an int.

      p->VeryLongFunctionName(); // Error

    With these corrected, you should get the expected results. Check results : http://ideone.com/wIpr9

提交回复
热议问题