Usage
-
finalspecifier
Example
struct b0 final {};
struct d0 : b0 {}; // Error: cannot derive from final base
struct b1
{
virtual void f0() final;
virtual void f1();
};
struct d1 : b1 // OK
{
void f0(); // Error: cannot override final function
void f1(); // OK
};See also
Content from this page on cppreference.com, licensed under CC-BY-SA 3.0 and GFDL. Modified: restyled, site navigation removed, code windows added. Offline snapshot of 9 February 2025.