Namespaces
Variants

C++ keywords

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

C++의 예약 키워드 목록입니다. 언어에서 사용되므로 이러한 키워드는 재정의나 오버로딩이 불가능합니다. 예외적으로, attributes (속성 인수 목록은 제외) 내에서는 예약어로 간주되지 않습니다. (C++11부터)

**참고**: C++ 키워드와 버전 표시는 원본 그대로 유지되었으며, HTML 태그와 속성은 변경되지 않았습니다. **번역 설명:** - 모든 HTML 태그와 속성은 원본 그대로 유지 - ` ` 태그 내의 C++ 키워드들은 번역하지 않음 - 버전 정보 표시인 (C++11)과 숫자 표시 (1), (2) 등은 번역하지 않음 - HTML 구조와 서식은 완전히 보존
A – C D – P R – Z

alignas (C++11)
alignof (C++11)
and
and_eq
asm
atomic_cancel (TM TS)
atomic_commit (TM TS)
atomic_noexcept (TM TS)
auto (1) (3) (4) (5)
bitand
bitor
bool
break
case
catch
char
char8_t (C++20)
char16_t (C++11)
char32_t (C++11)
class (1)
compl
concept (C++20)
const
consteval (C++20) (5)
constexpr (C++11) (3)
constinit (C++20)
const_cast
continue
contract_assert (C++26)
co_await (C++20)
co_return (C++20)
co_yield (C++20)

decltype (C++11) (2)
default (1)
delete (1)
do
double
dynamic_cast
else
enum (1)
explicit
export (1) (4)
extern (1)
false
float
for (1)
friend
goto
if (3) (5)
inline (1) (3)
int (1)
long
mutable (1)
namespace
new
noexcept (C++11)
not
not_eq
nullptr (C++11)
operator (1)
or
or_eq
private (4)
protected
public

reflexpr (리플렉션 TS)
register (3)
reinterpret_cast
requires (C++20)
return
short
signed
sizeof (1)
static
static_assert (C++11)
static_cast
struct (1)
switch
synchronized (TM TS)
template
this (5)
thread_local (C++11)
throw (3) (4)
true
try
typedef
typeid
typename (3) (4)
union
unsigned
using (1) (4)
virtual
void
volatile
wchar_t
while
xor
xor_eq

  • (1) — C++11에서 의미가 변경되거나 새로운 의미가 추가됨.
  • (2) — C++14에서 새로운 의미가 추가됨.
  • (3) — C++17에서 의미가 변경되거나 새로운 의미가 추가됨.
  • (4) — C++20에서 의미가 변경되거나 새로운 의미가 추가됨.
  • (5) — C++23에서 새로운 의미가 추가됨.

주의하십시오: and , bitor , or , xor , compl , bitand , and_eq , or_eq , xor_eq , not not_eq (다이그래프: < % , % > , < : , : > , % : , % : % : 및 트라이그래프: ?? < , ?? > , ?? ( , ?? ) , ?? = , ?? / , ?? ' , ?? ! , ?? - (C++17까지) )는 표준 토큰을 표현하는 대체 방법 을 제공합니다. 이러한 키워드들은 속성(속성 인수 목록 제외)에서도 예약어로 간주되지만, 일부 구현에서는 다른 키워드들과 동일하게 처리합니다. (C++11부터)

키워드 외에도 특별한 의미를 가진 식별자 가 있으며, 이들은 객체나 함수의 이름으로 사용될 수 있지만 특정 상황에서 특별한 의미를 가집니다.

final (C++11)
override (C++11)
transaction_safe (TM TS)
transaction_safe_dynamic (TM TS)
import (C++20)
module (C++20)
pre (C++26)
post (C++26)
trivially_relocatable_if_eligible (C++26)
replaceable_if_eligible (C++26)

또한, 모든 위치에 이중 밑줄 __ 을 포함하는 모든 식별자 와 밑줄 뒤에 대문자가 오는 식별자는 항상 예약되어 있으며, 밑줄로 시작하는 모든 식별자는 전역 네임스페이스에서 이름으로 사용하기 위해 예약되어 있습니다. 자세한 내용은 식별자 를 참조하십시오.

네임스페이스 std 는 표준 C++ 라이브러리의 이름들을 배치하는 데 사용됩니다. 여기에 이름을 추가하는 규칙에 대해서는 Extending namespace std 를 참조하십시오.

posix 라는 이름은 향후 최상위 네임스페이스로 예약되어 있습니다. 프로그램이 해당 네임스페이스에서 어떤 것을 선언하거나 정의할 경우 동작은 정의되지 않습니다.

(C++11부터)

다음 토큰들은 전처리기 지시문의 맥락에서 preprocessor 에 의해 인식됩니다:

if
elif
else
endif

ifdef
ifndef
elifdef (C++23)
elifndef (C++23)
define
undef

include
embed (C++26)
line

error
warning (C++23)
pragma

defined
__has_include (C++17)
__has_cpp_attribute (C++20)
__has_embed (C++26)

export (C++20)
import (C++20)
module (C++20)

**참고:** C++ 전처리기 지시문과 키워드는 번역하지 않고 원문을 유지했습니다. HTML 태그와 속성, ` `, `
`, `` 태그 내부의 내용도 모두 원본 그대로 보존했습니다.

다음 토큰들은 전처리기 지시문 외부 컨텍스트에서 preprocessor 에 의해 인식됩니다:

_Pragma (C++11)

참고 항목

C 문서 참조: 키워드