Click here to Skip to main content
15,920,005 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: can we make class cant be derived at all? Pin
theCPkid23-Oct-09 21:46
theCPkid23-Oct-09 21:46 
GeneralRe: can we make class cant be derived at all? Pin
Rajesh R Subramanian23-Oct-09 21:53
professionalRajesh R Subramanian23-Oct-09 21:53 
GeneralRe: can we make class cant be derived at all? Pin
theCPkid23-Oct-09 22:00
theCPkid23-Oct-09 22:00 
GeneralRe: can we make class cant be derived at all? Pin
Rajesh R Subramanian23-Oct-09 22:14
professionalRajesh R Subramanian23-Oct-09 22:14 
GeneralRe: can we make class cant be derived at all? Pin
theCPkid23-Oct-09 22:25
theCPkid23-Oct-09 22:25 
GeneralRe: can we make class cant be derived at all? Pin
Rajesh R Subramanian23-Oct-09 22:36
professionalRajesh R Subramanian23-Oct-09 22:36 
GeneralRe: can we make class cant be derived at all? Pin
Richard MacCutchan24-Oct-09 7:15
mveRichard MacCutchan24-Oct-09 7:15 
GeneralRe: can we make class cant be derived at all? Pin
Rajesh R Subramanian24-Oct-09 7:38
professionalRajesh R Subramanian24-Oct-09 7:38 
No it isn't a bug. It is some sort of an extension to their compiler.

Even though there is nothing called "sealed" in the c++ language, Microsoft seem to have added the ability to their native c++ compiler to understand and support this keyword (the idea must have come from .NET). It looks like only VS 2005 or above will support this keyword.

This cannot even be said to be "Microsoft Specific" (note that the documentation avoids using this term too), because it is restrictive to some versions of their compilers. Unfortunately if you would like to write portable code, using it is a very bad idea, because any other standard c++ compiler won't even know what sealed means. You will have to rewrite your code such that your class is not inheritable (and that will require you to change the whole class code, and the code that is using the class).

And if you want to write a class that is not inheritable, and if you use this feature, then the code is NOT c++. Because it won't even compile in any standards conformant c++ compiler.


“Follow your bliss.” – Joseph Campbell

AnswerRe: can we make class cant be derived at all? Pin
Rajesh R Subramanian23-Oct-09 19:31
professionalRajesh R Subramanian23-Oct-09 19:31 
AnswerRe: can we make class cant be derived at all? Pin
Kushagra Tiwari23-Oct-09 21:33
Kushagra Tiwari23-Oct-09 21:33 
AnswerRe: can we make class cant be derived at all? [modified] Pin
Nuri Ismail23-Oct-09 22:27
Nuri Ismail23-Oct-09 22:27 
Questionscanner Driver Pin
randydom23-Oct-09 11:03
randydom23-Oct-09 11:03 
QuestionRe: scanner Driver Pin
NitinMakwana8-Jan-10 1:10
NitinMakwana8-Jan-10 1:10 
QuestionMemory Leak Pin
BarryPearlman23-Oct-09 10:51
BarryPearlman23-Oct-09 10:51 
AnswerRe: Memory Leak Pin
«_Superman_»23-Oct-09 12:21
professional«_Superman_»23-Oct-09 12:21 
AnswerRe: Memory Leak Pin
BarryPearlman25-Oct-09 3:56
BarryPearlman25-Oct-09 3:56 
GeneralRe: Memory Leak Pin
«_Superman_»25-Oct-09 8:43
professional«_Superman_»25-Oct-09 8:43 
AnswerRe: Memory Leak Pin
PJ Arends23-Oct-09 12:37
professionalPJ Arends23-Oct-09 12:37 
GeneralRe: Memory Leak Pin
BarryPearlman23-Oct-09 15:12
BarryPearlman23-Oct-09 15:12 
Questionint treated as binary no. Pin
Manmohan2923-Oct-09 10:41
Manmohan2923-Oct-09 10:41 
AnswerRe: int treated as binary no. Pin
David Crow23-Oct-09 10:45
David Crow23-Oct-09 10:45 
GeneralRe: int treated as binary no. Pin
Manmohan2923-Oct-09 10:58
Manmohan2923-Oct-09 10:58 
AnswerRe: int treated as binary no. Pin
David Crow23-Oct-09 11:04
David Crow23-Oct-09 11:04 
GeneralRe: int treated as binary no. Pin
Manmohan2923-Oct-09 11:16
Manmohan2923-Oct-09 11:16 
GeneralRe: int treated as binary no. Pin
David Crow23-Oct-09 15:08
David Crow23-Oct-09 15:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.