Warning C4099: type name first seen using 'class' now seen using 'struct' (MS VS 2k8)

前端 未结 7 2327
萌比男神i
萌比男神i 2021-01-04 01:42

Is this warning anything to worry about? I\'ve read that it can cause erratic behaviour?

It\'s an example I\'m trying to compile, could someone explain to me why the

7条回答
  •  遥遥无期
    2021-01-04 02:04

    In c++ the only difference between a class and a struct is that class's member variables, member functions and base classes are private by default, while in a struct they're by default public; so, the fact that the class is POD should not make any difference here.
    I would guess that this warning comes from code maintenance (definition updated somewhere but not somewhere else), and fix the code so that the warning disappears (e.g. using class in the typedef).

提交回复
热议问题