Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      Feature testing(since C++20)

      From cppreference.com
      <cpp
       
       
      Feature testing
       

      The standard defines a set ofpreprocessor macros corresponding to C++ language and library features introduced in C++11 or later. They are intended as a simple and portable way to detect the presence of said features.

      Contents

      [edit]Attributes

      __has_cpp_attribute(attribute-token)

      Checks for the support of anattribute named byattribute-token (after macro expansion).

      For each standard attribute, it is implementation-defined whether__has_cpp_attribute expands to the value given in the table below (which is the year and month in which the attribute was added to the working draft) or0. It will expand to given value in the table if and only if the standard attribute causes the implementation to behave as recommended (issuing diagnostic messages, affecting class layout, etc.).

      The presence of vendor-specific attributes is determined by a non-zero value.

      __has_cpp_attribute can be expanded in the expression of#if and#elif.It is treated as a defined macro by#ifdef,#ifndef,#elifdef,#elifndef(since C++23) anddefined but cannot be used anywhere else.

      attribute-tokenAttributeValueStdPaper(s)
      assume[[assume]]202207L(C++23)P1774R8
      carries_dependency[[carries_dependency]]200809L(C++11)
      (until C++26)
      N2556
      N2643
      P3475R2
      deprecated[[deprecated]]201309L(C++14)N3760
      fallthrough[[fallthrough]]201603L(C++17)P0188R1
      indeterminate[[indeterminate]]202403L(C++26)P2795R5
      likely[[likely]]201803L(C++20)P0479R5
      maybe_unused[[maybe_unused]]201603L(C++17)P0212R1
      no_unique_address[[no_unique_address]]201803L(C++20)P0840R2
      nodiscard[[nodiscard]]201603L(C++17)P0189R1
      [[nodiscard]] with reason201907L(C++20)P1301R4
      noreturn[[noreturn]]200809L(C++11)N2761
      unlikely[[unlikely]]201803L(C++20)P0479R5
      Total number of attributes: 11

      [edit]Language features

      The following macros can be used to detect whether a language feature is implemented by the current implementation. They arepredefined in every translation unit.

      Each macro expands to an integer literal corresponding to the year and month when the corresponding feature has been included in the working draft. When a feature changes significantly, the macro will be updated accordingly.

      [edit]
      Macro nameFeatureValueStdPaper(s)
      __cpp_aggregate_basesAggregate classes with base classes201603L(C++17)P0017R1
      __cpp_aggregate_nsdmiAggregate classes withdefault member initializers201304L(C++14)N3653
      __cpp_aggregate_paren_initAggregate initialization in the form ofdirect initialization201902L(C++20)P0960R3
      __cpp_alias_templatesAlias templates200704L(C++11)N2258
      __cpp_aligned_newDynamic memory allocation for over-aligned data201606L(C++17)P0035R4
      __cpp_attributesAttributes200809L(C++11)N2761
      __cpp_auto_castauto(x) andauto{x}202110L(C++23)P0849R8
      __cpp_binary_literalsBinary literals201304L(C++14)N3472
      __cpp_capture_star_thisLambda capture of*this by value as[=,*this]201603L(C++17)P0018R3
      __cpp_char8_tchar8_t201811L(C++20)P0482R6
      char8_t compatibility and portability fix (allowinitialization of (unsigned) char arrays fromUTF-8 string literals)202207L(C++23)
      (DR20)
      P2513R4
      __cpp_conceptsConcepts201907L(C++20)P0734R0
      P1084R2
      P1452R2
      Conditional trivial special member functions202002LP0848R3
      P2493R0
      __cpp_conditional_explicitexplicit(bool)201806L(C++20)P0892R2
      __cpp_constevalImmediate functions201811L(C++20)P1073R3
      Makingconsteval propagate up202211L(C++23)
      (DR20)
      P2564R3
      __cpp_constexprconstexpr200704L(C++11)N2235
      Relaxedconstexpr,non-constconstexpr methods201304L(C++14)N3652
      Constexpr lambda201603L(C++17)P0170R1
      Virtual function calls in constant expressions;try blocks inconstexpr functions,dynamic_cast and polymorphictypeid in constant expressions; trivialdefault initialization andasm-declaration inconstexpr functions201907L(C++20)P1064R0
      P1002R1
      P1327R1
      P1331R2
      P1668R1
      Changing the active member of a union in constant evaluation202002LP1330R0
      P2493R0
      Non-literal variables, labels, andgoto statements inconstexpr functions202110L(C++23)P2242R3
      Relaxing some restrictions onconstexpr functions and function templates202207LP2448R2
      Permitting staticconstexpr variables inconstexpr functions202211LP2647R1
      Constexpr cast fromvoid*: towardsconstexpr type-erasure202306L(C++26)P2738R1
      constexpr placementnew202406LP2747R2
      __cpp_constexpr_dynamic_allocOperations for dynamic storage duration inconstexpr functions201907L(C++20)P0784R7
      __cpp_constexpr_exceptionsconstexpr exceptions:[1],[2]202411L(C++26)P3068R6
      __cpp_constexpr_in_decltypeGeneration of function and variable definitions whenneeded for constant evaluation201711L(C++20)
      (DR11)
      P0859R0
      __cpp_constinitconstinit201907L(C++20)P1143R2
      __cpp_contractsContracts202502L(C++26)P2900R14
      __cpp_decltypedecltype200707L(C++11)N2343
      __cpp_decltype_autoReturn type deduction for normal functions201304L(C++14)N3638
      __cpp_deduction_guidesTemplate argument deduction for class templates (CTAD)201703L(C++17)P0091R3
      P0512R0
      P0620R0
      CTAD for aggregates and aliases201907L(C++20)P1814R0
      P1816R0
      __cpp_delegating_constructorsDelegating constructors200604L(C++11)N1986
      __cpp_deleted_functionDeletedfunction definitions with messages (= delete("should have a reason");)202403L(C++26)P2573R2
      __cpp_designated_initializersDesignated initializers201707L(C++20)P0329R4
      __cpp_enumerator_attributesAttributes forenumerators201411L(C++17)N4266
      __cpp_explicit_this_parameterExplicit object parameter202110L(C++23)P0847R7
      __cpp_fold_expressionsFold expressions201603L(C++17)N4295
      P0036R0
      Ordering ofconstraints involvingfold expressions202406L(C++26)P2963R3
      __cpp_generic_lambdasGeneric lambda expressions201304L(C++14)N3649
      Explicit template parameter list forgeneric lambdas201707L(C++20)P0428R2
      __cpp_guaranteed_copy_elisionGuaranteed copy elision through simplifiedvalue categories201606L(C++17)P0135R1
      __cpp_hex_floatHexadecimal floating literals201603L(C++17)P0245R1
      __cpp_if_constevalif consteval202106L(C++23)P1938R3
      __cpp_if_constexprif constexpr201606L(C++17)P0292R2
      __cpp_impl_coroutineCoroutines (compiler support)201902L(C++20)P0912R5
      LWG3393
      __cpp_impl_destroying_deleteDestroyingoperator delete (compiler support)201806L(C++20)P0722R3
      __cpp_impl_three_way_comparisonThree-way comparison (compiler support)201907L(C++20)P0515R3
      P0768R1
      P1185R2
      P1630R1
      __cpp_implicit_moveSimplerimplicit move202207L(C++23)P2266R3
      __cpp_inheriting_constructorsInheriting constructors200802L(C++11)N2540
      Rewording inheriting constructors: New specification forinheriting constructors (DR1941 et al)201511L(C++17)
      (DR11)
      P0136R1
      __cpp_init_capturesLambda init-capture201304L(C++14)N3648
      Allow pack expansion inlambda init-capture201803L(C++20)P0780R2
      __cpp_initializer_listsList-initialization andstd::initializer_list200806L(C++11)N2672
      __cpp_inline_variablesInline variables201606L(C++17)P0386R2
      __cpp_lambdasLambda expressions200907L(C++11)N2927
      __cpp_modulesModules201907L(C++20)P1103R3
      P1811R0
      __cpp_multidimensional_subscriptMultidimensionalsubscript operator202110L(C++23)P2128R6
      Staticoperator[]202211LP2589R1
      __cpp_named_character_escapesNameduniversal character escapes202207L(C++23)P2071R2
      __cpp_namespace_attributesAttributes fornamespaces201411L(C++17)N4266
      __cpp_noexcept_function_typeMakeexception specifications be part of the type system201510L(C++17)P0012R1
      __cpp_nontype_template_argsAllow constant evaluation for allconstant template arguments201411L(C++17)N4268
      Class types and floating-point types inconstant template parameters201911L(C++20)P1907R1
      __cpp_nontype_template_parameter_autoDeclaringconstant template parameter withauto201606L(C++17)P0127R2
      __cpp_nsdmiNon-static data member initializers200809L(C++11)N2756
      __cpp_pack_indexingPack indexing202311L(C++26)P2662R3
      __cpp_placeholder_variablesA nice placeholder with no name202306L(C++26)P2169R4
      __cpp_pp_embed#embed202502L(C++26)P1967R14
      __cpp_range_based_forRange-basedfor loop200907L(C++11)N2930
      Range-basedfor loop with differentbegin/end types201603L(C++17)P0184R0
      Lifetime extension in range-basedfor202211L(C++23)P2644R1
      P2718R0
      CWG2659
      __cpp_raw_stringsRaw string literals200710L(C++11)N2442
      __cpp_ref_qualifiersref-qualifiers200710L(C++11)N2439
      __cpp_return_type_deductionReturn type deduction for normal functions201304L(C++14)N3638
      __cpp_rvalue_referencesRvalue reference200610L(C++11)N2118
      __cpp_size_t_suffixLiteral suffixes forstd::size_t and its signed version202011L(C++23)P0330R8
      __cpp_sized_deallocationSized deallocation201309L(C++14)N3778
      __cpp_static_assertstatic_assert200410L(C++11)N1720
      Single-argumentstatic_assert201411L(C++17)N3928
      User-generatedstatic_assert messages202306L(C++26)P2741R3
      __cpp_static_call_operatorStaticoperator()202207L(C++23)P1169R4
      __cpp_structured_bindingsStructured bindings201606L(C++17)P0217R3
      Attributes forstructured binding202403L(C++26)P0609R3
      Structured bindings declarationas a condition202406LP0963R3
      Structured bindings can introduce apack202411LP1061R10
      __cpp_template_parametersConcept and variable-template template-parameters202502L(C++26)P2841R7
      __cpp_template_template_argsMatching oftemplate template arguments201611L(C++17)P0522R0
      __cpp_threadsafe_static_initDynamic initialization and destruction with concurrency200806L(C++11)N2660
      __cpp_trivial_relocatabilityTrivial relocatability202502L(C++26)P2786R13
      __cpp_trivial_unionTrivial unions202502L(C++26)P3074R7
      __cpp_unicode_charactersNew character types (char16_t andchar32_t)200704L(C++11)N2249
      __cpp_unicode_literalsUnicode string literals200710L(C++11)N2442
      __cpp_user_defined_literalsUser-defined literals200809L(C++11)N2765
      __cpp_using_enumusing enum201907L(C++20)P1099R5
      __cpp_variable_templatesVariable templates201304L(C++14)N3651
      __cpp_variadic_friendVariadicfriend declarations202403L(C++26)P2893R3
      __cpp_variadic_templatesVariadic templates200704L(C++11)N2242
      __cpp_variadic_usingPack expansions inusing-declarations201611L(C++17)P0195R2
      Total number of macros: 76

      [edit]Library features

      The following macros can be used to detect whether a standard library feature is implemented by the current implementation. Unlike the language feature test macros, they are not predefined. Instead, they are provided by the header<version>.

      For each library feature test macro, it is also provided by the headers that provide the relevant standard library components. Seelibrary feature test macros for a complete list of headers providing these macros.

      Each macro expands to an integer literal corresponding to the year and month when the corresponding feature has been included in the working draft. When a feature changes significantly, the macro will be updated accordingly.

      [edit]
      Macro nameFeatureValueStdPaper(s)
      __cpp_lib_adaptor_iterator_pair_constructorIterator pair constructors forstd::stack andstd::queue202106L(C++23)P1425R4
      __cpp_lib_addressof_constexprConstexprstd::addressof201603L(C++17)LWG2296
      __cpp_lib_algorithm_default_value_typeEnablinglist-initialization foralgorithms202403L(C++26)P2248R8
      P3217R0
      __cpp_lib_algorithm_iterator_requirementsRanges iterators as inputs to non-Rangesalgorithms202207L(C++23)P2408R5
      __cpp_lib_aligned_accessorstd::aligned_accessor: anstd::mdspan accessor expressing pointer over-alignment202411L(C++26)P2897R7
      __cpp_lib_allocate_at_leastSize-feedback in the allocator interface, e.g.:std::allocator::allocate_at_least,std::allocator_traits::allocate_at_least202302L(C++23)P0401R6
      P2652R2
      LWG3887
      __cpp_lib_allocator_traits_is_always_equalstd::allocator_traits::is_always_equal,noexcept cleanups201411L(C++17)N4258
      __cpp_lib_anystd::any201606L(C++17)P0220R1
      P0032R3
      __cpp_lib_applystd::apply201603L(C++17)P0220R1
      __cpp_lib_array_constexprConstexpr forstd::reverse_iterator,std::move_iterator,std::array andrange access201603L(C++17)P0031R0
      ConstexprIterator;constexpr comparison forstd::array; miscconstexpr bits (std::array::fill et al.)201811L(C++20)P0858R0
      LWG3257
      P1023R0
      P1032R1
      __cpp_lib_as_conststd::as_const201510L(C++17)P0007R1
      __cpp_lib_associative_heterogeneous_erasureHeterogeneous erasure inassociative containers andunordered associative containers202110L(C++23)P2077R3
      __cpp_lib_associative_heterogeneous_insertionHeterogeneous overloads for the remaining member functions inordered andunordered associative containers202306L(C++26)P2363R5
      __cpp_lib_assume_alignedstd::assume_aligned201811L(C++20)P1007R3
      __cpp_lib_atomic_flag_teststd::atomic_flag::test201907L(C++20)P1135R6
      __cpp_lib_atomic_floatFloating-point atomic201711L(C++20)P0020R6
      __cpp_lib_atomic_is_always_lock_freeConstexprstd::atomic<T>::is_always_lock_free201603L(C++17)P0152R1
      __cpp_lib_atomic_lock_free_type_aliasesAtomic lockfree integral types (std::atomic_signed_lock_free,std::atomic_unsigned_lock_free)201907L(C++20)P1135R6
      __cpp_lib_atomic_min_maxAtomic minimum/maximum (std::atomic::fetch_min,std::atomic::fetch_max, etc)202403L(C++26)P0493R5
      __cpp_lib_atomic_refstd::atomic_ref201806L(C++20)P0019R8
      std::atomic_ref::address()202411L(C++26)P2835R7
      __cpp_lib_atomic_shared_ptrstd::atomic<std::shared_ptr>201711L(C++20)P0718R2
      __cpp_lib_atomic_value_initializationFixing atomic initialization (value-initializestd::atomic by default)201911L(C++20)P0883R2
      __cpp_lib_atomic_waitEfficientstd::atomic waiting201907L(C++20)P1135R6
      __cpp_lib_barrierstd::barrier201907L(C++20)P1135R6
      std::barrier's phase completion guarantees202302L(C++23)P2588R3
      __cpp_lib_bind_backstd::bind_back202202L(C++23)P2387R3
      Allow passing callable objects as constant template arguments tostd::bind_back202306L(C++26)P2714R1
      __cpp_lib_bind_frontstd::bind_front201907L(C++20)P0356R5
      P1651R0
      Allow passing callable objects as constant template arguments tostd::bind_front202306L(C++26)P2714R1
      __cpp_lib_bit_caststd::bit_cast201806L(C++20)P0476R2
      __cpp_lib_bitopsBit operations201907L(C++20)P0553R4
      __cpp_lib_bitsetInterfacingstd::bitset withstd::string_view202306L(C++26)P2697R1
      __cpp_lib_bool_constantstd::bool_constant201505L(C++17)N4389
      __cpp_lib_bounded_array_traitsstd::is_bounded_array,std::is_unbounded_array201902L(C++20)P1357R1
      __cpp_lib_boyer_moore_searcherSearchers201603L(C++17)P0220R1
      __cpp_lib_bytestd::byte201603L(C++17)P0298R3
      __cpp_lib_byteswapstd::byteswap202110L(C++23)P1272R4
      __cpp_lib_char8_tLibrary support forchar8_t201907L(C++20)P0482R6
      P1423R3
      __cpp_lib_chronoRounding functions forstd::chrono::duration andstd::chrono::time_point201510L(C++17)P0092R1
      Constexpr for all the member functions ofstd::chrono::duration andstd::chrono::time_point201611LP0505R0
      Calendars andTime zones201907L(C++20)P0355R7
      P1466R3
      Hashing support forstd::chrono value classes202306L(C++26)P2592R3
      __cpp_lib_chrono_udlsUser-defined literals for time types201304L(C++14)N3642
      __cpp_lib_clampstd::clamp201603L(C++17)P0025R1
      __cpp_lib_common_referenceMakestd::common_reference_t ofstd::reference_wrapper a reference type202302L(C++23)P2655R3
      __cpp_lib_common_reference_wrapperMakestd::common_reference_t ofstd::reference_wrapper a reference type202302L(C++23)P2655R3
      __cpp_lib_complex_udlsUser-defined Literals forstd::complex201309L(C++14)N3779
      __cpp_lib_conceptsStandard library concepts202002L(C++20)P0898R3
      P1754R1
      P1964R2
      Move-only types forequality_comparable_with,totally_ordered_with, andthree_way_comparable_with202207L(C++23)P2404R3
      __cpp_lib_constexpr_algorithmsConstexpr foralgorithms201806L(C++20)P0202R3
      P0879R0
      LWG3256
      LWG3792
      Constexpr stable sorting202306L(C++26)P2562R1
      __cpp_lib_constexpr_atomicconstexprstd::atomic andstd::atomic_ref202411L(C++26)P3309R3
      __cpp_lib_constexpr_bitsetA moreconstexprstd::bitset202207L(C++23)P2417R2
      __cpp_lib_constexpr_charconvConstexpr forstd::to_chars andstd::from_chars for integral types202207L(C++23)P2291R3
      __cpp_lib_constexpr_cmathConstexpr for mathematical functions in<cmath> and<cstdlib>202202L(C++23)P0533R9
      Moreconstexpr for<cmath>202306L(C++26)P1383R2
      __cpp_lib_constexpr_complexConstexpr forstd::complex201711L(C++20)P0415R1
      Moreconstexpr for<complex>202306L(C++26)P1383R2
      __cpp_lib_constexpr_dequeconstexprstd::deque202502L(C++26)P3372R3
      __cpp_lib_constexpr_dynamic_allocConstexpr forstd::allocator and related utilities201907L(C++20)P0784R7
      __cpp_lib_constexpr_exceptionsconstexpr for exception types, e.g.std::bad_alloc,std::bad_cast etc.202411L(C++26)P3068R6
      Moreconstexpr for exception types202502LP3378R2
      __cpp_lib_constexpr_flat_mapconstexprstd::flat_map andstd::flat_multimap202502L(C++26)P3372R3
      __cpp_lib_constexpr_flat_setconstexprstd::flat_set andstd::flat_multiset202502L(C++26)P3372R3
      __cpp_lib_constexpr_forward_listconstexprstd::forward_list202502L(C++26)P3372R3
      __cpp_lib_constexpr_functionalMiscconstexpr bits (std::default_searcher);constexprINVOKE201907L(C++20)P1032R1
      P1065R2
      __cpp_lib_constexpr_inplace_vectorconstexprstd::inplace_vector for non-trivial types202502L(C++26)P3074R7
      __cpp_lib_constexpr_iteratorMiscconstexpr bits (std::insert_iterator et al.)201811L(C++20)P1032R1
      __cpp_lib_constexpr_listconstexprstd::list202502L(C++26)P3372R3
      __cpp_lib_constexpr_mapconstexprstd::map andstd::multimap202502L(C++26)P3372R3
      __cpp_lib_constexpr_memoryConstexpr instd::pointer_traits201811L(C++20)P1006R1
      Constexprstd::unique_ptr202202L(C++23)P2273R3
      __cpp_lib_constexpr_newConstexprplacementnew202406L(C++26)P2747R2
      __cpp_lib_constexpr_numericConstexpr foralgorithms in<numeric>201911L(C++20)P1645R1
      __cpp_lib_constexpr_queueconstexprstd::queue202502L(C++26)P3372R3
      __cpp_lib_constexpr_setconstexprstd::set andstd::multiset202502L(C++26)P3372R3
      __cpp_lib_constexpr_stackconstexprstd::stack202502L(C++26)P3372R3
      __cpp_lib_constexpr_stringconstexprstd::char_traits201611L(C++17)P0426R1
      constexprstd::string201907L(C++20)P0980R1
      __cpp_lib_constexpr_string_viewMiscconstexpr bits (std::string_view::copy)201811L(C++20)P1032R1
      __cpp_lib_constexpr_tupleMiscconstexpr bits (std::tuple::operator= et al.)201811L(C++20)P1032R1
      __cpp_lib_constexpr_typeinfoConstexpr forstd::type_info::operator==202106L(C++23)P1328R1
      __cpp_lib_constexpr_unordered_mapconstexprstd::unordered_map andstd::unordered_multimap202502L(C++26)P3372R3
      __cpp_lib_constexpr_unordered_setconstexprstd::unordered_set andstd::unordered_multiset202502L(C++26)P3372R3
      __cpp_lib_constexpr_utilityMiscconstexpr bits (std::pair::operator= et al.)201811L(C++20)P1032R1
      __cpp_lib_constexpr_vectorConstexpr forstd::vector201907L(C++20)P1004R2
      __cpp_lib_constrained_equalityConstrained relational operators forstd::pair,std::tuple,std::optional, andstd::variant202403L(C++26)P2944R3
      Constrainingstd::expectedequality operators202411LP3379R0
      __cpp_lib_containers_rangesRanges-aware construction and insertion for containers and strings202202L(C++23)P1206R7
      __cpp_lib_contracts<contracts>: Contracts support202502L(C++26)P2900R14
      __cpp_lib_copyable_functionstd::copyable_function202306L(C++26)P2548R6
      __cpp_lib_coroutineCoroutines (library support)201902L(C++20)P0912R5
      LWG3393
      __cpp_lib_debugging<debugging>:Debugging support202311L(C++26)P2546R5
      Replaceablestd::is_debugger_present202403LP2810R4
      __cpp_lib_destroying_deleteDestroyingoperator delete (library support)201806L(C++20)P0722R3
      __cpp_lib_enable_shared_from_thisstd::enable_shared_from_this::weak_from_this201603L(C++17)P0033R1
      __cpp_lib_endianstd::endian201907L(C++20)P0463R1
      P1612R1
      __cpp_lib_erase_ifUniform container erasure202002L(C++20)P1209R0
      P1115R3
      __cpp_lib_exchange_functionstd::exchange201304L(C++14)N3668
      __cpp_lib_executionExecution policies201603L(C++17)P0024R2
      std::execution::unsequenced_policy201902L(C++20)P1001R2
      __cpp_lib_expectedclass templatestd::expected202202L(C++23)P0323R12
      Monadic functions forstd::expected202211LP2505R5
      __cpp_lib_filesystemFilesystem library201703L(C++17)P0218R1
      P0219R1
      P0392R0
      P0317R1
      __cpp_lib_flat_mapstd::flat_map andstd::flat_multimap202207L(C++23)P0429R9
      __cpp_lib_flat_setstd::flat_set andstd::flat_multiset202207L(C++23)P1222R4
      LWG3751
      __cpp_lib_formatText formatting201907L(C++20)P0645R10
      P1361R2
      P1652R1
      Compile-time format string checks; Reducing parameterization ofstd::vformat_to202106L(C++23)
      (DR20)
      P2216R3
      Fixing locale handling in chrono formatters; Supporting non-const-formattable types202110LP2372R3
      P2418R2
      Exposingstd::basic_format_string; clarify handling of encodings in localized formatting of chrono types202207L(C++23)P2419R2
      P2508R1
      Formatting pointers202304L(C++26)P2510R3
      Type-checking format args202305LP2757R3
      Membervisit202306LP2637R3
      Runtime format strings202311LP2918R2
      __cpp_lib_format_pathFormatting ofstd::filesystem::path202403L(C++26)P2845R8
      __cpp_lib_format_rangesFormatting ranges202207L(C++23)P2286R8
      P2585R1
      LWG3750
      __cpp_lib_format_ucharFix formatting of code units as integers202311L(C++26)P2909R4
      __cpp_lib_formattersFormattingstd::thread::id andstd::stacktrace202302L(C++23)P2693R1
      __cpp_lib_forward_likestd::forward_like202207L(C++23)P2445R1
      __cpp_lib_freestanding_algorithmFreestanding facilities in<algorithm>202311L(C++26)P2407R5
      Freestanding library:<algorithm>202502LP2976R1
      __cpp_lib_freestanding_arrayMake parts ofstd::array freestanding202311L(C++26)P2407R5
      __cpp_lib_freestanding_char_traitsFreestandingstd::char_traits202306L(C++26)P2338R4
      __cpp_lib_freestanding_charconvFreestanding facilities in<charconv>202306L(C++26)P2338R4
      __cpp_lib_freestanding_cstdlibFreestanding facilities in<cstdlib>202306L(C++26)P2338R4
      __cpp_lib_freestanding_cstringFreestanding facilities in<cstring>202306L(C++26)P2338R4
      Removingstd::strtok from freestanding facilities202311LP2937R0
      __cpp_lib_freestanding_cwcharFreestanding facilities in<cwchar>202306L(C++26)P2338R4
      __cpp_lib_freestanding_errcFreestandingstd::errc202306L(C++26)P2338R4
      __cpp_lib_freestanding_executionFreestanding library:<execution>202502L(C++26)P2976R1
      __cpp_lib_freestanding_expectedMake parts ofstd::expected freestanding202311L(C++26)P2833R2
      __cpp_lib_freestanding_feature_test_macrosSupport for freestanding feature-test macros202306L(C++26)P2198R7
      __cpp_lib_freestanding_functionalFreestanding facilities in<functional>202306L(C++26)P2198R7
      __cpp_lib_freestanding_iteratorFreestanding facilities in<iterator>202306L(C++26)P2198R7
      __cpp_lib_freestanding_mdspanFreestandingstd::mdspan202311L(C++26)P2833R2
      __cpp_lib_freestanding_memoryFreestanding facilities in<memory>202306L(C++26)P2198R7
      Freestanding Library:<memory>202502LP2976R1
      __cpp_lib_freestanding_numericFreestanding facilities in<numeric> (saturation arithmetic)202311L(C++26)P0543R3
      Freestanding library:<numeric>202502LP2976R1
      __cpp_lib_freestanding_operator_newDefinition ofoperator new (optional in freestanding implementations)202306L(C++26)P2198R7
      __cpp_lib_freestanding_optionalMaking parts ofstd::optional freestanding202311L(C++26)P2407R5
      __cpp_lib_freestanding_randomFreestanding library:<random>202502L(C++26)P2976R1
      __cpp_lib_freestanding_rangesFreestanding facilities in<ranges>202306L(C++26)P2198R7
      __cpp_lib_freestanding_ratioFreestanding facilities in<ratio>202306L(C++26)P2198R7
      __cpp_lib_freestanding_string_viewMaking parts ofstd::string_view freestanding202311L(C++26)P2407R5
      __cpp_lib_freestanding_tupleFreestanding facilities in<tuple>202306L(C++26)P2198R7
      __cpp_lib_freestanding_utilityFreestanding facilities in<utility>202306L(C++26)P2198R7
      __cpp_lib_freestanding_variantMaking parts ofstd::variant freestanding202311L(C++26)P2407R5
      __cpp_lib_fstream_native_handleObtaining native handles from file streams202306L(C++26)P1759R6
      __cpp_lib_function_refstd::function_ref: A type-erased callable reference202306L(C++26)P0792R14
      __cpp_lib_gcd_lcmstd::gcd,std::lcm201606L(C++17)P0295R0
      __cpp_lib_generatorstd::generator: Synchronous coroutine generator for ranges202207L(C++23)P2502R2
      __cpp_lib_generic_associative_lookupHeterogeneous comparison lookup inassociative containers201304L(C++14)N3657
      __cpp_lib_generic_unordered_lookupHeterogeneous comparison lookup inunordered associative containers201811L(C++20)P0919R3
      __cpp_lib_hardened_arrayStandard library hardening(present only in hardened implementation)202502L(C++26)P3471R4
      __cpp_lib_hardened_basic_stringStandard library hardening(present only in hardened implementation)202502L(C++26)P3471R4
      __cpp_lib_hardened_basic_string_viewStandard library hardening(present only in hardened implementation)202502L(C++26)P3471R4
      __cpp_lib_hardened_bitsetStandard library hardening(present only in hardened implementation)202502L(C++26)P3471R4
      __cpp_lib_hardened_dequeStandard library hardening(present only in hardened implementation)202502L(C++26)P3471R4
      __cpp_lib_hardened_expectedStandard library hardening(present only in hardened implementation)202502L(C++26)P3471R4
      __cpp_lib_hardened_forward_listStandard library hardening(present only in hardened implementation)202502L(C++26)P3471R4
      __cpp_lib_hardened_inplace_vectorStandard library hardening(present only in hardened implementation)202502L(C++26)P3471R4
      __cpp_lib_hardened_listStandard library hardening(present only in hardened implementation)202502L(C++26)P3471R4
      __cpp_lib_hardened_mdspanStandard library hardening(present only in hardened implementation)202502L(C++26)P3471R4
      __cpp_lib_hardened_optionalStandard library hardening(present only in hardened implementation)202502L(C++26)P3471R4
      __cpp_lib_hardened_spanStandard library hardening(present only in hardened implementation)202502L(C++26)P3471R4
      __cpp_lib_hardened_valarrayStandard library hardening(present only in hardened implementation)202502L(C++26)P3471R4
      __cpp_lib_hardened_vectorStandard library hardening(present only in hardened implementation)202502L(C++26)P3471R4
      __cpp_lib_hardware_interference_sizeConstexprstd::hardware_{constructive, destructive}_interference_size201703L(C++17)P0154R1
      __cpp_lib_hive<hive>: a bucket-based container that re-uses memory locations from erased elements202502L(C++26)P0447R28
      __cpp_lib_has_unique_object_representationsstd::has_unique_object_representations201606L(C++17)P0258R2
      __cpp_lib_hazard_pointer<hazard_pointer>: Hazard pointers202306L(C++26)P2530R3
      __cpp_lib_hypot3-argument overload ofstd::hypot201603L(C++17)P0030R1
      __cpp_lib_incomplete_container_elementsMinimal incomplete type support forstd::forward_list,std::list, andstd::vector201505L(C++17)N4510
      __cpp_lib_indirectstd::indirect202502L(C++26)P3019R13
      __cpp_lib_inplace_vectorstd::inplace_vector: Dynamically-resizable vector with fixed capacity (inplace storage)202406L(C++26)P0843R14
      __cpp_lib_int_pow2Integral power-of-2 operations (std::has_single_bit,std::bit_ceil,std::bit_floor,std::bit_width)202002L(C++20)P0556R3
      P1956R1
      __cpp_lib_integer_comparison_functionsInteger comparison functions202002L(C++20)P0586R2
      __cpp_lib_integer_sequenceCompile-time integer sequences201304L(C++14)N3658
      __cpp_lib_integral_constant_callablestd::integral_constant::operator()201304L(C++14)N3545
      __cpp_lib_interpolatestd::lerp,std::midpoint201902L(C++20)P0811R3
      __cpp_lib_invokestd::invoke201411L(C++17)N4169
      __cpp_lib_invoke_rstd::invoke_r202106L(C++23)P2136R3
      __cpp_lib_ios_noreplaceSupportexclusive mode for fstreams202207L(C++23)P2467R1
      __cpp_lib_is_aggregatestd::is_aggregate201703L(C++17)LWG2911
      __cpp_lib_is_constant_evaluatedstd::is_constant_evaluated201811L(C++20)P0595R2
      __cpp_lib_is_finalstd::is_final201402L(C++14)LWG2112
      __cpp_lib_is_implicit_lifetimestd::is_implicit_lifetime202302L(C++23)P2674R1
      __cpp_lib_is_invocablestd::is_invocable,std::invoke_result201703L(C++17)P0604R0
      __cpp_lib_is_layout_compatiblestd::is_layout_compatible201907L(C++20)P0466R5
      __cpp_lib_is_nothrow_convertiblestd::is_convertible201806L(C++20)P0758R1
      LWG3356
      __cpp_lib_is_null_pointerstd::is_null_pointer201309L(C++14)
      (DR11)
      LWG2247
      __cpp_lib_is_pointer_interconvertiblePointer-interconvertibility traits:std::is_pointer_interconvertible_with_class,std::is_pointer_interconvertible_base_of201907L(C++20)P0466R5
      __cpp_lib_is_scoped_enumstd::is_scoped_enum202011L(C++23)P1048R1
      __cpp_lib_is_sufficiently_alignedstd::is_sufficiently_aligned: checks a pointer’s alignment precondition202411L(C++26)P2897R7
      __cpp_lib_is_swappable(nothrow-)swappable traits201603L(C++17)P0185R1
      __cpp_lib_is_virtual_base_ofstd::is_virtual_base_of: Type trait for detecting virtual base classes202406L(C++26)P2985R0
      __cpp_lib_is_within_lifetimeChecking if a union alternative is active (std::is_within_lifetime)202306L(C++26)P2641R4
      __cpp_lib_jthreadStop token andjoining thread201911L(C++20)P0660R10
      P1869R1
      __cpp_lib_latchstd::latch201907L(C++20)P1135R6
      __cpp_lib_launderCWG issue 1776: Replacement of class objects containing reference members (std::launder)201606L(C++17)P0137R1
      __cpp_lib_linalgA free function linear algebra interface based on the BLAS202311L(C++26)P1673R13
      __cpp_lib_list_remove_return_typeChange the return type of theremove(),remove_if() andunique() ofstd::forward_list andstd::list201806L(C++20)P0646R1
      __cpp_lib_logical_traitsLogical operations on type traits201510L(C++17)P0013R1
      __cpp_lib_make_from_tuplestd::make_from_tuple201606L(C++17)P0209R2
      __cpp_lib_make_reverse_iteratorstd::make_reverse_iterator201402L(C++14)LWG2285
      __cpp_lib_make_uniquestd::make_unique201304L(C++14)N3656
      __cpp_lib_map_try_emplacestd::map::try_emplace,std::map::insert_or_assign201411L(C++17)N4279
      __cpp_lib_math_constantsMathematical constants201907L(C++20)P0631R8
      __cpp_lib_math_special_functionsMathematical special functions201603L(C++17)P0226R1
      __cpp_lib_mdspanstd::mdspan202207L(C++23)P0009R18
      P2599R2
      P2604R0
      P2613R1
      std::dims forstd::mdspan202406L(C++26)P2389R2
      __cpp_lib_memory_resourcestd::pmr::memory_resource201603L(C++17)P0220R1
      __cpp_lib_modulesStandard library modulesstd andstd.compat202207L(C++23)P2465R3
      __cpp_lib_move_iterator_conceptMakestd::move_iterator<T*> a random access iterator202207L(C++23)P2520R0
      __cpp_lib_move_only_functionstd::move_only_function202110L(C++23)P0288R9
      __cpp_lib_node_extractSplicing maps and sets (std::map::extract,std::map::merge,insert(node_type), etc)201606L(C++17)P0083R3
      __cpp_lib_nonmember_container_accessstd::size,std::data andstd::empty201411L(C++17)N4280
      __cpp_lib_not_fnstd::not_fn201603L(C++17)P0005R4
      Allow passing callable objects as constant template arguments tostd::not_fn202306L(C++26)P2714R1
      __cpp_lib_null_iteratorsNullLegacyForwardIterators201304L(C++14)N3644
      __cpp_lib_optionalstd::optional201606L(C++17)P0220R1
      P0032R3
      P0307R2
      Fullyconstexprstd::optional202106L(C++23)
      (DR20)
      P2231R1
      Monadic operations instd::optional202110L(C++23)P0798R8
      LWG3621
      __cpp_lib_optional_range_supportstd::optional range support202406L(C++26)P3168R2
      __cpp_lib_out_ptrstd::out_ptr,std::inout_ptr202106L(C++23)P1132R8
      Freestandingstd::out_ptr,std::inout_ptr202311L(C++26)P2833R2
      __cpp_lib_parallel_algorithmParallel algorithms201603L(C++17)P0024R2
      __cpp_lib_polymorphicstd::polymorphic202502L(C++26)P3019R13
      __cpp_lib_polymorphic_allocatorstd::pmr::polymorphic_allocator<> as a vocabulary type201902L(C++20)P0339R6
      LWG3437
      __cpp_lib_printFormatted output202207L(C++23)P2093R14
      Permit an efficient implementation ofstd::print202403L(C++26)
      (DR23)
      P3107R5
      P3235R3
      Printing Blank Lines withstd::println202403L(C++26)P3142R0
      __cpp_lib_quoted_string_iostd::quoted201304L(C++14)N3654
      __cpp_lib_philox_enginestd::philox_engine: Counter-based random number engine202406L(C++26)P2075R6
      __cpp_lib_rangesRanges library andconstrained algorithms201911L(C++20)P0896R4
      P1035R7
      P1716R3
      Non-default-initializableviews202106L(C++23)
      (DR20)
      P2325R3
      Views withownership202110LP2415R2
      std::ranges::range_adaptor_closure202202L(C++23)P2387R3
      Relaxingrange adaptors to allow for move-only types202207LP2494R2
      Removing “poison pill” overloads inranges::begin,ranges::end,ranges::rbegin,ranges::rend, andranges::size202211LP2602R2
      Relaxing ranges to allow certain projections202302LP2609R3
      Removing the common reference requirement from the indirectly invocable concepts202406L(C++26)
      (DR20)
      P2997R1
      __cpp_lib_ranges_as_conststd::const_iterator,std::ranges::as_const_view202207L(C++23)P2278R4
      Makingstd::basic_const_iterator follow its underlying type's convertibility202311L(C++26)P2836R1
      __cpp_lib_ranges_as_rvaluestd::ranges::as_rvalue_view202207L(C++23)P2446R2
      __cpp_lib_ranges_cache_lateststd::ranges::cache_latest_view202411L(C++26)P3138R5
      __cpp_lib_ranges_cartesian_productstd::ranges::cartesian_product_view202207L(C++23)P2374R4
      P2540R1
      __cpp_lib_ranges_chunkstd::ranges::chunk_view202202L(C++23)P2442R1
      __cpp_lib_ranges_chunk_bystd::ranges::chunk_by_view202202L(C++23)P2443R1
      __cpp_lib_ranges_concatstd::ranges::concat_view202403L(C++26)P2542R8
      __cpp_lib_ranges_containsstd::ranges::contains202207L(C++23)P2302R4
      __cpp_lib_ranges_enumeratestd::ranges::enumerate_view202302L(C++23)P2164R9
      __cpp_lib_ranges_find_laststd::ranges::find_last,std::ranges::find_last_if, andstd::ranges::find_last_if_not202207L(C++23)P1223R5
      LWG3807
      __cpp_lib_ranges_foldstd::rangesfold algorithms202207L(C++23)P2322R6
      __cpp_lib_ranges_generate_randomVector API for random number generation (std::ranges::generate_random)202403L(C++26)P1068R11
      __cpp_lib_ranges_iotastd::ranges::iota202202L(C++23)P2440R1
      __cpp_lib_ranges_join_withstd::ranges::join_with_view202202L(C++23)P2441R2
      __cpp_lib_ranges_repeatstd::ranges::repeat_view202207L(C++23)P2474R2
      __cpp_lib_ranges_reserve_hintstd::ranges::approximately_sized_range andstd::ranges::reserve_hint202502L(C++26)P2846R6
      __cpp_lib_ranges_slidestd::ranges::slide_view202202L(C++23)P2442R1
      __cpp_lib_ranges_starts_ends_withstd::ranges::starts_with,std::ranges::ends_with202106L(C++23)P1659R3
      __cpp_lib_ranges_stridestd::ranges::stride_view202207L(C++23)P1899R3
      __cpp_lib_ranges_to_containerstd::ranges::to202202L(C++23)P1206R7
      __cpp_lib_ranges_to_inputstd::ranges::to_input_view202502L(C++26)P3137R3
      __cpp_lib_ranges_zipstd::ranges::zip_view,std::ranges::zip_transform_view,std::ranges::adjacent_view,std::ranges::adjacent_transform_view202110L(C++23)P2321R2
      __cpp_lib_ratioAdding the new 2022 SI prefixes202306L(C++26)P2734R0
      __cpp_lib_raw_memory_algorithmsExtending memory management tools201606L(C++17)P0040R3
      constexpr forspecialized memory algorithms202411L(C++26)P3508R0
      P3369R0
      __cpp_lib_rcu<rcu>: Read-Copy Update (RCU)202306L(C++26)P2545R4
      __cpp_lib_reference_from_temporarystd::reference_constructs_from_temporary andstd::reference_converts_from_temporary202202L(C++23)P2255R2
      __cpp_lib_reference_wrapperComparisons forstd::reference_wrapper202403L(C++26)P2944R3
      __cpp_lib_remove_cvrefstd::remove_cvref201711L(C++20)P0550R2
      __cpp_lib_result_of_sfinaestd::result_of andSFINAE201210L(C++14)N3462
      __cpp_lib_robust_nonmodifying_seq_opsMaking non-modifying sequence operations more robust (two-range overloads forstd::mismatch,std::equal andstd::is_permutation)201304L(C++14)N3671
      __cpp_lib_samplestd::sample201603L(C++17)P0220R1
      __cpp_lib_saturation_arithmeticSaturation arithmetic202311L(C++26)P0543R3
      __cpp_lib_scoped_lockstd::scoped_lock201703L(C++17)P0156R2
      __cpp_lib_semaphorestd::counting_semaphore,std::binary_semaphore201907L(C++20)P1135R6
      __cpp_lib_sendersstd::execution: Sender-receiver model of execution control202406L(C++26)P2300R10
      __cpp_lib_shared_mutexstd::shared_mutex (untimed)201505L(C++17)N4508
      __cpp_lib_shared_ptr_arraysstd::shared_ptr<T[]>201611L(C++17)P0497R0
      Array support ofstd::make_shared201707L(C++20)P0674R1
      __cpp_lib_shared_ptr_weak_typeshared_ptr::weak_type201606L(C++17)P0163R0
      __cpp_lib_shared_timed_mutexstd::shared_timed_mutex201402L(C++14)N3891
      __cpp_lib_shiftstd::shift_left andstd::shift_right201806L(C++20)P0769R2
      std::ranges::shift_left andstd::ranges::shift_right202202L(C++23)P2440R1
      __cpp_lib_simd<simd>:Data-parallel types202411L(C++26)P1928R15
      P3430R3
      P3441R2
      P3287R3
      P2933R4
      __cpp_lib_simd_complexSupport of interleaved complex values instd::datapar::simd202502L(C++26)P2663R7
      __cpp_lib_smart_ptr_for_overwriteSmart pointer creation with default initialization (std::allocate_shared_for_overwrite,std::make_shared_for_overwrite,std::make_unique_for_overwrite)202002L(C++20)P1020R1
      P1973R1
      __cpp_lib_smart_ptr_owner_equalityEnabling the use ofstd::weak_ptr as keys inunordered associative containers202306L(C++26)P1901R2
      __cpp_lib_source_locationSource-code information capture (std::source_location)201907L(C++20)P1208R6
      __cpp_lib_spanstd::span202002L(C++20)P0122R7
      LWG3274
      P1024R3
      P1976R2
      Making parts ofstd::span freestanding202311L(C++26)P2821R5
      P2833R2
      __cpp_lib_span_initializer_listConstructingstd::span from an initializer list202311L(C++26)P2447R6
      __cpp_lib_spanstreamstd::spanbuf,std::spanstream202106L(C++23)P0448R4
      __cpp_lib_ssizestd::ssize and unsignedstd::span::size201902L(C++20)P1227R2
      __cpp_lib_sstream_from_string_viewInterfacingstd::stringstreams withstd::string_view202306L(C++26)P2495R3
      __cpp_lib_stacktraceStacktrace library202011L(C++23)P0881R7
      __cpp_lib_start_lifetime_asExplicit lifetime management (std::start_lifetime_as)202207L(C++23)P2590R2
      __cpp_lib_starts_ends_withString prefix and suffix checking (starts_with() andends_with() forstd::string andstd::string_view)201711L(C++20)P0457R2
      __cpp_lib_stdatomic_hCompatibility header for C atomic operations202011L(C++23)P0943R6
      __cpp_lib_string_containscontains() forstd::basic_string andstd::basic_string_view202011L(C++23)P1679R3
      __cpp_lib_string_resize_and_overwritestd::basic_string::resize_and_overwrite202110L(C++23)P1072R10
      __cpp_lib_string_udlsUser-defined literals for string types201304L(C++14)N3642
      __cpp_lib_string_viewstd::string_view201606L(C++17)P0220R1
      P0254R2
      ConstexprIterator201803L(C++20)P0858R0
      LWG3257
      Concatenation ofstd::strings andstd::string_views202403L(C++26)P2591R5
      __cpp_lib_submdspanstd::submdspan202306L(C++26)P2630R4
      Padded mdspan layouts202403LP2642R6
      __cpp_lib_syncbufSynchronized buffered ostream (std::syncbuf,std::osyncstream) and manipulators201803L(C++20)P0053R7
      P0753R2
      __cpp_lib_text_encodingstd::text_encoding202306L(C++26)P1885R12
      __cpp_lib_three_way_comparisonThree-way comparison (library support); adding three-way comparison to the library201907L(C++20)P0768R1
      P1614R2
      __cpp_lib_to_addressUtility to convert a pointer to a raw pointer (std::to_address)201711L(C++20)P0653R2
      __cpp_lib_to_arraystd::to_array201907L(C++20)P0325R4
      __cpp_lib_to_charsElementary string conversions (std::to_chars,std::from_chars)201611L(C++17)P0067R5
      P0682R1
      LWG3137
      Testing for success or failure of<charconv> functions202306L(C++26)P2497R0
      __cpp_lib_to_stringRedefiningstd::to_string in terms ofstd::format202306L(C++26)P2587R3
      __cpp_lib_to_underlyingstd::to_underlying202102L(C++23)P1682R3
      __cpp_lib_transformation_trait_aliasesAlias templates fortransformation traits201304L(C++14)N3655
      __cpp_lib_transparent_operatorsTransparent operator functors (std::less<> et al)201210L(C++14)N3421
      Transparentstd::owner_less (std::owner_less<void>)201510L(C++17)P0074R0
      __cpp_lib_trivially_relocatableTrivial relocatability traits and operations202502L(C++26)P2786R13
      __cpp_lib_tuple_element_tstd::tuple_element_t201402L(C++14)N3887
      __cpp_lib_tuple_likeCompatibility betweenstd::tuple and tuple-like objects (std::pair,std::array,std::subrange)202207L(C++23)P2165R4
      Add tuple protocol tostd::complex202311L(C++26)P2819R2
      __cpp_lib_tuples_by_typeAddressing tuples by type201304L(C++14)N3670
      __cpp_lib_type_identitystd::type_identity201806L(C++20)P0887R1
      __cpp_lib_type_trait_variable_templatesType traits variable templates (std::is_void_v, etc)201510L(C++17)P0006R0
      __cpp_lib_uncaught_exceptionsstd::uncaught_exceptions201411L(C++17)N4259
      __cpp_lib_unordered_map_try_emplacestd::unordered_map::try_emplace,std::unordered_map::insert_or_assign201411L(C++17)N4279
      __cpp_lib_unreachablestd::unreachable202202L(C++23)P0627R6
      __cpp_lib_unwrap_refstd::unwrap_ref_decay andstd::unwrap_reference201811L(C++20)P0318R1
      LWG3348
      __cpp_lib_variantstd::variant: A type-safe union for C++17201606L(C++17)P0088R3
      P0393R3
      P0032R3
      std::visit for classes derived fromstd::variant202102L(C++23)
      (DR17)
      P2162R2
      Fullyconstexprstd::variant202106L(C++23)
      (DR20)
      P2231R1
      Membervisit202306L(C++26)P2637R3
      __cpp_lib_void_tstd::void_t201411L(C++17)N3911
      Total number of macros: 282

      [edit]Example

      [edit]Normal usage

      Run this code
      #ifdef __has_include                           // Check if __has_include is present#  if __has_include(<optional>)                // Check for a standard library#    include <optional>#  elif __has_include(<experimental/optional>) // Check for an experimental version#    include <experimental/optional>#  elif __has_include(<boost/optional.hpp>)    // Try with an external library#    include <boost/optional.hpp>#  else                                        // Not found at all#     error "Missing <optional>"#  endif#endif #ifdef __has_cpp_attribute                      // Check if __has_cpp_attribute is present#  if __has_cpp_attribute(deprecated)           // Check for an attribute#    define DEPRECATED(msg) [[deprecated(msg)]]#  endif#endif#ifndef DEPRECATED#    define DEPRECATED(msg)#endif DEPRECATED("foo() has been deprecated")void foo(); #if __cpp_constexpr >= 201304                // Check for a specific version of a feature#  define CONSTEXPR constexpr#else#  define CONSTEXPR inline#endif CONSTEXPRint bar(unsigned i){#if __cpp_binary_literals                    // Check for the presence of a featureunsigned mask1=0b11000000;unsigned mask2=0b00000111;#elseunsigned mask1=0xC0;unsigned mask2=0x07;#endifif(i& mask1)return1;if(i& mask2)return2;return0;} int main(){}

      [edit]Compiler Features Dump

      [edit]

      The following (C++11 compatible) program dumps C++ compiler features and attributes.Note that the use of__has_cpp_attribute() is notconformant and depends on the gcc/clang implementation.

      Run this code
      staticconstexprstruct choose_what_and_how_to_print{constexprstaticint longest_macro_name{45};constexprstaticbool titles=1;constexprstaticbool counters=1;constexprstaticbool attributes=1;constexprstaticbool standard_values=1;constexprstaticbool compiler_specific=1;constexprstaticbool core_features=1;constexprstaticbool lib_features=1;constexprstaticbool supported_features=1;constexprstaticbool unsupported_features=1;constexprstaticbool sort_by_date=0;constexprstaticbool separate_year_month=1;constexprstaticbool separated_revisions=1;constexprstaticbool latest_revisions=1;constexprstaticbool cxx98=0;constexprstaticbool cxx11=1;constexprstaticbool cxx14=1;constexprstaticbool cxx17=1;constexprstaticbool cxx20=1;constexprstaticbool cxx23=1;constexprstaticbool cxx26=1;constexprstaticbool cxx29=0;} print; #if __cplusplus < 201100#  error "C++11 or better is required"#endif #include <algorithm>#include <cstdio>#include <cstring>#include <utility>#include <vector> #ifdef __has_include# if __has_include(<version>)#   include <version># endif# if __has_include(<stdfloat>)#   include <stdfloat># endif#endif // Expect a string that starts with 6-decimal-digits or with '_' (if unsupported)#define COMPILER_VALUE_INT(n) #n [0] == '_' ? 0 : \    (#n[5] - '0') + (#n[4] - '0') * 10 + (#n[3] - '0') * 100 + \    (#n[2] - '0') * 1000 + (#n[1] - '0') * 10000 + (#n[0] - '0') * 100000#define COMPILER_FEATURE_ENTRY(expect, name) { #name, COMPILER_VALUE_INT(name), expect }, #if defined(__has_cpp_attribute) && defined(__GNUG__)# define COMPILER_ATTRIBUTE(expect, name) { #name, __has_cpp_attribute(name), expect },#else# define COMPILER_ATTRIBUTE(expect, name) { #name, COMPILER_VALUE_INT(name), expect },#endif #define COMPILER_SPECIFIC_STRING(value) #value#define COMPILER_SPECIFIC_ENTRY(name) { #name, COMPILER_SPECIFIC_STRING(name) }, class CompilerFeature{charconst* name_;long data_;long std_;public:constexpr CompilerFeature(charconst* name,long data,long std): name_(name), data_(data), std_(std){}constexpr CompilerFeature(CompilerFeatureconst&)=default;    CompilerFeature& operator=(CompilerFeatureconst&)=default;bool operator<(CompilerFeatureconst& rhs)const{returnstd::strcmp(name_, rhs.name_)<0;}bool operator==(CompilerFeatureconst& rhs)const{returnstd::strcmp(name_, rhs.name_)==0;}constexprbool supported()const{return data_>= std_;}constexprbool maybe()const{return data_>0;}constexprcharconst* name()const{return name_;}constexprlong std()const{return std_;}constexprlong data()const{return data_;}void data(long x){ data_= x;}}; // Non-FTM macros, including implementation specific ones:static/*constexpr*/std::pair<constchar*,constchar*> compiler[]={    COMPILER_SPECIFIC_ENTRY(__cplusplus)    COMPILER_SPECIFIC_ENTRY(__clang_major__)    COMPILER_SPECIFIC_ENTRY(__clang_minor__)    COMPILER_SPECIFIC_ENTRY(__clang_patchlevel__)    COMPILER_SPECIFIC_ENTRY(__GNUG__)    COMPILER_SPECIFIC_ENTRY(__GNUC_MINOR__)    COMPILER_SPECIFIC_ENTRY(__GNUC_PATCHLEVEL__)// Optional <stdfloat> fixed width floating-point types (C++23)    COMPILER_SPECIFIC_ENTRY(__STDCPP_FLOAT16_T__)    COMPILER_SPECIFIC_ENTRY(__STDCPP_FLOAT32_T__)    COMPILER_SPECIFIC_ENTRY(__STDCPP_FLOAT64_T__)    COMPILER_SPECIFIC_ENTRY(__STDCPP_FLOAT128_T__)    COMPILER_SPECIFIC_ENTRY(__STDCPP_BFLOAT16_T__)// C23 => C++26    COMPILER_SPECIFIC_ENTRY(__STDC_ENDIAN_BIG__)    COMPILER_SPECIFIC_ENTRY(__STDC_ENDIAN_LITTLE__)    COMPILER_SPECIFIC_ENTRY(__STDC_ENDIAN_NATIVE__)    COMPILER_SPECIFIC_ENTRY(__STDC_VERSION_STDBIT_H__)    COMPILER_SPECIFIC_ENTRY(__STDC_VERSION_STDCKDINT_H__)// Add your favorite implementation specific macros...    COMPILER_SPECIFIC_ENTRY(__STDCPP_DEFAULT_NEW_ALIGNMENT__)    COMPILER_SPECIFIC_ENTRY(__STDCPP_THREADS__)    COMPILER_SPECIFIC_ENTRY(__STDCPP_STRICT_POINTER_SAFETY__)    COMPILER_SPECIFIC_ENTRY(__STDC_EMBED_NOT_FOUND__)    COMPILER_SPECIFIC_ENTRY(__STDC_EMBED_FOUND__)    COMPILER_SPECIFIC_ENTRY(__STDC_EMBED_EMPTY__)    COMPILER_SPECIFIC_ENTRY(__STDC__)    COMPILER_SPECIFIC_ENTRY(__STDC_VERSION__)    COMPILER_SPECIFIC_ENTRY(__STDC_HOSTED__)    COMPILER_SPECIFIC_ENTRY(__STDC_ISO_10646__)    COMPILER_SPECIFIC_ENTRY(__STDC_MB_MIGHT_NEQ_WC__)    COMPILER_SPECIFIC_ENTRY(__DATE__)    COMPILER_SPECIFIC_ENTRY(__TIME__)}; staticconstexpr CompilerFeature cxx98_core[]={    COMPILER_FEATURE_ENTRY(199711L, __cpp_exceptions)    COMPILER_FEATURE_ENTRY(199711L, __cpp_rtti)}; staticconstexpr CompilerFeature cxx11_core[]={    COMPILER_FEATURE_ENTRY(200704L, __cpp_alias_templates)    COMPILER_FEATURE_ENTRY(200809L, __cpp_attributes)    COMPILER_FEATURE_ENTRY(200704L, __cpp_constexpr)    COMPILER_FEATURE_ENTRY(201711L, __cpp_constexpr_in_decltype)    COMPILER_FEATURE_ENTRY(200707L, __cpp_decltype)    COMPILER_FEATURE_ENTRY(200604L, __cpp_delegating_constructors)    COMPILER_FEATURE_ENTRY(201511L, __cpp_inheriting_constructors)    COMPILER_FEATURE_ENTRY(200806L, __cpp_initializer_lists)    COMPILER_FEATURE_ENTRY(200907L, __cpp_lambdas)    COMPILER_FEATURE_ENTRY(200809L, __cpp_nsdmi)    COMPILER_FEATURE_ENTRY(200907L, __cpp_range_based_for)    COMPILER_FEATURE_ENTRY(200710L, __cpp_raw_strings)    COMPILER_FEATURE_ENTRY(200710L, __cpp_ref_qualifiers)    COMPILER_FEATURE_ENTRY(200610L, __cpp_rvalue_references)    COMPILER_FEATURE_ENTRY(200410L, __cpp_static_assert)    COMPILER_FEATURE_ENTRY(200806L, __cpp_threadsafe_static_init)    COMPILER_FEATURE_ENTRY(200704L, __cpp_unicode_characters)    COMPILER_FEATURE_ENTRY(200710L, __cpp_unicode_literals)    COMPILER_FEATURE_ENTRY(200809L, __cpp_user_defined_literals)    COMPILER_FEATURE_ENTRY(200704L, __cpp_variadic_templates)}; staticconstexpr CompilerFeature cxx14_core[]={    COMPILER_FEATURE_ENTRY(201304L, __cpp_aggregate_nsdmi)    COMPILER_FEATURE_ENTRY(201304L, __cpp_binary_literals)    COMPILER_FEATURE_ENTRY(201304L, __cpp_constexpr)    COMPILER_FEATURE_ENTRY(201304L, __cpp_decltype_auto)    COMPILER_FEATURE_ENTRY(201304L, __cpp_generic_lambdas)    COMPILER_FEATURE_ENTRY(201304L, __cpp_init_captures)    COMPILER_FEATURE_ENTRY(201304L, __cpp_return_type_deduction)    COMPILER_FEATURE_ENTRY(201309L, __cpp_sized_deallocation)    COMPILER_FEATURE_ENTRY(201304L, __cpp_variable_templates)};staticconstexpr CompilerFeature cxx14_lib[]={    COMPILER_FEATURE_ENTRY(201304L, __cpp_lib_chrono_udls)    COMPILER_FEATURE_ENTRY(201309L, __cpp_lib_complex_udls)    COMPILER_FEATURE_ENTRY(201304L, __cpp_lib_exchange_function)    COMPILER_FEATURE_ENTRY(201304L, __cpp_lib_generic_associative_lookup)    COMPILER_FEATURE_ENTRY(201304L, __cpp_lib_integer_sequence)    COMPILER_FEATURE_ENTRY(201304L, __cpp_lib_integral_constant_callable)    COMPILER_FEATURE_ENTRY(201402L, __cpp_lib_is_final)    COMPILER_FEATURE_ENTRY(201309L, __cpp_lib_is_null_pointer)    COMPILER_FEATURE_ENTRY(201402L, __cpp_lib_make_reverse_iterator)    COMPILER_FEATURE_ENTRY(201304L, __cpp_lib_make_unique)    COMPILER_FEATURE_ENTRY(201304L, __cpp_lib_null_iterators)    COMPILER_FEATURE_ENTRY(201304L, __cpp_lib_quoted_string_io)    COMPILER_FEATURE_ENTRY(201210L, __cpp_lib_result_of_sfinae)    COMPILER_FEATURE_ENTRY(201304L, __cpp_lib_robust_nonmodifying_seq_ops)    COMPILER_FEATURE_ENTRY(201402L, __cpp_lib_shared_timed_mutex)    COMPILER_FEATURE_ENTRY(201304L, __cpp_lib_string_udls)    COMPILER_FEATURE_ENTRY(201304L, __cpp_lib_transformation_trait_aliases)    COMPILER_FEATURE_ENTRY(201210L, __cpp_lib_transparent_operators)    COMPILER_FEATURE_ENTRY(201402L, __cpp_lib_tuple_element_t)    COMPILER_FEATURE_ENTRY(201304L, __cpp_lib_tuples_by_type)}; staticconstexpr CompilerFeature cxx17_core[]={    COMPILER_FEATURE_ENTRY(201603L, __cpp_aggregate_bases)    COMPILER_FEATURE_ENTRY(201606L, __cpp_aligned_new)    COMPILER_FEATURE_ENTRY(201603L, __cpp_capture_star_this)    COMPILER_FEATURE_ENTRY(201603L, __cpp_constexpr)    COMPILER_FEATURE_ENTRY(201703L, __cpp_deduction_guides)    COMPILER_FEATURE_ENTRY(201411L, __cpp_enumerator_attributes)    COMPILER_FEATURE_ENTRY(201603L, __cpp_fold_expressions)    COMPILER_FEATURE_ENTRY(201606L, __cpp_guaranteed_copy_elision)    COMPILER_FEATURE_ENTRY(201603L, __cpp_hex_float)    COMPILER_FEATURE_ENTRY(201606L, __cpp_if_constexpr)    COMPILER_FEATURE_ENTRY(201606L, __cpp_inline_variables)    COMPILER_FEATURE_ENTRY(201411L, __cpp_namespace_attributes)    COMPILER_FEATURE_ENTRY(201510L, __cpp_noexcept_function_type)    COMPILER_FEATURE_ENTRY(201411L, __cpp_nontype_template_args)    COMPILER_FEATURE_ENTRY(201606L, __cpp_nontype_template_parameter_auto)    COMPILER_FEATURE_ENTRY(201603L, __cpp_range_based_for)    COMPILER_FEATURE_ENTRY(201411L, __cpp_static_assert)    COMPILER_FEATURE_ENTRY(201606L, __cpp_structured_bindings)    COMPILER_FEATURE_ENTRY(201611L, __cpp_template_template_args)    COMPILER_FEATURE_ENTRY(201611L, __cpp_variadic_using)};staticconstexpr CompilerFeature cxx17_lib[]={    COMPILER_FEATURE_ENTRY(201603L, __cpp_lib_addressof_constexpr)    COMPILER_FEATURE_ENTRY(201411L, __cpp_lib_allocator_traits_is_always_equal)    COMPILER_FEATURE_ENTRY(201606L, __cpp_lib_any)    COMPILER_FEATURE_ENTRY(201603L, __cpp_lib_apply)    COMPILER_FEATURE_ENTRY(201603L, __cpp_lib_array_constexpr)    COMPILER_FEATURE_ENTRY(201510L, __cpp_lib_as_const)    COMPILER_FEATURE_ENTRY(201603L, __cpp_lib_atomic_is_always_lock_free)    COMPILER_FEATURE_ENTRY(201505L, __cpp_lib_bool_constant)    COMPILER_FEATURE_ENTRY(201603L, __cpp_lib_boyer_moore_searcher)    COMPILER_FEATURE_ENTRY(201603L, __cpp_lib_byte)    COMPILER_FEATURE_ENTRY(201611L, __cpp_lib_chrono)    COMPILER_FEATURE_ENTRY(201603L, __cpp_lib_clamp)    COMPILER_FEATURE_ENTRY(201603L, __cpp_lib_enable_shared_from_this)    COMPILER_FEATURE_ENTRY(201603L, __cpp_lib_execution)    COMPILER_FEATURE_ENTRY(201703L, __cpp_lib_filesystem)    COMPILER_FEATURE_ENTRY(201606L, __cpp_lib_gcd_lcm)    COMPILER_FEATURE_ENTRY(201703L, __cpp_lib_hardware_interference_size)    COMPILER_FEATURE_ENTRY(201606L, __cpp_lib_has_unique_object_representations)    COMPILER_FEATURE_ENTRY(201603L, __cpp_lib_hypot)    COMPILER_FEATURE_ENTRY(201505L, __cpp_lib_incomplete_container_elements)    COMPILER_FEATURE_ENTRY(201411L, __cpp_lib_invoke)    COMPILER_FEATURE_ENTRY(201703L, __cpp_lib_is_aggregate)    COMPILER_FEATURE_ENTRY(201703L, __cpp_lib_is_invocable)    COMPILER_FEATURE_ENTRY(201603L, __cpp_lib_is_swappable)    COMPILER_FEATURE_ENTRY(201606L, __cpp_lib_launder)    COMPILER_FEATURE_ENTRY(201510L, __cpp_lib_logical_traits)    COMPILER_FEATURE_ENTRY(201606L, __cpp_lib_make_from_tuple)    COMPILER_FEATURE_ENTRY(201411L, __cpp_lib_map_try_emplace)    COMPILER_FEATURE_ENTRY(201603L, __cpp_lib_math_special_functions)    COMPILER_FEATURE_ENTRY(201603L, __cpp_lib_memory_resource)    COMPILER_FEATURE_ENTRY(201606L, __cpp_lib_node_extract)    COMPILER_FEATURE_ENTRY(201411L, __cpp_lib_nonmember_container_access)    COMPILER_FEATURE_ENTRY(201603L, __cpp_lib_not_fn)    COMPILER_FEATURE_ENTRY(201606L, __cpp_lib_optional)    COMPILER_FEATURE_ENTRY(201603L, __cpp_lib_parallel_algorithm)    COMPILER_FEATURE_ENTRY(201606L, __cpp_lib_raw_memory_algorithms)    COMPILER_FEATURE_ENTRY(201603L, __cpp_lib_sample)    COMPILER_FEATURE_ENTRY(201703L, __cpp_lib_scoped_lock)    COMPILER_FEATURE_ENTRY(201505L, __cpp_lib_shared_mutex)    COMPILER_FEATURE_ENTRY(201611L, __cpp_lib_shared_ptr_arrays)    COMPILER_FEATURE_ENTRY(201606L, __cpp_lib_shared_ptr_weak_type)    COMPILER_FEATURE_ENTRY(201606L, __cpp_lib_string_view)    COMPILER_FEATURE_ENTRY(201611L, __cpp_lib_to_chars)    COMPILER_FEATURE_ENTRY(201510L, __cpp_lib_transparent_operators)    COMPILER_FEATURE_ENTRY(201510L, __cpp_lib_type_trait_variable_templates)    COMPILER_FEATURE_ENTRY(201411L, __cpp_lib_uncaught_exceptions)    COMPILER_FEATURE_ENTRY(201411L, __cpp_lib_unordered_map_try_emplace)    COMPILER_FEATURE_ENTRY(202102L, __cpp_lib_variant)    COMPILER_FEATURE_ENTRY(201411L, __cpp_lib_void_t)}; staticconstexpr CompilerFeature cxx20_core[]={    COMPILER_FEATURE_ENTRY(201902L, __cpp_aggregate_paren_init)    COMPILER_FEATURE_ENTRY(202207L, __cpp_char8_t)    COMPILER_FEATURE_ENTRY(202002L, __cpp_concepts)    COMPILER_FEATURE_ENTRY(201806L, __cpp_conditional_explicit)    COMPILER_FEATURE_ENTRY(202211L, __cpp_consteval)    COMPILER_FEATURE_ENTRY(202002L, __cpp_constexpr)    COMPILER_FEATURE_ENTRY(201907L, __cpp_constexpr_dynamic_alloc)    COMPILER_FEATURE_ENTRY(201907L, __cpp_constinit)    COMPILER_FEATURE_ENTRY(201907L, __cpp_deduction_guides)    COMPILER_FEATURE_ENTRY(201707L, __cpp_designated_initializers)    COMPILER_FEATURE_ENTRY(201707L, __cpp_generic_lambdas)    COMPILER_FEATURE_ENTRY(201902L, __cpp_impl_coroutine)    COMPILER_FEATURE_ENTRY(201806L, __cpp_impl_destroying_delete)    COMPILER_FEATURE_ENTRY(201907L, __cpp_impl_three_way_comparison)    COMPILER_FEATURE_ENTRY(201803L, __cpp_init_captures)    COMPILER_FEATURE_ENTRY(201907L, __cpp_modules)    COMPILER_FEATURE_ENTRY(201911L, __cpp_nontype_template_args)    COMPILER_FEATURE_ENTRY(201907L, __cpp_using_enum)};staticconstexpr CompilerFeature cxx20_lib[]={    COMPILER_FEATURE_ENTRY(201811L, __cpp_lib_array_constexpr)    COMPILER_FEATURE_ENTRY(201811L, __cpp_lib_assume_aligned)    COMPILER_FEATURE_ENTRY(201907L, __cpp_lib_atomic_flag_test)    COMPILER_FEATURE_ENTRY(201711L, __cpp_lib_atomic_float)    COMPILER_FEATURE_ENTRY(201907L, __cpp_lib_atomic_lock_free_type_aliases)    COMPILER_FEATURE_ENTRY(201806L, __cpp_lib_atomic_ref)    COMPILER_FEATURE_ENTRY(201711L, __cpp_lib_atomic_shared_ptr)    COMPILER_FEATURE_ENTRY(201911L, __cpp_lib_atomic_value_initialization)    COMPILER_FEATURE_ENTRY(201907L, __cpp_lib_atomic_wait)    COMPILER_FEATURE_ENTRY(201907L, __cpp_lib_barrier)    COMPILER_FEATURE_ENTRY(201907L, __cpp_lib_bind_front)    COMPILER_FEATURE_ENTRY(201806L, __cpp_lib_bit_cast)    COMPILER_FEATURE_ENTRY(201907L, __cpp_lib_bitops)    COMPILER_FEATURE_ENTRY(201902L, __cpp_lib_bounded_array_traits)    COMPILER_FEATURE_ENTRY(201907L, __cpp_lib_char8_t)    COMPILER_FEATURE_ENTRY(201907L, __cpp_lib_chrono)    COMPILER_FEATURE_ENTRY(202002L, __cpp_lib_concepts)    COMPILER_FEATURE_ENTRY(201806L, __cpp_lib_constexpr_algorithms)    COMPILER_FEATURE_ENTRY(201711L, __cpp_lib_constexpr_complex)    COMPILER_FEATURE_ENTRY(201907L, __cpp_lib_constexpr_dynamic_alloc)    COMPILER_FEATURE_ENTRY(201907L, __cpp_lib_constexpr_functional)    COMPILER_FEATURE_ENTRY(201811L, __cpp_lib_constexpr_iterator)    COMPILER_FEATURE_ENTRY(201811L, __cpp_lib_constexpr_memory)    COMPILER_FEATURE_ENTRY(201911L, __cpp_lib_constexpr_numeric)    COMPILER_FEATURE_ENTRY(201907L, __cpp_lib_constexpr_string)    COMPILER_FEATURE_ENTRY(201811L, __cpp_lib_constexpr_string_view)    COMPILER_FEATURE_ENTRY(201811L, __cpp_lib_constexpr_tuple)    COMPILER_FEATURE_ENTRY(201811L, __cpp_lib_constexpr_utility)    COMPILER_FEATURE_ENTRY(201907L, __cpp_lib_constexpr_vector)    COMPILER_FEATURE_ENTRY(201902L, __cpp_lib_coroutine)    COMPILER_FEATURE_ENTRY(201806L, __cpp_lib_destroying_delete)    COMPILER_FEATURE_ENTRY(201907L, __cpp_lib_endian)    COMPILER_FEATURE_ENTRY(202002L, __cpp_lib_erase_if)    COMPILER_FEATURE_ENTRY(201902L, __cpp_lib_execution)    COMPILER_FEATURE_ENTRY(202110L, __cpp_lib_format)    COMPILER_FEATURE_ENTRY(201811L, __cpp_lib_generic_unordered_lookup)    COMPILER_FEATURE_ENTRY(202002L, __cpp_lib_int_pow2)    COMPILER_FEATURE_ENTRY(202002L, __cpp_lib_integer_comparison_functions)    COMPILER_FEATURE_ENTRY(201902L, __cpp_lib_interpolate)    COMPILER_FEATURE_ENTRY(201811L, __cpp_lib_is_constant_evaluated)    COMPILER_FEATURE_ENTRY(201907L, __cpp_lib_is_layout_compatible)    COMPILER_FEATURE_ENTRY(201806L, __cpp_lib_is_nothrow_convertible)    COMPILER_FEATURE_ENTRY(201907L, __cpp_lib_is_pointer_interconvertible)    COMPILER_FEATURE_ENTRY(201911L, __cpp_lib_jthread)    COMPILER_FEATURE_ENTRY(201907L, __cpp_lib_latch)    COMPILER_FEATURE_ENTRY(201806L, __cpp_lib_list_remove_return_type)    COMPILER_FEATURE_ENTRY(201907L, __cpp_lib_math_constants)    COMPILER_FEATURE_ENTRY(202106L, __cpp_lib_optional)    COMPILER_FEATURE_ENTRY(201902L, __cpp_lib_polymorphic_allocator)    COMPILER_FEATURE_ENTRY(202110L, __cpp_lib_ranges)    COMPILER_FEATURE_ENTRY(201711L, __cpp_lib_remove_cvref)    COMPILER_FEATURE_ENTRY(201907L, __cpp_lib_semaphore)    COMPILER_FEATURE_ENTRY(201707L, __cpp_lib_shared_ptr_arrays)    COMPILER_FEATURE_ENTRY(201806L, __cpp_lib_shift)    COMPILER_FEATURE_ENTRY(202002L, __cpp_lib_smart_ptr_for_overwrite)    COMPILER_FEATURE_ENTRY(201907L, __cpp_lib_source_location)    COMPILER_FEATURE_ENTRY(202002L, __cpp_lib_span)    COMPILER_FEATURE_ENTRY(201902L, __cpp_lib_ssize)    COMPILER_FEATURE_ENTRY(201711L, __cpp_lib_starts_ends_with)    COMPILER_FEATURE_ENTRY(201803L, __cpp_lib_string_view)    COMPILER_FEATURE_ENTRY(201803L, __cpp_lib_syncbuf)    COMPILER_FEATURE_ENTRY(201907L, __cpp_lib_three_way_comparison)    COMPILER_FEATURE_ENTRY(201711L, __cpp_lib_to_address)    COMPILER_FEATURE_ENTRY(201907L, __cpp_lib_to_array)    COMPILER_FEATURE_ENTRY(201806L, __cpp_lib_type_identity)    COMPILER_FEATURE_ENTRY(201811L, __cpp_lib_unwrap_ref)    COMPILER_FEATURE_ENTRY(202106L, __cpp_lib_variant)}; staticconstexpr CompilerFeature cxx23_core[]={    COMPILER_FEATURE_ENTRY(202110L, __cpp_auto_cast)    COMPILER_FEATURE_ENTRY(202211L, __cpp_constexpr)    COMPILER_FEATURE_ENTRY(202110L, __cpp_explicit_this_parameter)    COMPILER_FEATURE_ENTRY(202106L, __cpp_if_consteval)    COMPILER_FEATURE_ENTRY(202207L, __cpp_implicit_move)    COMPILER_FEATURE_ENTRY(202211L, __cpp_multidimensional_subscript)    COMPILER_FEATURE_ENTRY(202207L, __cpp_named_character_escapes)    COMPILER_FEATURE_ENTRY(202211L, __cpp_range_based_for)    COMPILER_FEATURE_ENTRY(202011L, __cpp_size_t_suffix)    COMPILER_FEATURE_ENTRY(202207L, __cpp_static_call_operator)};staticconstexpr CompilerFeature cxx23_lib[]={    COMPILER_FEATURE_ENTRY(202106L, __cpp_lib_adaptor_iterator_pair_constructor)    COMPILER_FEATURE_ENTRY(202207L, __cpp_lib_algorithm_iterator_requirements)    COMPILER_FEATURE_ENTRY(202302L, __cpp_lib_allocate_at_least)    COMPILER_FEATURE_ENTRY(202110L, __cpp_lib_associative_heterogeneous_erasure)    COMPILER_FEATURE_ENTRY(202302L, __cpp_lib_barrier)    COMPILER_FEATURE_ENTRY(202202L, __cpp_lib_bind_back)    COMPILER_FEATURE_ENTRY(202110L, __cpp_lib_byteswap)    COMPILER_FEATURE_ENTRY(202302L, __cpp_lib_common_reference)    COMPILER_FEATURE_ENTRY(202302L, __cpp_lib_common_reference_wrapper)    COMPILER_FEATURE_ENTRY(202207L, __cpp_lib_concepts)    COMPILER_FEATURE_ENTRY(202207L, __cpp_lib_constexpr_bitset)    COMPILER_FEATURE_ENTRY(202207L, __cpp_lib_constexpr_charconv)    COMPILER_FEATURE_ENTRY(202202L, __cpp_lib_constexpr_cmath)    COMPILER_FEATURE_ENTRY(202202L, __cpp_lib_constexpr_memory)    COMPILER_FEATURE_ENTRY(202106L, __cpp_lib_constexpr_typeinfo)    COMPILER_FEATURE_ENTRY(202202L, __cpp_lib_containers_ranges)    COMPILER_FEATURE_ENTRY(202211L, __cpp_lib_expected)    COMPILER_FEATURE_ENTRY(202207L, __cpp_lib_flat_map)    COMPILER_FEATURE_ENTRY(202207L, __cpp_lib_flat_set)    COMPILER_FEATURE_ENTRY(202207L, __cpp_lib_format)    COMPILER_FEATURE_ENTRY(202207L, __cpp_lib_format_ranges)    COMPILER_FEATURE_ENTRY(202302L, __cpp_lib_formatters)    COMPILER_FEATURE_ENTRY(202207L, __cpp_lib_forward_like)    COMPILER_FEATURE_ENTRY(202207L, __cpp_lib_generator)    COMPILER_FEATURE_ENTRY(202106L, __cpp_lib_invoke_r)    COMPILER_FEATURE_ENTRY(202207L, __cpp_lib_ios_noreplace)    COMPILER_FEATURE_ENTRY(202302L, __cpp_lib_is_implicit_lifetime)    COMPILER_FEATURE_ENTRY(202011L, __cpp_lib_is_scoped_enum)    COMPILER_FEATURE_ENTRY(202207L, __cpp_lib_mdspan)    COMPILER_FEATURE_ENTRY(202207L, __cpp_lib_modules)    COMPILER_FEATURE_ENTRY(202207L, __cpp_lib_move_iterator_concept)    COMPILER_FEATURE_ENTRY(202110L, __cpp_lib_move_only_function)    COMPILER_FEATURE_ENTRY(202110L, __cpp_lib_optional)    COMPILER_FEATURE_ENTRY(202106L, __cpp_lib_out_ptr)    COMPILER_FEATURE_ENTRY(202207L, __cpp_lib_print)    COMPILER_FEATURE_ENTRY(202302L, __cpp_lib_ranges)    COMPILER_FEATURE_ENTRY(202207L, __cpp_lib_ranges_as_const)    COMPILER_FEATURE_ENTRY(202207L, __cpp_lib_ranges_as_rvalue)    COMPILER_FEATURE_ENTRY(202207L, __cpp_lib_ranges_cartesian_product)    COMPILER_FEATURE_ENTRY(202202L, __cpp_lib_ranges_chunk)    COMPILER_FEATURE_ENTRY(202202L, __cpp_lib_ranges_chunk_by)    COMPILER_FEATURE_ENTRY(202207L, __cpp_lib_ranges_contains)    COMPILER_FEATURE_ENTRY(202302L, __cpp_lib_ranges_enumerate)    COMPILER_FEATURE_ENTRY(202207L, __cpp_lib_ranges_find_last)    COMPILER_FEATURE_ENTRY(202207L, __cpp_lib_ranges_fold)    COMPILER_FEATURE_ENTRY(202202L, __cpp_lib_ranges_iota)    COMPILER_FEATURE_ENTRY(202202L, __cpp_lib_ranges_join_with)    COMPILER_FEATURE_ENTRY(202207L, __cpp_lib_ranges_repeat)    COMPILER_FEATURE_ENTRY(202202L, __cpp_lib_ranges_slide)    COMPILER_FEATURE_ENTRY(202106L, __cpp_lib_ranges_starts_ends_with)    COMPILER_FEATURE_ENTRY(202207L, __cpp_lib_ranges_stride)    COMPILER_FEATURE_ENTRY(202202L, __cpp_lib_ranges_to_container)    COMPILER_FEATURE_ENTRY(202110L, __cpp_lib_ranges_zip)    COMPILER_FEATURE_ENTRY(202202L, __cpp_lib_reference_from_temporary)    COMPILER_FEATURE_ENTRY(202202L, __cpp_lib_shift)    COMPILER_FEATURE_ENTRY(202106L, __cpp_lib_spanstream)    COMPILER_FEATURE_ENTRY(202011L, __cpp_lib_stacktrace)    COMPILER_FEATURE_ENTRY(202207L, __cpp_lib_start_lifetime_as)    COMPILER_FEATURE_ENTRY(202011L, __cpp_lib_stdatomic_h)    COMPILER_FEATURE_ENTRY(202011L, __cpp_lib_string_contains)    COMPILER_FEATURE_ENTRY(202110L, __cpp_lib_string_resize_and_overwrite)    COMPILER_FEATURE_ENTRY(202102L, __cpp_lib_to_underlying)    COMPILER_FEATURE_ENTRY(202207L, __cpp_lib_tuple_like)    COMPILER_FEATURE_ENTRY(202202L, __cpp_lib_unreachable)}; staticconstexpr CompilerFeature cxx26_core[]={//< Continue to Populate    COMPILER_FEATURE_ENTRY(202406L, __cpp_constexpr)    COMPILER_FEATURE_ENTRY(202411L, __cpp_constexpr_exceptions)    COMPILER_FEATURE_ENTRY(202502L, __cpp_contracts)    COMPILER_FEATURE_ENTRY(202403L, __cpp_deleted_function)    COMPILER_FEATURE_ENTRY(202406L, __cpp_fold_expressions)    COMPILER_FEATURE_ENTRY(202311L, __cpp_pack_indexing)    COMPILER_FEATURE_ENTRY(202306L, __cpp_placeholder_variables)    COMPILER_FEATURE_ENTRY(202502L, __cpp_pp_embed)    COMPILER_FEATURE_ENTRY(202306L, __cpp_static_assert)    COMPILER_FEATURE_ENTRY(202411L, __cpp_structured_bindings)    COMPILER_FEATURE_ENTRY(202502L, __cpp_template_parameters)    COMPILER_FEATURE_ENTRY(202502L, __cpp_trivial_relocatability)    COMPILER_FEATURE_ENTRY(202502L, __cpp_trivial_union)    COMPILER_FEATURE_ENTRY(202403L, __cpp_variadic_friend)};staticconstexpr CompilerFeature cxx26_lib[]={//< Continue to Populate    COMPILER_FEATURE_ENTRY(202403L, __cpp_lib_algorithm_default_value_type)    COMPILER_FEATURE_ENTRY(202411L, __cpp_lib_aligned_accessor)    COMPILER_FEATURE_ENTRY(202311L, __cpp_lib_associative_heterogeneous_insertion)    COMPILER_FEATURE_ENTRY(202403L, __cpp_lib_atomic_min_max)    COMPILER_FEATURE_ENTRY(202411L, __cpp_lib_atomic_ref)    COMPILER_FEATURE_ENTRY(202306L, __cpp_lib_bind_back)    COMPILER_FEATURE_ENTRY(202306L, __cpp_lib_bind_front)    COMPILER_FEATURE_ENTRY(202306L, __cpp_lib_bitset)    COMPILER_FEATURE_ENTRY(202306L, __cpp_lib_chrono)    COMPILER_FEATURE_ENTRY(202306L, __cpp_lib_constexpr_algorithms)    COMPILER_FEATURE_ENTRY(202411L, __cpp_lib_constexpr_atomic)    COMPILER_FEATURE_ENTRY(202306L, __cpp_lib_constexpr_cmath)    COMPILER_FEATURE_ENTRY(202306L, __cpp_lib_constexpr_complex)    COMPILER_FEATURE_ENTRY(202502L, __cpp_lib_constexpr_deque)    COMPILER_FEATURE_ENTRY(202502L, __cpp_lib_constexpr_exceptions)    COMPILER_FEATURE_ENTRY(202502L, __cpp_lib_constexpr_flat_map)    COMPILER_FEATURE_ENTRY(202502L, __cpp_lib_constexpr_flat_set)    COMPILER_FEATURE_ENTRY(202502L, __cpp_lib_constexpr_forward_list)    COMPILER_FEATURE_ENTRY(202502L, __cpp_lib_constexpr_inplace_vector)    COMPILER_FEATURE_ENTRY(202502L, __cpp_lib_constexpr_list)    COMPILER_FEATURE_ENTRY(202502L, __cpp_lib_constexpr_map)    COMPILER_FEATURE_ENTRY(202406L, __cpp_lib_constexpr_new)    COMPILER_FEATURE_ENTRY(202502L, __cpp_lib_constexpr_queue)    COMPILER_FEATURE_ENTRY(202502L, __cpp_lib_constexpr_set)    COMPILER_FEATURE_ENTRY(202502L, __cpp_lib_constexpr_stack)    COMPILER_FEATURE_ENTRY(202502L, __cpp_lib_constexpr_unordered_map)    COMPILER_FEATURE_ENTRY(202502L, __cpp_lib_constexpr_unordered_set)    COMPILER_FEATURE_ENTRY(202411L, __cpp_lib_constrained_equality)    COMPILER_FEATURE_ENTRY(202502L, __cpp_lib_contracts)    COMPILER_FEATURE_ENTRY(202306L, __cpp_lib_copyable_function)    COMPILER_FEATURE_ENTRY(202403L, __cpp_lib_debugging)    COMPILER_FEATURE_ENTRY(202311L, __cpp_lib_format)    COMPILER_FEATURE_ENTRY(202403L, __cpp_lib_format_path)    COMPILER_FEATURE_ENTRY(202311L, __cpp_lib_format_uchar)    COMPILER_FEATURE_ENTRY(202502L, __cpp_lib_freestanding_algorithm)    COMPILER_FEATURE_ENTRY(202311L, __cpp_lib_freestanding_array)    COMPILER_FEATURE_ENTRY(202306L, __cpp_lib_freestanding_char_traits)    COMPILER_FEATURE_ENTRY(202306L, __cpp_lib_freestanding_charconv)    COMPILER_FEATURE_ENTRY(202306L, __cpp_lib_freestanding_cstdlib)    COMPILER_FEATURE_ENTRY(202311L, __cpp_lib_freestanding_cstring)    COMPILER_FEATURE_ENTRY(202306L, __cpp_lib_freestanding_cwchar)    COMPILER_FEATURE_ENTRY(202306L, __cpp_lib_freestanding_errc)    COMPILER_FEATURE_ENTRY(202502L, __cpp_lib_freestanding_execution)    COMPILER_FEATURE_ENTRY(202311L, __cpp_lib_freestanding_expected)    COMPILER_FEATURE_ENTRY(202306L, __cpp_lib_freestanding_feature_test_macros)    COMPILER_FEATURE_ENTRY(202306L, __cpp_lib_freestanding_functional)    COMPILER_FEATURE_ENTRY(202306L, __cpp_lib_freestanding_iterator)    COMPILER_FEATURE_ENTRY(202311L, __cpp_lib_freestanding_mdspan)    COMPILER_FEATURE_ENTRY(202502L, __cpp_lib_freestanding_memory)    COMPILER_FEATURE_ENTRY(202502L, __cpp_lib_freestanding_numeric)    COMPILER_FEATURE_ENTRY(202306L, __cpp_lib_freestanding_operator_new)    COMPILER_FEATURE_ENTRY(202311L, __cpp_lib_freestanding_optional)    COMPILER_FEATURE_ENTRY(202502L, __cpp_lib_freestanding_random)    COMPILER_FEATURE_ENTRY(202306L, __cpp_lib_freestanding_ranges)    COMPILER_FEATURE_ENTRY(202306L, __cpp_lib_freestanding_ratio)    COMPILER_FEATURE_ENTRY(202311L, __cpp_lib_freestanding_string_view)    COMPILER_FEATURE_ENTRY(202306L, __cpp_lib_freestanding_tuple)    COMPILER_FEATURE_ENTRY(202306L, __cpp_lib_freestanding_utility)    COMPILER_FEATURE_ENTRY(202311L, __cpp_lib_freestanding_variant)    COMPILER_FEATURE_ENTRY(202306L, __cpp_lib_fstream_native_handle)    COMPILER_FEATURE_ENTRY(202306L, __cpp_lib_function_ref)    COMPILER_FEATURE_ENTRY(202502L, __cpp_lib_hardened_array)    COMPILER_FEATURE_ENTRY(202502L, __cpp_lib_hardened_basic_string)    COMPILER_FEATURE_ENTRY(202502L, __cpp_lib_hardened_basic_string_view)    COMPILER_FEATURE_ENTRY(202502L, __cpp_lib_hardened_bitset)    COMPILER_FEATURE_ENTRY(202502L, __cpp_lib_hardened_deque)    COMPILER_FEATURE_ENTRY(202502L, __cpp_lib_hardened_expected)    COMPILER_FEATURE_ENTRY(202502L, __cpp_lib_hardened_forward_list)    COMPILER_FEATURE_ENTRY(202502L, __cpp_lib_hardened_inplace_vector)    COMPILER_FEATURE_ENTRY(202502L, __cpp_lib_hardened_list)    COMPILER_FEATURE_ENTRY(202502L, __cpp_lib_hardened_mdspan)    COMPILER_FEATURE_ENTRY(202502L, __cpp_lib_hardened_optional)    COMPILER_FEATURE_ENTRY(202502L, __cpp_lib_hardened_span)    COMPILER_FEATURE_ENTRY(202502L, __cpp_lib_hardened_valarray)    COMPILER_FEATURE_ENTRY(202502L, __cpp_lib_hardened_vector)    COMPILER_FEATURE_ENTRY(202306L, __cpp_lib_hazard_pointer)    COMPILER_FEATURE_ENTRY(202502L, __cpp_lib_hive)    COMPILER_FEATURE_ENTRY(202502L, __cpp_lib_indirect)    COMPILER_FEATURE_ENTRY(202406L, __cpp_lib_inplace_vector)    COMPILER_FEATURE_ENTRY(202411L, __cpp_lib_is_sufficiently_aligned)    COMPILER_FEATURE_ENTRY(202406L, __cpp_lib_is_virtual_base_of)    COMPILER_FEATURE_ENTRY(202306L, __cpp_lib_is_within_lifetime)    COMPILER_FEATURE_ENTRY(202311L, __cpp_lib_linalg)    COMPILER_FEATURE_ENTRY(202406L, __cpp_lib_mdspan)    COMPILER_FEATURE_ENTRY(202306L, __cpp_lib_not_fn)    COMPILER_FEATURE_ENTRY(202406L, __cpp_lib_optional_range_support)    COMPILER_FEATURE_ENTRY(202311L, __cpp_lib_out_ptr)    COMPILER_FEATURE_ENTRY(202406L, __cpp_lib_philox_engine)    COMPILER_FEATURE_ENTRY(202502L, __cpp_lib_polymorphic)    COMPILER_FEATURE_ENTRY(202403L, __cpp_lib_print)    COMPILER_FEATURE_ENTRY(202406L, __cpp_lib_ranges)    COMPILER_FEATURE_ENTRY(202311L, __cpp_lib_ranges_as_const)    COMPILER_FEATURE_ENTRY(202411L, __cpp_lib_ranges_cache_latest)    COMPILER_FEATURE_ENTRY(202403L, __cpp_lib_ranges_concat)    COMPILER_FEATURE_ENTRY(202403L, __cpp_lib_ranges_generate_random)    COMPILER_FEATURE_ENTRY(202502L, __cpp_lib_ranges_reserve_hint)    COMPILER_FEATURE_ENTRY(202502L, __cpp_lib_ranges_to_input)    COMPILER_FEATURE_ENTRY(202306L, __cpp_lib_ratio)    COMPILER_FEATURE_ENTRY(202411L, __cpp_lib_raw_memory_algorithms)    COMPILER_FEATURE_ENTRY(202306L, __cpp_lib_rcu)    COMPILER_FEATURE_ENTRY(202403L, __cpp_lib_reference_wrapper)    COMPILER_FEATURE_ENTRY(202311L, __cpp_lib_saturation_arithmetic)    COMPILER_FEATURE_ENTRY(202406L, __cpp_lib_senders)    COMPILER_FEATURE_ENTRY(202411L, __cpp_lib_simd)    COMPILER_FEATURE_ENTRY(202502L, __cpp_lib_simd_complex)    COMPILER_FEATURE_ENTRY(202306L, __cpp_lib_smart_ptr_owner_equality)    COMPILER_FEATURE_ENTRY(202311L, __cpp_lib_span)    COMPILER_FEATURE_ENTRY(202311L, __cpp_lib_span_initializer_list)    COMPILER_FEATURE_ENTRY(202306L, __cpp_lib_sstream_from_string_view)    COMPILER_FEATURE_ENTRY(202403L, __cpp_lib_string_view)    COMPILER_FEATURE_ENTRY(202403L, __cpp_lib_submdspan)    COMPILER_FEATURE_ENTRY(202306L, __cpp_lib_text_encoding)    COMPILER_FEATURE_ENTRY(202306L, __cpp_lib_to_chars)    COMPILER_FEATURE_ENTRY(202306L, __cpp_lib_to_string)    COMPILER_FEATURE_ENTRY(202502L, __cpp_lib_trivially_relocatable)    COMPILER_FEATURE_ENTRY(202311L, __cpp_lib_tuple_like)    COMPILER_FEATURE_ENTRY(202306L, __cpp_lib_variant)}; staticconstexpr CompilerFeature cxx29_core[]={//< Continue to Populate    COMPILER_FEATURE_ENTRY(202604L, __cpp_core_TODO)};staticconstexpr CompilerFeature cxx29_lib[]={//< Continue to Populate    COMPILER_FEATURE_ENTRY(202604L, __cpp_lib_TODO)}; staticconstexpr CompilerFeature attributes[]={    COMPILER_ATTRIBUTE(202207L, assume)    COMPILER_ATTRIBUTE(200809L, carries_dependency)    COMPILER_ATTRIBUTE(201309L, deprecated)    COMPILER_ATTRIBUTE(201603L, fallthrough)    COMPILER_ATTRIBUTE(202403L, indeterminate)    COMPILER_ATTRIBUTE(201803L, likely)    COMPILER_ATTRIBUTE(201603L, maybe_unused)    COMPILER_ATTRIBUTE(201803L, no_unique_address)    COMPILER_ATTRIBUTE(201907L, nodiscard)    COMPILER_ATTRIBUTE(200809L, noreturn)    COMPILER_ATTRIBUTE(201803L, unlikely)}; inlinevoid show_compiler_specific_info(){std::printf("OTHER MACROS:\n");for(auto co: compiler)if(std::strcmp(co.first, co.second))std::printf("%*s %s\n",-print.longest_macro_name, co.first, co.second);} inlinevoid print_compiler_feature(const CompilerFeature& x){if(not((print.supported_features and x.maybe()) or(print.unsupported_features and not x.maybe())))return;auto print_year_month=[](long n){returnstd::printf("%ld%s%02ld",            n/100, print.separate_year_month?"-":"", n%100);};std::printf("%*s ",-print.longest_macro_name, x.name());    x.maybe()? print_year_month(x.data()):std::printf("------%s", print.separate_year_month?"-":"");if(print.standard_values)std::printf("  %c  ",(x.supported()?(x.data()> x.std()?'>':'='):'<')),            print_year_month(x.std());std::puts("");} template<class Container>inlinevoid show(charconst*const title, Containerconst& co){if(print.titles){std::printf("%-s (", title);if(print.counters){std::printf("%zd/",std::count_if(std::begin(co),std::end(co),[](CompilerFeature x){return x.supported();}));}std::printf("%td)\n",std::distance(std::begin(co),std::end(co)));}if(print.sort_by_date){std::vector<CompilerFeature> v(std::begin(co),std::end(co));std::stable_sort(v.begin(), v.end(),[](CompilerFeatureconst& lhs, CompilerFeatureconst& rhs){return lhs.data()< rhs.data();});std::for_each(v.cbegin(), v.cend(), print_compiler_feature);}elsestd::for_each(std::begin(co),std::end(co), print_compiler_feature);std::puts("");} inlinevoid show_latest(){auto latest_rev=[]()->int{return print.cxx29?29: print.cxx26?26: print.cxx23?23: print.cxx20?20:               print.cxx17?17: print.cxx14?14: print.cxx11?11:98;};std::vector<CompilerFeature> latest;auto add=[&latest](CompilerFeature x){auto i=std::lower_bound(latest.begin(), latest.end(), x);if(i== latest.end() or not(*i== x))            latest.insert(i, x);elseif(i->data()< x.data())            i->data(x.data());};char text[64];    latest.reserve(512);// max macrosif(print.core_features){// preserve reverse revision insertion order!if(print.cxx29)std::for_each(std::begin(cxx29_core),std::end(cxx29_core), add);if(print.cxx26)std::for_each(std::begin(cxx26_core),std::end(cxx26_core), add);if(print.cxx23)std::for_each(std::begin(cxx23_core),std::end(cxx23_core), add);if(print.cxx20)std::for_each(std::begin(cxx20_core),std::end(cxx20_core), add);if(print.cxx17)std::for_each(std::begin(cxx17_core),std::end(cxx17_core), add);if(print.cxx14)std::for_each(std::begin(cxx14_core),std::end(cxx14_core), add);if(print.cxx11)std::for_each(std::begin(cxx11_core),std::end(cxx11_core), add);if(print.cxx98)std::for_each(std::begin(cxx98_core),std::end(cxx98_core), add);std::snprintf(text, sizeof text,"ALL CORE MACROS UP TO C++%02i", latest_rev());        show(text, latest);}    latest.clear();if(print.lib_features){// preserve reverse revision insertion order!if(print.cxx29)std::for_each(std::begin(cxx29_lib),std::end(cxx29_lib), add);if(print.cxx26)std::for_each(std::begin(cxx26_lib),std::end(cxx26_lib), add);if(print.cxx23)std::for_each(std::begin(cxx23_lib),std::end(cxx23_lib), add);if(print.cxx20)std::for_each(std::begin(cxx20_lib),std::end(cxx20_lib), add);if(print.cxx17)std::for_each(std::begin(cxx17_lib),std::end(cxx17_lib), add);if(print.cxx14)std::for_each(std::begin(cxx14_lib),std::end(cxx14_lib), add);std::snprintf(text, sizeof text,"ALL LIB MACROS UP TO C++%02i", latest_rev());        show(text, latest);}} int main(){if(print.separated_revisions){if(print.cxx98 and print.core_features) show("C++98 CORE", cxx98_core);if(print.cxx11 and print.core_features) show("C++11 CORE", cxx11_core);if(print.cxx14 and print.core_features) show("C++14 CORE", cxx14_core);if(print.cxx14 and print.lib_features) show("C++14 LIB" , cxx14_lib);if(print.cxx17 and print.core_features) show("C++17 CORE", cxx17_core);if(print.cxx17 and print.lib_features) show("C++17 LIB" , cxx17_lib);if(print.cxx20 and print.core_features) show("C++20 CORE", cxx20_core);if(print.cxx20 and print.lib_features) show("C++20 LIB" , cxx20_lib);if(print.cxx23 and print.core_features) show("C++23 CORE", cxx23_core);if(print.cxx23 and print.lib_features) show("C++23 LIB" , cxx23_lib);if(print.cxx26 and print.core_features) show("C++26 CORE", cxx26_core);if(print.cxx26 and print.lib_features) show("C++26 LIB" , cxx26_lib);if(print.cxx29 and print.core_features) show("C++29 CORE", cxx29_core);if(print.cxx29 and print.lib_features) show("C++29 LIB" , cxx29_lib);}if(print.latest_revisions) show_latest();if(print.attributes) show("ATTRIBUTES", attributes);if(print.compiler_specific) show_compiler_specific_info();}

      Possible output:

      C++11 CORE (20/20)__cpp_alias_templates                         2007-04  =  2007-04__cpp_attributes                              2008-09  =  2008-09__cpp_constexpr                               2022-11  >  2007-04__cpp_constexpr_in_decltype                   2017-11  =  2017-11... truncated ... C++14 CORE (9/9)__cpp_aggregate_nsdmi                         2013-04  =  2013-04__cpp_binary_literals                         2013-04  =  2013-04__cpp_constexpr                               2022-11  >  2013-04... truncated ... C++14 LIB (20/20)__cpp_lib_chrono_udls                         2013-04  =  2013-04__cpp_lib_complex_udls                        2013-09  =  2013-09__cpp_lib_exchange_function                   2013-04  =  2013-04... truncated ... ... truncated ... C++23 LIB (43/64)__cpp_lib_adaptor_iterator_pair_constructor   2021-06  =  2021-06__cpp_lib_algorithm_iterator_requirements     -------  <  2022-07__cpp_lib_allocate_at_least                   -------  <  2023-02__cpp_lib_associative_heterogeneous_erasure   -------  <  2021-10__cpp_lib_barrier                             2019-07  <  2023-02... truncated ... ALL CORE MACROS UP TO C++26 (60/76)__cpp_aggregate_bases                         2016-03  =  2016-03__cpp_aggregate_nsdmi                         2013-04  =  2013-04__cpp_aggregate_paren_init                    2019-02  =  2019-02__cpp_alias_templates                         2007-04  =  2007-04... truncated ... ALL LIB MACROS UP TO C++26 (158/282)__cpp_lib_adaptor_iterator_pair_constructor   2021-06  =  2021-06__cpp_lib_addressof_constexpr                 2016-03  =  2016-03__cpp_lib_algorithm_iterator_requirements     -------  <  2022-07__cpp_lib_allocate_at_least                   -------  <  2023-02__cpp_lib_allocator_traits_is_always_equal    2014-11  =  2014-11... truncated ... ATTRIBUTES (9/11)assume                                        2022-07  =  2022-07carries_dependency                            -------  <  2008-09deprecated                                    2013-09  =  2013-09fallthrough                                   2016-03  =  2016-03... truncated ... OTHER MACROS:__cplusplus                                   202302L__GNUG__                                      14__GNUC_MINOR__                                2__GNUC_PATCHLEVEL__                           0__STDCPP_FLOAT16_T__                          1__STDCPP_FLOAT32_T__                          1... truncated ...

      [edit]Defect reports

      The following behavior-changing defect reports were applied retroactively to previously published C++ standards.

      DRApplied toBehavior as publishedCorrect behavior
      P2552R3C++20__has_cpp_attribute must expand to a non-zero value for standard attributescan expand to0

      [edit]See also

      Library feature-test macros(C++20) defined in the header<version>
      Predefined Macro Symbols
      Macro Symbol Index

      [edit]External links

      1. The official document on Feature-Test Recommendations
      2. Source code to dump compiler features
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/feature_test&oldid=181158"

      [8]ページ先頭

      ©2009-2025 Movatter.jp