Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is the sealed command c++ 0x or is it only microsoft who has it

Is the sealed command going to be in c++ 0x or is it only MS who use it?

like image 351
Merni Avatar asked Aug 11 '11 13:08

Merni


People also ask

What is sealed in C++?

sealed (C++/CLI and C++/CX) sealed is a context-sensitive keyword for ref classes that indicates that a virtual member cannot be overridden, or that a type cannot be used as a base type. The ISO C++11 Standard language introduced the final keyword. Use final on standard classes, and sealed on ref classes.

What are sealed modifiers?

When applied to a class, the sealed modifier prevents other classes from inheriting from it. In the following example, class B inherits from class A , but no class can inherit from class B . You can also use the sealed modifier on a method or property that overrides a virtual method or property in a base class.


1 Answers

C++0x has a special identifier final which means the same as sealed for classes in C++/CLI. It prevents a class from being derived from.

Read about sealed in Wikipedia

So the answer is basically: it already is but under a different name and has a different syntax.

like image 59
Michał Trybus Avatar answered Sep 30 '22 19:09

Michał Trybus