type
status
date
slug
summary
tags
category
icon
password

Scoped & Un-scoped Enum

In general, when you declare a name within a set of curly braces, it limits the visibility of that name to that scope. However, this rule doesn't apply to C++98-style enum types.
In C++98-style enums, the scope of the enum values is the same as the enum type itself. Therefore, you cannot declare any name with the same identifier within the same scope.
C++11-style enum classes address this issue:

Strongly Typed Enumerators

C++98-style enum values can be implicitly converted to integer types, whereas enum class values cannot.

Forward Declaration

Enum class supports forward declaration because its underlying type defaults to int. vfc For C++98-style enums, you must explicitly declare their underlying type before using forward declaration.
 
deleted functionsC++ Type Deduction
Zack Yang
Zack Yang
Just a humble bounty hunter🥷
公告
type
status
date
slug
summary
tags
category
icon
password
Hey there, welcome to my blog 👋
-- 这个博客写些什么 --
定期技术分享🤖
不定期发疯文学🤡