Created
February 22, 2016 21:24
-
-
Save meshell/8be77e377f84c3333dcd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct base { | |
virtual std::string name() { return "default"; } | |
virtual void foo() final { } | |
}; | |
struct derived final: public base { | |
std::string name() override { return "derived!" } | |
// compile error: overriding final function 'virtual void base::foo()' | |
void foo() override { } | |
}; | |
// compile error: cannot derive from 'final' base 'derived' | |
struct further_derived : public derived { | |
std::string name() override { return "further derived!" } | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment