Share via


__identifier (C++/CLI)

Visual の C++ のキーワードの使用を識別子として有効にします。

すべてのプラットフォーム

構文

__identifier(Visual_C++_keyword)

解説

使用して、 __identifierのキーワードをキーワードではない識別子が設定、スタイルの問題としては推奨しません。

Windows ランタイム

hzc8ytsz.collapse_all(ja-jp,VS.110).gif要件

コンパイラ オプション:/ZW

hzc8ytsz.collapse_all(ja-jp,VS.110).gif

次の例では、クラスの名前を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**コンパイラ オプション。

hzc8ytsz.collapse_all(ja-jp,VS.110).gif要件

コンパイラ オプション:/clr

hzc8ytsz.collapse_all(ja-jp,VS.110).gif

次の例では、クラスの名前を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();
}

参照

概念

ランタイム プラットフォームのコンポーネントの拡張機能

ランタイム プラットフォームのコンポーネントの拡張機能