implementation is separate ?
IBase
+ virtual foo() = 0
+ virtual bar() = 0
CBase1 : IBase
+ foo() override
CBase2 : IBase
+ bar() override
CDerived : virtual CBase1,virtual CBase2
Is this the solution you're looking for? struct IBase { virtual void foo() = 0; virtual void bar() = 0; }; struct CBase1 : virtual IBase { void foo() override {} }; struct CBase2 : virtual IBase { void bar() override {} }; struct CDerived : CBase1, CBase2 { };
https://godbolt.org/z/364h9z MSVC, Clang and GCC disagree and compile this just fine
ahh sorry, didnt notice the virtual keyword, taking my words back, :P
Обсуждают сегодня