# C++ keyword: `default`

From cppreference.com
< cpp‎ | keyword

### Usage

- `switch` statement: as the declaration of the default case label

- explicitly-defaulted function definition: as an explicit instruction to the compiler to generate special member function or a comparison operator (since C++20) for a class.

(since C++11)

### See also

- `if` statement: `if`, `else`

- `constexpr` `if` statement: `constexpr` (`constexpr` `if` statement)

(since C++17)

- `consteval` `if` statement: `consteval` (`consteval` `if` statement)

(since C++23)

- `switch` statement: `switch`, `case`

- `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/default&oldid=176227"