C++ keyword: case - cppreference.com (original) (raw)
From cppreference.com
| General topics | |
|---|---|
| Preprocessor Comments | Keywords Escape sequences |
| Flow control | |
| Conditional execution statements | |
| if | switch |
| Iteration statements (loops) | |
| for range-for (C++11) | while do-while |
| Jump statements | |
| continue - break | goto - return |
| Functions | |
| Function declaration | |
| Lambda function expression | |
| inline specifier | |
| Dynamic exception specifications (until C++17*) | |
| noexcept specifier (C++11) | |
| Exceptions | |
| throw-expression try block | catch handler |
| Namespaces | |
| Namespace declaration | Namespace aliases |
| Types | |
| Fundamental types Enumeration types Function types | Class/struct types Union types |
| Specifiers | |
| const/volatile decltype (C++11) auto (C++11) | constexpr (C++11) consteval (C++20) constinit (C++20) |
| Storage duration specifiers | |
| Initialization | |
| Default-initialization Value-initialization Zero-initialization Copy-initialization Direct-initialization | Aggregate initialization List-initialization (C++11) Constant initialization Reference initialization |
| Expressions | |
|---|---|
| Value categories Order of evaluation | Operators Operator precedence |
| 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 | |
| Implicit conversions static_cast const_cast | Explicit conversions dynamic_cast reinterpret_cast |
| Memory allocation | |
| new expression | delete expression |
| Classes | |
| Class declaration Constructors this pointer | Access specifiers friend specifier |
| Class-specific function properties | |
| Virtual function override specifier (C++11) final specifier (C++11) | explicit (C++11) static |
| Special member functions | |
| Default constructor Copy constructor Move constructor (C++11) | Copy assignment Move assignment (C++11) Destructor |
| Templates | |
| Class template Function template | Template specialization Parameter packs (C++11) |
| Miscellaneous | |
| Inline assembly | History of C++ |
[edit] Usage
- switch statement: as the declaration of the case labels
[edit] See also
| constexpr if statement: constexpr (constexpr if statement) | (since C++17) |
|---|---|
| consteval if statement: consteval (consteval if statement) | (since C++23) |
- switch statement: switch
- default (as case label declaration) etc: default
- goto statement: goto
- continue statement: continue
- break statement: break
- return statement: return
| co_return statement (return from a coroutine): co_return | (since C++20) |
|---|
- do-while loop and while loop: do, while
- for loop and range-based for loop: for
Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/keyword/case&oldid=176226"