CMAKE_CXX_KNOWN_FEATURES¶
New in version 3.1.
List of C++ features known to this version of CMake.
The features listed in this global property may be known to be available to the
C++ compiler. If the feature is available with the C++ compiler, it will
be listed in the CMAKE_CXX_COMPILE_FEATURES variable.
The features listed here may be used with the target_compile_features()
command. See the cmake-compile-features(7) manual for information on
compile features and a list of supported compilers.
The features known to this version of CMake are listed below.
High level meta features indicating C++ standard support¶
The following meta features indicate general support for the associated language standard. It reflects the language support claimed by the compiler, but it does not necessarily imply complete conformance to that standard.
cxx_std_98Compiler mode is at least C++ 98.
cxx_std_11Compiler mode is at least C++ 11.
cxx_std_14Compiler mode is at least C++ 14.
cxx_std_17Compiler mode is at least C++ 17.
cxx_std_20Compiler mode is at least C++ 20.
Low level individual compile features¶
For C++ 11 and C++ 14, compilers were sometimes slow to implement certain language features. CMake provided some individual compile features to help projects determine whether specific features were available. These individual features are now less relevant and projects should generally prefer to use the high level meta features instead. Individual compile features are not provided for C++ 17 or later.
See the cmake-compile-features(7) manual for further discussion of
the use of individual compile features.
Individual features from C++ 98¶
cxx_template_template_parametersTemplate template parameters, as defined in
ISO/IEC 14882:1998.
Individual features from C++ 11¶
cxx_alias_templatesTemplate aliases, as defined in N2258.
cxx_alignasAlignment control
alignas, as defined in N2341.cxx_alignofAlignment control
alignof, as defined in N2341.cxx_attributesGeneric attributes, as defined in N2761.
cxx_auto_typeAutomatic type deduction, as defined in N1984.
cxx_constexprConstant expressions, as defined in N2235.
cxx_decltype_incomplete_return_typesDecltype on incomplete return types, as defined in N3276.
cxx_decltypeDecltype, as defined in N2343.
cxx_default_function_template_argsDefault template arguments for function templates, as defined in DR226
cxx_defaulted_functionsDefaulted functions, as defined in N2346.
cxx_defaulted_move_initializersDefaulted move initializers, as defined in N3053.
cxx_delegating_constructorsDelegating constructors, as defined in N1986.
cxx_deleted_functionsDeleted functions, as defined in N2346.
cxx_enum_forward_declarationsEnum forward declarations, as defined in N2764.
cxx_explicit_conversionsExplicit conversion operators, as defined in N2437.
cxx_extended_friend_declarationsExtended friend declarations, as defined in N1791.
cxx_extern_templatesExtern templates, as defined in N1987.
cxx_finalOverride control
finalkeyword, as defined in N2928, N3206 and N3272.cxx_func_identifierPredefined
__func__identifier, as defined in N2340.cxx_generalized_initializersInitializer lists, as defined in N2672.
cxx_inheriting_constructorsInheriting constructors, as defined in N2540.
cxx_inline_namespacesInline namespaces, as defined in N2535.
cxx_lambdasLambda functions, as defined in N2927.
cxx_local_type_template_argsLocal and unnamed types as template arguments, as defined in N2657.
cxx_long_long_typelong longtype, as defined in N1811.cxx_noexceptException specifications, as defined in N3050.
cxx_nonstatic_member_initNon-static data member initialization, as defined in N2756.
cxx_nullptrNull pointer, as defined in N2431.
cxx_overrideOverride control
overridekeyword, as defined in N2928, N3206 and N3272.cxx_range_forRange-based for, as defined in N2930.
cxx_raw_string_literalsRaw string literals, as defined in N2442.
cxx_reference_qualified_functionsReference qualified functions, as defined in N2439.
cxx_right_angle_bracketsRight angle bracket parsing, as defined in N1757.
cxx_rvalue_referencesR-value references, as defined in N2118.
cxx_sizeof_memberSize of non-static data members, as defined in N2253.
cxx_static_assertStatic assert, as defined in N1720.
cxx_strong_enumsStrongly typed enums, as defined in N2347.
cxx_thread_localThread-local variables, as defined in N2659.
cxx_trailing_return_typesAutomatic function return type, as defined in N2541.
cxx_unicode_literalsUnicode string literals, as defined in N2442.
cxx_uniform_initializationUniform initialization, as defined in N2640.
cxx_unrestricted_unionsUnrestricted unions, as defined in N2544.
cxx_user_literalsUser-defined literals, as defined in N2765.
cxx_variadic_macrosVariadic macros, as defined in N1653.
cxx_variadic_templatesVariadic templates, as defined in N2242.
Individual features from C++ 14¶
cxx_aggregate_default_initializersAggregate default initializers, as defined in N3605.
cxx_attribute_deprecated[[deprecated]]attribute, as defined in N3760.cxx_binary_literalsBinary literals, as defined in N3472.
cxx_contextual_conversionsContextual conversions, as defined in N3323.
cxx_decltype_autodecltype(auto)semantics, as defined in N3638.cxx_digit_separatorsDigit separators, as defined in N3781.
cxx_generic_lambdasGeneric lambdas, as defined in N3649.
cxx_lambda_init_capturesInitialized lambda captures, as defined in N3648.
cxx_relaxed_constexprRelaxed constexpr, as defined in N3652.
cxx_return_type_deductionReturn type deduction on normal functions, as defined in N3386.
cxx_variable_templatesVariable templates, as defined in N3651.