namespace override { class override { }; class override_final { ::override::override override; public: virtual ::override::override & final() { return override; } }; } namespace final { class final final : public override::override { }; class final_override final : public override::override_final { ::final::final override; public: ::final::final & final() override final { return override; } }; }
Enjoy.
Edited 19:44 CEST – added namespaces and fixed naming to improve readability