__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();
}
참고 항목
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기