C++11 compatibility
Note: IBM supports selected
features of C++11, known as C++0x before its ratification. IBM will continue
to develop and implement the features of this standard. The implementation
of the language level is based on IBM's interpretation of the standard.
Until IBM's implementation of all the C++11 features is complete,
including the support of a new C++11 standard library, the implementation
might change from release to release. IBM makes no attempt to maintain compatibility,
in source, binary, or listings and other compiler interfaces, with
earlier releases of IBM's implementation of the new C++11 features.
The following features are part of a continual phased release process leading towards full compliance with C++11. They can be enabled by using the -qlanglvl=extended0x group option. You can also use specific compiler options to enable or disable these features. See the following table.
Language feature | Discussed in: | C++11 individual suboption control |
---|---|---|
Auto type deduction | The auto type specifier (C++11) | |
C99 long long | Types of integer literals that are supported in C99 and C++11 | ![]() |
C99 preprocessor features adopted in C++11 | C99 preprocessor features adopted in C++11 (C++11) | |
Decltype | The decltype(expression) type specifier (C++11) | |
Defaulted and deleted functions | ||
Delegating constructors | Delegating constructors (C++11) | |
Explicit conversion operators | Explicit conversion operators (C++11) | |
Explicit instantiation declarations | Explicit instantiation declaration | |
Extended friend declarations | Friends (C++ only) | |
Forward declaration of enumerations | Enumerations | N/A |
Generalized constant expressions | Generalized constant expressions (C++11) | |
Inline namespace definitions | Inline namespace definitions (C++11) | |
nullptr | Null pointers | |
Reference collapsing | Reference collapsing (C++11) | |
Right angle brackets | Class templates (C++ only) | |
Rvalue references | ||
Scoped enumerations | Enumerations | |
static_assert | static_assert declaration (C++11) | |
Trailing comma allowed in enum declarations | Enumerations | |
Trailing return type | Trailing return type (C++11) | |
Variadic templates | Variadic templates (C++11) |
Notes:
- You can also use the -qlanglvl=extended group option to enable the explicit instantiation declarations feature.
- If you try to use a C++11 feature when the feature
is not enabled, the compiler issues an information message that follows
a syntax error message. The information message indicates how to turn
on the C++11 feature to recover from the syntax error. The involved
C++11 features are listed as follows:
- C99 preprocessor features adopted in C++11
- Mixed string literal concatenation
- The __STDC_HOSTED__ macro
- Defaulted and deleted functions
- Delegating constructors
- Explicit conversion operators
- Generalized constant expressions
- Inline namespace definitions
- nullptr
- Reference collapsing
- Right angle brackets
- Rvalue references
- Scoped enumerations
- Variadic templates
- C99 preprocessor features adopted in C++11