What are the differences among final, finally and finalize in C++
This article mainly introduces the differences between final, finally and finalize in C++. It has certain reference value. Interested friends can refer to it. I hope you can learn a lot after reading this article. Let the editor take you to know it.
The specification character final is provided by the Clear11 standard. It is important to note that the final in Candles11 is not a keyword, but a specifier, which means that you can use it (without causing confusion) as an identifier (to be compatible with previous code). The keyword final, which has the meaning of "this is immutable" or "final state", can modify non-abstract classes, non-abstract class member methods, and variables.
The specification 11 standard provides the specifier final to prevent derived classes from overwriting specific virtual methods. Or prevent a class from becoming a base class.
Syntax 1:class Someclass final {...}
Syntax 2:class Someclass {... type somefun (arg-list) final;...}
Class A {private:public:virtual void Test () const final {std::cout