Language | ||||
Standard Library Headers | ||||
Freestanding and hosted implementations | ||||
Named requirements | ||||
Language support library | ||||
Concepts library(C++20) | ||||
Diagnostics library | ||||
Utilities library | ||||
Strings library | ||||
Containers library | ||||
Iterators library | ||||
Ranges library(C++20) | ||||
Algorithms library | ||||
Numerics library | ||||
Input/output library | ||||
Localizations library | ||||
Regular expressions library(C++11) | ||||
Atomic operations library(C++11) | ||||
Thread support library(C++11) | ||||
Filesystem library(C++17) | ||||
Technical Specifications |
Type support (basic types, RTTI, type traits) | |||||||||||||||
Dynamic memory management | |||||||||||||||
Error handling | |||||||||||||||
Program utilities | |||||||||||||||
Variadic functions | |||||||||||||||
Library feature-test macros | |||||||||||||||
Date and time | |||||||||||||||
Function objects | |||||||||||||||
Formatting library(C++20) | |||||||||||||||
(C++11) | |||||||||||||||
(C++20) | |||||||||||||||
(C++11) | |||||||||||||||
(C++14) | |||||||||||||||
Relational operators (deprecated in C++20) | |||||||||||||||
Comparisons (C++20) | |||||||||||||||
Integer comparison functions | |||||||||||||||
(C++20) | |||||||||||||||
Common vocabulary types | |||||||||||||||
| |||||||||||||||
Swap, forward and move | |||||||||||||||
(C++14) | |||||||||||||||
(C++11) | |||||||||||||||
(C++11) | |||||||||||||||
(C++11) | |||||||||||||||
Elementary string conversions | |||||||||||||||
(C++17) | |||||||||||||||
(C++17) | |||||||||||||||
(C++17) | |||||||||||||||
Type operations | |||||||||||||||
(C++11) | |||||||||||||||
(C++17) | |||||||||||||||
(C++17) |
Basic types | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Fundamental types | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Fixed width integer types(C++11) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Numeric limits | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
C numeric limits interface | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Runtime type information | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Type traits | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Type categories | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
(C++11) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
(C++11) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
(C++11) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
(C++11) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
(C++11) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
(C++11) |
Type properties | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
(C++17) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Type trait constants | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
(C++11)(C++17)(C++11)(C++11) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Metafunctions | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
(C++17) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
(C++17) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
(C++17) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Constant evaluation context | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
(C++20) |
Supported operations | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
(C++11) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Relationships and property queries | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Type modifications | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Type transformations | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
template<bool B, class T, class F > struct conditional; | (since C++11) |
type
, which is defined as T
if B
is true at compile time, or as F
if B
is false.conditional
is undefined.Member type | Definition |
type | T if B true, F if B false |
template<bool B, class T, class F > using conditional_t =typename conditional<B,T,F>::type; | (since C++14) |
(C++11) | hides a function overload or template specialization based on compile-time boolean (class template)[edit] |
if
keyword and then in some brackets, the condition. To specify the condition you simply write one value (either a variable or constant), then the comparison operator you want to compare them with (for example - equal to, which is ) and then the second value (either a variable or constant). We then put some curly brackets, and anything inside the curly brackets is what will be executed if the condition is true. For example, the following would compare 1 to 1 (which is a bit silly, but gives an example which is obviously always true):<
) and 'Greater Than' (>
) are relatively simple - they are simply their usual symbols, and so we could check if the user's height is greater than their age like this:!=
. So we could check if the user's height doesn't equal their age like so:else if
after your closing curly bracket for your original 'if' statement, and then specify your 'else if' condition followed by the curly brackets to contain the code to be executed if they are met. For example:else
keyword, and then some curly brackets to specify the code that could be executed at the end of our 'daisy chain':