What does C4250 VC++ warning mean?

前端 未结 4 1232
予麋鹿
予麋鹿 2020-12-03 14:33

What does C4250 Visual C+ warning mean in practical terms? I\'ve read the linked MSDN page, but I still don\'t get what the problem is.

What does the compiler warn m

4条回答
  •  悲&欢浪女
    2020-12-03 15:17

    In the linked example you have diamond which inherits both weak and dominant, which both inherit virtually from vbc, but only dominant overrides func()

    There is a problem in C++ when you have such a structure when you don't use virtual inheritance. However, with virtual inheritance, the problem is solved, so the warning is just information telling you that if:

    1. You hadn't used virtual inheritance, OR
    2. weak had implemented func()

    then you would get a compiler error.

    So, my opinion is that if you know what you are doing you can safely disable this warning for the whole of your project.

提交回复
热议问题