Date: Sat, 17 Aug 2024 17:18:54 -0400
Could C++ use an attribute to require derived classes to call the base
class version of a function?
struct A {
virtual void f() [[required]] { }
};
struct B : A {
void f() override {
A::f(); // compiler warning if omitted
}
};
Much like Objective-C's __attribute__((objc_requires_super))
class version of a function?
struct A {
virtual void f() [[required]] { }
};
struct B : A {
void f() override {
A::f(); // compiler warning if omitted
}
};
Much like Objective-C's __attribute__((objc_requires_super))
Received on 2024-08-17 21:19:06