__identifier(C++/CLI)

C++ 키워드를 식별자로 사용할 수 있습니다.

모든 플랫폼

구문

__identifier(C++_keyword)

설명

키워드가 아닌 식별자에 __identifier 키워드를 사용할 수 있지만, 스타일상 사용하지 않는 것이 좋습니다.

Windows 런타임

요구 사항

컴파일러 옵션: /ZW

예제

예제

다음 예제에서 명명 template 된 클래스는 C#으로 만들어지고 DLL로 배포됩니다. 클래스 __identifier 를 사용하는 template C++/CLI 프로그램에서 키워드(keyword) 표준 C++ 키워드(keyword) 사실을 template 숨깁니다.

// 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

예제

다음 예제에서 명명 template 된 클래스는 C#으로 만들어지고 DLL로 배포됩니다. 클래스 __identifier 를 사용하는 template C++/CLI 프로그램에서 키워드(keyword) 표준 C++ 키워드(keyword) 사실을 template 숨깁니다.

// 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();
}

참고 항목

.NET 및 UWP용 구성 요소 확장
.NET 및 UWP용 구성 요소 확장