In addition to the existing C++11 features, new C++11 features are supported in this release of XL C/C++.
The generalized constant expressions feature is enhanced in XL C/C++ V13.1.
You can use the -qlanglvl=extended0x option to enable most of the C++ features and all the currently supported C++11 features. For details, see -qlanglvl.
This feature introduces two new forms of function declarations to define explicitly defaulted functions and deleted functions. For the explicitly defaulted functions, the compiler generates the default implementations, which are more efficient than manually programmed implementations. The compiler disables the deleted functions to avoid calling unwanted functions.
You can use the -qlanglvl=defaultanddelete option to enable this feature.
For more information, see Explicitly defaulted functions (C++11) and Deleted functions (C++11).
The generalized constant expressions feature extends the set of expressions permitted within constant expressions. The implementation of this feature in XL C/C++ V12.1 was a partial implementation of what is defined in the C++11 standard. In this release, enhancements are made to support user-defined constexpr objects and constexpr pointers or references to constexpr functions and objects.
You can use the -qlanglvl=constexpr option to enable this feature.
For more information, see Generalized constant expressions (C++11).
This feature introduces nullptr as a null pointer constant. The nullptr constant can be distinguished from integer 0 for overloaded functions. The constants of 0 and NULL are treated as of the integer type for overloaded functions, whereas nullptr can be implicitly converted to only the pointer type, pointer-to-member type, and bool type.
You can use the -qlanglvl=nullptr option to enable this feature.
For more information, see Null pointers.