问题描述
我注意到,在C ++中有密封和接口关键字。这是CLR C ++吗?
如果没有,当被密封和接口添加到C ++标准?它们在C ++中有与在C#中相同的意义吗?
I noticed that there are sealed and interface keywords in C++. Is this just for CLR C++?If not, when were sealed and interface added to the C++ standard? Do they have the same meaning in C++ as they do in C#? If not, how do I get the equivalent in standard C++?
推荐答案
密封
和 interface
关键字仅用于C ++ / CLI。有关详情,请参见详细信息。
sealed
and interface
keywords are only for C++/CLI. See Language Features for Targeting the CLR for more details.
在标准C ++ 接口
中,可以替换为纯虚拟类和多重继承。 密封的
关键字可以替换为(这不是boost的官方部分)。
In standard C++ interface
could be replaced with pure virtual class and multiple inheritance. Sealed
keyword could be replaced with boost::noninheritable
(which is not an official part of boost yet).
这篇关于c ++密封和接口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!