Created
December 4, 2012 15:56
-
-
Save fresky/4205430 to your computer and use it in GitHub Desktop.
How to make a class non derivable in C++
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
class NoDerive { | |
NoDerive(){}; | |
public: | |
static NoDerive GetNoDerive(){ return NoDerive();}; | |
~NoDerive(){}; | |
}; | |
class NoDerive; | |
class NoDeriveBase | |
{ | |
friend class NoDerive; | |
NoDeriveBase(){}; | |
}; | |
class NoDerive:private virtual NoDeriveBase { | |
public: | |
NoDerive(){}; | |
~NoDerive(){}; | |
}; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment