C ++中的“ref”和“sealed”关键字是什么? [英] What are the 'ref' and 'sealed' keywords in C++?
问题描述
我刚刚看到一些(大概)C ++代码运行两个关键字我不知道(我假设关键字,但因为我没有上下文,他们可能是简单的 #define
)。
I've just seen some (presumably) C++ code which sports two "keywords" unknown to me (I'm assuming keywords but, since I have no context, they may be simple #define
things).
它们似乎并不出现在C ++ 11标准中,至少我有草案,一个相当晚的草稿,我不能想象他们只是在最后一分钟掉入标准。它们是 ref
和 sealed
。
They also don't seem to appear in the C++11 standard, at least the draft I have but, since that's a pretty late draft, I can't imagine them being just dropped into the standard at the last minute. They are ref
and sealed
.
发现它们是如下:
public ref class DevIface sealed {
private:
int currOffset;
public:
DevIface (int initOffset);
: : :
有没有人知道这些关键字是什么,要实现?
Does anyone know what these keywords are, and what they're meant to achieve?
推荐答案
这是C ++ / CLI。
This is C++/CLI.
ref class
是托管类型。
sealed
表示类不能继承
这篇关于C ++中的“ref”和“sealed”关键字是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!