Namespaces
Variants

C++ keyword: union

From cppreference.net
C++ language
General topics
Flow control
Conditional execution statements
Iteration statements (loops)
Jump statements
Functions
Function declaration
Lambda function expression
inline specifier
Dynamic exception specifications ( until C++17* )
noexcept specifier (C++11)
Exceptions
Namespaces
Types
Specifiers
constexpr (C++11)
consteval (C++20)
constinit (C++20)
Storage duration specifiers
Initialization
Expressions
Alternative representations
Literals
Boolean - Integer - Floating-point
Character - String - nullptr (C++11)
User-defined (C++11)
Utilities
Attributes (C++11)
Types
typedef declaration
Type alias declaration (C++11)
Casts
Memory allocation
Classes
Class-specific function properties
Special member functions
Templates
Miscellaneous

사용법

  • union 타입의 선언
  • union 타입의 이름과 동일한 이름을 가진 함수나 변수가 스코프 내에 존재하는 경우, union 을 이름 앞에 붙여 명확하게 구분할 수 있으며, 이는 elaborated type 지정자 를 생성합니다

참고 항목

(C++11부터)