Storage class specifiers

suggest change

Introduction

Storage class specifiers are keywords that can be used in declarations. They do not affect the type of the declaration, but typically modify the way in which the entity is stored.

Remarks

There are six storage class specifiers, although not all in the same version of the language: auto (until C++11), register (until C++17), static, thread_local (since C++11), extern, and mutable.

According to the standard,

At most one storage-class-specifier shall appear in a given decl-specifier-seq, except that thread_local may appear with static or extern.

A declaration may contain no storage class specifier. In that case, the language specifies a default behaviour. For example, by default, a variable declared at block scope implicitly has automatic storage duration.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:


Storage class specifiers:
* Storage class specifiers
* extern
* static
* auto

Table Of Contents
8 Arrays
11 Loops
39 Streams
51 Unions
56 Lambdas
60 SFINAE
62 RAII
67 Sorting
84 RTTI
87 Scopes
104 Profiling
107 Recursion
117 Iteration
124 Storage class specifiers
125 Alignment
134 Semaphore
136 Debugging
139 Mutexes
142 decltype