The following should be allowed:
struct A {
int Func(void) final { return 5; }
};
in order to prevent the following from compiling:
struct B : A {
int Func(void) { return 6; }
};
No.
There's no legitimate reason to restrict what the author of B can make one of its non-virtual functions do. As such, there should not be a language-level mechanism for it.
However it's currently not permissible to mark a non-virtual member
function as 'final'.
Can we change this?
--
Std-Proposals mailing list
Std-Proposals@lists.isocpp.org
https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals