Inversion of generated vtable functions order for functions with the same name
问题 If, using Visual Studio 2019, I compile this C++ code with two virtual methods having the same name but different arguments: struct MyStruct { virtual void foo(float) = 0; virtual void foo(int) = 0; }; class MyClass : public MyStruct { public: void foo(float) {} void foo(int) {} }; static MyClass c; The order of methods in the generated class' vtable is inverted. Here is the output in https://godbolt.org const MyClass::`vftable' DQ FLAT:const MyClass::`RTTI Complete Object Locator' ; MyClass: