Last active
August 29, 2015 14:10
-
-
Save TSKGunGun/5e75be9407c00ec92c6d 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
//VisualStudio2010で確認 | |
#include "stdafx.h" | |
class CHoge | |
{ | |
public: | |
CHoge(){} | |
protected: | |
virtual void Func() sealed { int i = 0; } ; | |
}; | |
class CHogeHoge:CHoge | |
{ | |
protected: | |
virtual void Func() { int i2 = 0; }; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
VisualCだけの言語拡張。MsBuild以外のコンパイラだとエラーになると思われる。
C++11でこれに相当するとおもわれるfinalキーワードがある