__identifier (C++/CLI)
Visual の C++ のキーワードの使用を識別子として有効にします。
すべてのプラットフォーム
構文
__identifier(Visual_C++_keyword)
解説
使用して、 __identifierのキーワードをキーワードではない識別子が設定、スタイルの問題としては推奨しません。
Windows ランタイム
要件
コンパイラ オプション:/ZW
例
例
次の例では、クラスの名前をtemplateでは、c# で作成され、DLL として配布します。使用して、Visual C プログラムで、 templateクラスは、 __identifierキーワードを非表示に事実、 template標準 C++ キーワードです。
// identifier_template.cs
// compile with: /target:library
public class template {
public void Run() { }
}
// keyword__identifier.cpp
// compile with: /ZW
#using <identifier_template.dll>
int main() {
__identifier(template)^ pTemplate = ref new __identifier(template)();
pTemplate->Run();
}
共通言語ランタイム
解説
__identifierキーワードが有効で、 /clrと**/clr:oldSyntax**コンパイラ オプション。
要件
コンパイラ オプション:/clr
例
例
次の例では、クラスの名前をtemplateでは、c# で作成され、DLL として配布します。使用して、Visual C プログラムで、 templateクラスは、 __identifierキーワードを非表示に事実、 template標準 C++ キーワードです。
// identifier_template.cs
// compile with: /target:library
public class template {
public void Run() { }
}
// keyword__identifier.cpp
// compile with: /clr
#using <identifier_template.dll>
int main() {
__identifier(template) ^pTemplate = gcnew __identifier(template)();
pTemplate->Run();
}