检测并打印C++编译器支持的feature(附Visual Studio 2022和gcc-12测试、对比结果)

news2024/11/18 17:39:37

C++标准快速迭代,不同的系统平台和编译器对C++各种新功能的支持不同,通过这个程序可以测试所用编译器对各个版本C++的支持情况。另一方面,可以在代码中通过这些宏针对不同版本编写不同的代码分支。
源码下面附上Visual Studio 2022的测试结果,基本上在2021年中就把C++23(当时还是草案)大部分功能都支持了。

测试代码

测试代码引用网址:https://en.cppreference.com/w/cpp/feature_test

#if __cplusplus < 201100
#  error "C++11 or better is required"
#endif

#include <algorithm>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <string>

#ifdef __has_include
# if __has_include(<version>)
#   include <version>
# endif
#endif

#define COMPILER_FEATURE_VALUE(value) #value
#define COMPILER_FEATURE_ENTRY(name) { #name, COMPILER_FEATURE_VALUE(name) },

#ifdef __has_cpp_attribute
# define COMPILER_ATTRIBUTE_VALUE_AS_STRING(s) #s
# define COMPILER_ATTRIBUTE_AS_NUMBER(x) COMPILER_ATTRIBUTE_VALUE_AS_STRING(x)
# define COMPILER_ATTRIBUTE_ENTRY(attr) \
  { #attr, COMPILER_ATTRIBUTE_AS_NUMBER(__has_cpp_attribute(attr)) },
#else
# define COMPILER_ATTRIBUTE_ENTRY(attr) { #attr, "_" },
#endif

// 更改这些选项以仅打印所需的信息。
static struct PrintOptions {
    constexpr static bool titles               = 1;
    constexpr static bool attributes           = 1;
    constexpr static bool general_features     = 1;
    constexpr static bool core_features        = 1;
    constexpr static bool lib_features         = 1;
    constexpr static bool supported_features   = 1;
    constexpr static bool unsupported_features = 1;
    constexpr static bool sorted_by_value      = 0;
    constexpr static bool cxx11                = 1;
    constexpr static bool cxx14                = 1;
    constexpr static bool cxx17                = 1;
    constexpr static bool cxx20                = 1;
    constexpr static bool cxx23                = 1;
}   print;

struct CompilerFeature {
    CompilerFeature(const char* name = nullptr, const char* value = nullptr)
            : name(name), value(value) {}
    const char* name; const char* value;
};

static CompilerFeature cxx[] = {
        COMPILER_FEATURE_ENTRY(__cplusplus)
        COMPILER_FEATURE_ENTRY(__cpp_exceptions)
        COMPILER_FEATURE_ENTRY(__cpp_rtti)
#if 0
        COMPILER_FEATURE_ENTRY(__GNUC__)
COMPILER_FEATURE_ENTRY(__GNUC_MINOR__)
COMPILER_FEATURE_ENTRY(__GNUC_PATCHLEVEL__)
COMPILER_FEATURE_ENTRY(__GNUG__)
COMPILER_FEATURE_ENTRY(__clang__)
COMPILER_FEATURE_ENTRY(__clang_major__)
COMPILER_FEATURE_ENTRY(__clang_minor__)
COMPILER_FEATURE_ENTRY(__clang_patchlevel__)
#endif
};
static CompilerFeature cxx11[] = {
        COMPILER_FEATURE_ENTRY(__cpp_alias_templates)
        COMPILER_FEATURE_ENTRY(__cpp_attributes)
        COMPILER_FEATURE_ENTRY(__cpp_constexpr)
        COMPILER_FEATURE_ENTRY(__cpp_decltype)
        COMPILER_FEATURE_ENTRY(__cpp_delegating_constructors)
        COMPILER_FEATURE_ENTRY(__cpp_inheriting_constructors)
        COMPILER_FEATURE_ENTRY(__cpp_initializer_lists)
        COMPILER_FEATURE_ENTRY(__cpp_lambdas)
        COMPILER_FEATURE_ENTRY(__cpp_nsdmi)
        COMPILER_FEATURE_ENTRY(__cpp_range_based_for)
        COMPILER_FEATURE_ENTRY(__cpp_raw_strings)
        COMPILER_FEATURE_ENTRY(__cpp_ref_qualifiers)
        COMPILER_FEATURE_ENTRY(__cpp_rvalue_references)
        COMPILER_FEATURE_ENTRY(__cpp_static_assert)
        COMPILER_FEATURE_ENTRY(__cpp_threadsafe_static_init)
        COMPILER_FEATURE_ENTRY(__cpp_unicode_characters)
        COMPILER_FEATURE_ENTRY(__cpp_unicode_literals)
        COMPILER_FEATURE_ENTRY(__cpp_user_defined_literals)
        COMPILER_FEATURE_ENTRY(__cpp_variadic_templates)
};
static CompilerFeature cxx14[] = {
        COMPILER_FEATURE_ENTRY(__cpp_aggregate_nsdmi)
        COMPILER_FEATURE_ENTRY(__cpp_binary_literals)
        COMPILER_FEATURE_ENTRY(__cpp_constexpr)
        COMPILER_FEATURE_ENTRY(__cpp_decltype_auto)
        COMPILER_FEATURE_ENTRY(__cpp_generic_lambdas)
        COMPILER_FEATURE_ENTRY(__cpp_init_captures)
        COMPILER_FEATURE_ENTRY(__cpp_return_type_deduction)
        COMPILER_FEATURE_ENTRY(__cpp_sized_deallocation)
        COMPILER_FEATURE_ENTRY(__cpp_variable_templates)
};
static CompilerFeature cxx14lib[] = {
        COMPILER_FEATURE_ENTRY(__cpp_lib_chrono_udls)
        COMPILER_FEATURE_ENTRY(__cpp_lib_complex_udls)
        COMPILER_FEATURE_ENTRY(__cpp_lib_exchange_function)
        COMPILER_FEATURE_ENTRY(__cpp_lib_generic_associative_lookup)
        COMPILER_FEATURE_ENTRY(__cpp_lib_integer_sequence)
        COMPILER_FEATURE_ENTRY(__cpp_lib_integral_constant_callable)
        COMPILER_FEATURE_ENTRY(__cpp_lib_is_final)
        COMPILER_FEATURE_ENTRY(__cpp_lib_is_null_pointer)
        COMPILER_FEATURE_ENTRY(__cpp_lib_make_reverse_iterator)
        COMPILER_FEATURE_ENTRY(__cpp_lib_make_unique)
        COMPILER_FEATURE_ENTRY(__cpp_lib_null_iterators)
        COMPILER_FEATURE_ENTRY(__cpp_lib_quoted_string_io)
        COMPILER_FEATURE_ENTRY(__cpp_lib_result_of_sfinae)
        COMPILER_FEATURE_ENTRY(__cpp_lib_robust_nonmodifying_seq_ops)
        COMPILER_FEATURE_ENTRY(__cpp_lib_shared_timed_mutex)
        COMPILER_FEATURE_ENTRY(__cpp_lib_string_udls)
        COMPILER_FEATURE_ENTRY(__cpp_lib_transformation_trait_aliases)
        COMPILER_FEATURE_ENTRY(__cpp_lib_transparent_operators)
        COMPILER_FEATURE_ENTRY(__cpp_lib_tuple_element_t)
        COMPILER_FEATURE_ENTRY(__cpp_lib_tuples_by_type)
};

static CompilerFeature cxx17[] = {
        COMPILER_FEATURE_ENTRY(__cpp_aggregate_bases)
        COMPILER_FEATURE_ENTRY(__cpp_aligned_new)
        COMPILER_FEATURE_ENTRY(__cpp_capture_star_this)
        COMPILER_FEATURE_ENTRY(__cpp_constexpr)
        COMPILER_FEATURE_ENTRY(__cpp_deduction_guides)
        COMPILER_FEATURE_ENTRY(__cpp_enumerator_attributes)
        COMPILER_FEATURE_ENTRY(__cpp_fold_expressions)
        COMPILER_FEATURE_ENTRY(__cpp_guaranteed_copy_elision)
        COMPILER_FEATURE_ENTRY(__cpp_hex_float)
        COMPILER_FEATURE_ENTRY(__cpp_if_constexpr)
        COMPILER_FEATURE_ENTRY(__cpp_inheriting_constructors)
        COMPILER_FEATURE_ENTRY(__cpp_inline_variables)
        COMPILER_FEATURE_ENTRY(__cpp_namespace_attributes)
        COMPILER_FEATURE_ENTRY(__cpp_noexcept_function_type)
        COMPILER_FEATURE_ENTRY(__cpp_nontype_template_args)
        COMPILER_FEATURE_ENTRY(__cpp_nontype_template_parameter_auto)
        COMPILER_FEATURE_ENTRY(__cpp_range_based_for)
        COMPILER_FEATURE_ENTRY(__cpp_static_assert)
        COMPILER_FEATURE_ENTRY(__cpp_structured_bindings)
        COMPILER_FEATURE_ENTRY(__cpp_template_template_args)
        COMPILER_FEATURE_ENTRY(__cpp_variadic_using)
};
static CompilerFeature cxx17lib[] = {
        COMPILER_FEATURE_ENTRY(__cpp_lib_addressof_constexpr)
        COMPILER_FEATURE_ENTRY(__cpp_lib_allocator_traits_is_always_equal)
        COMPILER_FEATURE_ENTRY(__cpp_lib_any)
        COMPILER_FEATURE_ENTRY(__cpp_lib_apply)
        COMPILER_FEATURE_ENTRY(__cpp_lib_array_constexpr)
        COMPILER_FEATURE_ENTRY(__cpp_lib_as_const)
        COMPILER_FEATURE_ENTRY(__cpp_lib_atomic_is_always_lock_free)
        COMPILER_FEATURE_ENTRY(__cpp_lib_bool_constant)
        COMPILER_FEATURE_ENTRY(__cpp_lib_boyer_moore_searcher)
        COMPILER_FEATURE_ENTRY(__cpp_lib_byte)
        COMPILER_FEATURE_ENTRY(__cpp_lib_chrono)
        COMPILER_FEATURE_ENTRY(__cpp_lib_clamp)
        COMPILER_FEATURE_ENTRY(__cpp_lib_enable_shared_from_this)
        COMPILER_FEATURE_ENTRY(__cpp_lib_execution)
        COMPILER_FEATURE_ENTRY(__cpp_lib_filesystem)
        COMPILER_FEATURE_ENTRY(__cpp_lib_gcd_lcm)
        COMPILER_FEATURE_ENTRY(__cpp_lib_hardware_interference_size)
        COMPILER_FEATURE_ENTRY(__cpp_lib_has_unique_object_representations)
        COMPILER_FEATURE_ENTRY(__cpp_lib_hypot)
        COMPILER_FEATURE_ENTRY(__cpp_lib_incomplete_container_elements)
        COMPILER_FEATURE_ENTRY(__cpp_lib_invoke)
        COMPILER_FEATURE_ENTRY(__cpp_lib_is_aggregate)
        COMPILER_FEATURE_ENTRY(__cpp_lib_is_invocable)
        COMPILER_FEATURE_ENTRY(__cpp_lib_is_swappable)
        COMPILER_FEATURE_ENTRY(__cpp_lib_launder)
        COMPILER_FEATURE_ENTRY(__cpp_lib_logical_traits)
        COMPILER_FEATURE_ENTRY(__cpp_lib_make_from_tuple)
        COMPILER_FEATURE_ENTRY(__cpp_lib_map_try_emplace)
        COMPILER_FEATURE_ENTRY(__cpp_lib_math_special_functions)
        COMPILER_FEATURE_ENTRY(__cpp_lib_memory_resource)
        COMPILER_FEATURE_ENTRY(__cpp_lib_node_extract)
        COMPILER_FEATURE_ENTRY(__cpp_lib_nonmember_container_access)
        COMPILER_FEATURE_ENTRY(__cpp_lib_not_fn)
        COMPILER_FEATURE_ENTRY(__cpp_lib_optional)
        COMPILER_FEATURE_ENTRY(__cpp_lib_parallel_algorithm)
        COMPILER_FEATURE_ENTRY(__cpp_lib_raw_memory_algorithms)
        COMPILER_FEATURE_ENTRY(__cpp_lib_sample)
        COMPILER_FEATURE_ENTRY(__cpp_lib_scoped_lock)
        COMPILER_FEATURE_ENTRY(__cpp_lib_shared_mutex)
        COMPILER_FEATURE_ENTRY(__cpp_lib_shared_ptr_arrays)
        COMPILER_FEATURE_ENTRY(__cpp_lib_shared_ptr_weak_type)
        COMPILER_FEATURE_ENTRY(__cpp_lib_string_view)
        COMPILER_FEATURE_ENTRY(__cpp_lib_to_chars)
        COMPILER_FEATURE_ENTRY(__cpp_lib_transparent_operators)
        COMPILER_FEATURE_ENTRY(__cpp_lib_type_trait_variable_templates)
        COMPILER_FEATURE_ENTRY(__cpp_lib_uncaught_exceptions)
        COMPILER_FEATURE_ENTRY(__cpp_lib_unordered_map_try_emplace)
        COMPILER_FEATURE_ENTRY(__cpp_lib_variant)
        COMPILER_FEATURE_ENTRY(__cpp_lib_void_t)
};

static CompilerFeature cxx20[] = {
        COMPILER_FEATURE_ENTRY(__cpp_aggregate_paren_init)
        COMPILER_FEATURE_ENTRY(__cpp_char8_t)
        COMPILER_FEATURE_ENTRY(__cpp_concepts)
        COMPILER_FEATURE_ENTRY(__cpp_conditional_explicit)
        COMPILER_FEATURE_ENTRY(__cpp_consteval)
        COMPILER_FEATURE_ENTRY(__cpp_constexpr)
        COMPILER_FEATURE_ENTRY(__cpp_constexpr_dynamic_alloc)
        COMPILER_FEATURE_ENTRY(__cpp_constexpr_in_decltype)
        COMPILER_FEATURE_ENTRY(__cpp_constinit)
        COMPILER_FEATURE_ENTRY(__cpp_deduction_guides)
        COMPILER_FEATURE_ENTRY(__cpp_designated_initializers)
        COMPILER_FEATURE_ENTRY(__cpp_generic_lambdas)
        COMPILER_FEATURE_ENTRY(__cpp_impl_coroutine)
        COMPILER_FEATURE_ENTRY(__cpp_impl_destroying_delete)
        COMPILER_FEATURE_ENTRY(__cpp_impl_three_way_comparison)
        COMPILER_FEATURE_ENTRY(__cpp_init_captures)
        COMPILER_FEATURE_ENTRY(__cpp_modules)
        COMPILER_FEATURE_ENTRY(__cpp_nontype_template_args)
        COMPILER_FEATURE_ENTRY(__cpp_using_enum)
};
static CompilerFeature cxx20lib[] = {
        COMPILER_FEATURE_ENTRY(__cpp_lib_array_constexpr)
        COMPILER_FEATURE_ENTRY(__cpp_lib_assume_aligned)
        COMPILER_FEATURE_ENTRY(__cpp_lib_atomic_flag_test)
        COMPILER_FEATURE_ENTRY(__cpp_lib_atomic_float)
        COMPILER_FEATURE_ENTRY(__cpp_lib_atomic_lock_free_type_aliases)
        COMPILER_FEATURE_ENTRY(__cpp_lib_atomic_ref)
        COMPILER_FEATURE_ENTRY(__cpp_lib_atomic_shared_ptr)
        COMPILER_FEATURE_ENTRY(__cpp_lib_atomic_value_initialization)
        COMPILER_FEATURE_ENTRY(__cpp_lib_atomic_wait)
        COMPILER_FEATURE_ENTRY(__cpp_lib_barrier)
        COMPILER_FEATURE_ENTRY(__cpp_lib_bind_front)
        COMPILER_FEATURE_ENTRY(__cpp_lib_bit_cast)
        COMPILER_FEATURE_ENTRY(__cpp_lib_bitops)
        COMPILER_FEATURE_ENTRY(__cpp_lib_bounded_array_traits)
        COMPILER_FEATURE_ENTRY(__cpp_lib_char8_t)
        COMPILER_FEATURE_ENTRY(__cpp_lib_chrono)
        COMPILER_FEATURE_ENTRY(__cpp_lib_concepts)
        COMPILER_FEATURE_ENTRY(__cpp_lib_constexpr_algorithms)
        COMPILER_FEATURE_ENTRY(__cpp_lib_constexpr_complex)
        COMPILER_FEATURE_ENTRY(__cpp_lib_constexpr_dynamic_alloc)
        COMPILER_FEATURE_ENTRY(__cpp_lib_constexpr_functional)
        COMPILER_FEATURE_ENTRY(__cpp_lib_constexpr_iterator)
        COMPILER_FEATURE_ENTRY(__cpp_lib_constexpr_memory)
        COMPILER_FEATURE_ENTRY(__cpp_lib_constexpr_numeric)
        COMPILER_FEATURE_ENTRY(__cpp_lib_constexpr_string)
        COMPILER_FEATURE_ENTRY(__cpp_lib_constexpr_string_view)
        COMPILER_FEATURE_ENTRY(__cpp_lib_constexpr_tuple)
        COMPILER_FEATURE_ENTRY(__cpp_lib_constexpr_utility)
        COMPILER_FEATURE_ENTRY(__cpp_lib_constexpr_vector)
        COMPILER_FEATURE_ENTRY(__cpp_lib_coroutine)
        COMPILER_FEATURE_ENTRY(__cpp_lib_destroying_delete)
        COMPILER_FEATURE_ENTRY(__cpp_lib_endian)
        COMPILER_FEATURE_ENTRY(__cpp_lib_erase_if)
        COMPILER_FEATURE_ENTRY(__cpp_lib_execution)
        COMPILER_FEATURE_ENTRY(__cpp_lib_format)
        COMPILER_FEATURE_ENTRY(__cpp_lib_generic_unordered_lookup)
        COMPILER_FEATURE_ENTRY(__cpp_lib_int_pow2)
        COMPILER_FEATURE_ENTRY(__cpp_lib_integer_comparison_functions)
        COMPILER_FEATURE_ENTRY(__cpp_lib_interpolate)
        COMPILER_FEATURE_ENTRY(__cpp_lib_is_constant_evaluated)
        COMPILER_FEATURE_ENTRY(__cpp_lib_is_layout_compatible)
        COMPILER_FEATURE_ENTRY(__cpp_lib_is_nothrow_convertible)
        COMPILER_FEATURE_ENTRY(__cpp_lib_is_pointer_interconvertible)
        COMPILER_FEATURE_ENTRY(__cpp_lib_jthread)
        COMPILER_FEATURE_ENTRY(__cpp_lib_latch)
        COMPILER_FEATURE_ENTRY(__cpp_lib_list_remove_return_type)
        COMPILER_FEATURE_ENTRY(__cpp_lib_math_constants)
        COMPILER_FEATURE_ENTRY(__cpp_lib_polymorphic_allocator)
        COMPILER_FEATURE_ENTRY(__cpp_lib_ranges)
        COMPILER_FEATURE_ENTRY(__cpp_lib_remove_cvref)
        COMPILER_FEATURE_ENTRY(__cpp_lib_semaphore)
        COMPILER_FEATURE_ENTRY(__cpp_lib_shared_ptr_arrays)
        COMPILER_FEATURE_ENTRY(__cpp_lib_shift)
        COMPILER_FEATURE_ENTRY(__cpp_lib_smart_ptr_for_overwrite)
        COMPILER_FEATURE_ENTRY(__cpp_lib_source_location)
        COMPILER_FEATURE_ENTRY(__cpp_lib_span)
        COMPILER_FEATURE_ENTRY(__cpp_lib_ssize)
        COMPILER_FEATURE_ENTRY(__cpp_lib_starts_ends_with)
        COMPILER_FEATURE_ENTRY(__cpp_lib_string_view)
        COMPILER_FEATURE_ENTRY(__cpp_lib_syncbuf)
        COMPILER_FEATURE_ENTRY(__cpp_lib_three_way_comparison)
        COMPILER_FEATURE_ENTRY(__cpp_lib_to_address)
        COMPILER_FEATURE_ENTRY(__cpp_lib_to_array)
        COMPILER_FEATURE_ENTRY(__cpp_lib_type_identity)
        COMPILER_FEATURE_ENTRY(__cpp_lib_unwrap_ref)
};

static CompilerFeature cxx23[] = {
//< 继续填充
        COMPILER_FEATURE_ENTRY(__cpp_if_consteval)
        COMPILER_FEATURE_ENTRY(__cpp_size_t_suffix)
};
static CompilerFeature cxx23lib[] = {
//< 继续填充
        COMPILER_FEATURE_ENTRY(__cpp_lib_constexpr_typeinfo)
        COMPILER_FEATURE_ENTRY(__cpp_lib_invoke_r)
        COMPILER_FEATURE_ENTRY(__cpp_lib_is_scoped_enum)
        COMPILER_FEATURE_ENTRY(__cpp_lib_stacktrace)
        COMPILER_FEATURE_ENTRY(__cpp_lib_stdatomic_h)
        COMPILER_FEATURE_ENTRY(__cpp_lib_string_contains)
        COMPILER_FEATURE_ENTRY(__cpp_lib_to_underlying)
        COMPILER_FEATURE_ENTRY(__cpp_lib_variant)
};

static CompilerFeature attributes[] = {
        COMPILER_ATTRIBUTE_ENTRY(carries_dependency)
        COMPILER_ATTRIBUTE_ENTRY(deprecated)
        COMPILER_ATTRIBUTE_ENTRY(fallthrough)
        COMPILER_ATTRIBUTE_ENTRY(likely)
        COMPILER_ATTRIBUTE_ENTRY(maybe_unused)
        COMPILER_ATTRIBUTE_ENTRY(nodiscard)
        COMPILER_ATTRIBUTE_ENTRY(noreturn)
        COMPILER_ATTRIBUTE_ENTRY(no_unique_address)
        COMPILER_ATTRIBUTE_ENTRY(unlikely)
};

constexpr bool is_feature_supported(const CompilerFeature& x) {
    return x.value[0] != '_' && x.value[0] != '0' ;
}

inline void print_compiler_feature(const CompilerFeature& x) {
    constexpr static int max_name_length = 44; //< Update if necessary
    std::string value{ is_feature_supported(x) ? x.value : "------" };
    if (value.back() == 'L') value.pop_back(); //~ 201603L -> 201603
    // value.insert(4, 1, '-'); //~ 201603 -> 2016-03
    if ( (print.supported_features && is_feature_supported(x))
         or (print.unsupported_features && !is_feature_supported(x))) {
        std::cout << std::left << std::setw(max_name_length)
                  << x.name << " " << value << '\n';
    }
}

template<std::size_t N>
inline void show(char const* title, CompilerFeature (&features)[N]) {
    if (print.titles) {
        std::cout << '\n' << std::left << title << '\n';
    }
    if (print.sorted_by_value) {
        std::sort(std::begin(features), std::end(features),
                  [](CompilerFeature const& lhs, CompilerFeature const& rhs) {
                      return std::strcmp(lhs.value, rhs.value) < 0;
                  });
    }
    for (const CompilerFeature& x : features) {
        print_compiler_feature(x);
    }
}

int main() {
    if (print.general_features) show("C++ GENERAL", cxx);
    if (print.cxx11 && print.core_features) show("C++11 CORE", cxx11);
    if (print.cxx14 && print.core_features) show("C++14 CORE", cxx14);
    if (print.cxx14 && print.lib_features ) show("C++14 LIB" , cxx14lib);
    if (print.cxx17 && print.core_features) show("C++17 CORE", cxx17);
    if (print.cxx17 && print.lib_features ) show("C++17 LIB" , cxx17lib);
    if (print.cxx20 && print.core_features) show("C++20 CORE", cxx20);
    if (print.cxx20 && print.lib_features ) show("C++20 LIB" , cxx20lib);
    if (print.cxx23 && print.core_features) show("C++23 CORE", cxx23);
    if (print.cxx23 && print.lib_features ) show("C++23 LIB" , cxx23lib);
    if (print.attributes) show("ATTRIBUTES", attributes);
}

测试结果

1) Visual Studio 2022

以下是Visual Studio 2022的测试结果,支持的feature比较全。

  1. 需要在项目属性中选择最新的C++版本。需要选择“预览”选项,C++23的feature才会支持。
    在这里插入图片描述

  2. vs编译器中__cplusplus对应值是199711,测试程序开头(前3行)的监测不能通过,可以注释掉或者修改第一行的数值。
    gcc或者clang都没可以直接测试通过。

  3. 测试结果中显示对标准中attributes支持不好,在代码中实际测试大部分attributes都是支持的。
    可能是对测试宏的检测方式不兼容,这个问题抽空调查一下(todo)。

C++ GENERAL
__cplusplus                                  199711
__cpp_exceptions                             199711
__cpp_rtti                                   199711

C++11 CORE
__cpp_alias_templates                        200704
__cpp_attributes                             200809
__cpp_constexpr                              202002
__cpp_decltype                               200707
__cpp_delegating_constructors                200604
__cpp_inheriting_constructors                201511
__cpp_initializer_lists                      200806
__cpp_lambdas                                200907
__cpp_nsdmi                                  200809
__cpp_range_based_for                        201603
__cpp_raw_strings                            200710
__cpp_ref_qualifiers                         200710
__cpp_rvalue_references                      200610
__cpp_static_assert                          201411
__cpp_threadsafe_static_init                 200806
__cpp_unicode_characters                     200704
__cpp_unicode_literals                       200710
__cpp_user_defined_literals                  200809
__cpp_variadic_templates                     200704

C++14 CORE
__cpp_aggregate_nsdmi                        201304
__cpp_binary_literals                        201304
__cpp_constexpr                              202002
__cpp_decltype_auto                          201304
__cpp_generic_lambdas                        201707
__cpp_init_captures                          201803
__cpp_return_type_deduction                  201304
__cpp_sized_deallocation                     201309
__cpp_variable_templates                     201304

C++14 LIB
__cpp_lib_chrono_udls                        201304
__cpp_lib_complex_udls                       201309
__cpp_lib_exchange_function                  201304
__cpp_lib_generic_associative_lookup         201304
__cpp_lib_integer_sequence                   201304
__cpp_lib_integral_constant_callable         201304
__cpp_lib_is_final                           201402
__cpp_lib_is_null_pointer                    201309
__cpp_lib_make_reverse_iterator              201402
__cpp_lib_make_unique                        201304
__cpp_lib_null_iterators                     201304
__cpp_lib_quoted_string_io                   201304
__cpp_lib_result_of_sfinae                   201210
__cpp_lib_robust_nonmodifying_seq_ops        201304
__cpp_lib_shared_timed_mutex                 201402
__cpp_lib_string_udls                        201304
__cpp_lib_transformation_trait_aliases       201304
__cpp_lib_transparent_operators              201510
__cpp_lib_tuple_element_t                    201402
__cpp_lib_tuples_by_type                     201304

C++17 CORE
__cpp_aggregate_bases                        201603
__cpp_aligned_new                            201606
__cpp_capture_star_this                      201603
__cpp_constexpr                              202002
__cpp_deduction_guides                       201907
__cpp_enumerator_attributes                  201411
__cpp_fold_expressions                       201603
__cpp_guaranteed_copy_elision                201606
__cpp_hex_float                              201603
__cpp_if_constexpr                           201606
__cpp_inheriting_constructors                201511
__cpp_inline_variables                       201606
__cpp_namespace_attributes                   201411
__cpp_noexcept_function_type                 201510
__cpp_nontype_template_args                  201911
__cpp_nontype_template_parameter_auto        201606
__cpp_range_based_for                        201603
__cpp_static_assert                          201411
__cpp_structured_bindings                    201606
__cpp_template_template_args                 201611
__cpp_variadic_using                         201611

C++17 LIB
__cpp_lib_addressof_constexpr                201603
__cpp_lib_allocator_traits_is_always_equal   201411
__cpp_lib_any                                201606
__cpp_lib_apply                              201603
__cpp_lib_array_constexpr                    201811
__cpp_lib_as_const                           201510
__cpp_lib_atomic_is_always_lock_free         201603
__cpp_lib_bool_constant                      201505
__cpp_lib_boyer_moore_searcher               201603
__cpp_lib_byte                               201603
__cpp_lib_chrono                             201907
__cpp_lib_clamp                              201603
__cpp_lib_enable_shared_from_this            201603
__cpp_lib_execution                          201902
__cpp_lib_filesystem                         201703
__cpp_lib_gcd_lcm                            201606
__cpp_lib_hardware_interference_size         201703
__cpp_lib_has_unique_object_representations  201606
__cpp_lib_hypot                              201603
__cpp_lib_incomplete_container_elements      201505
__cpp_lib_invoke                             201411
__cpp_lib_is_aggregate                       201703
__cpp_lib_is_invocable                       201703
__cpp_lib_is_swappable                       201603
__cpp_lib_launder                            201606
__cpp_lib_logical_traits                     201510
__cpp_lib_make_from_tuple                    201606
__cpp_lib_map_try_emplace                    201411
__cpp_lib_math_special_functions             201603
__cpp_lib_memory_resource                    201603
__cpp_lib_node_extract                       201606
__cpp_lib_nonmember_container_access         201411
__cpp_lib_not_fn                             201603
__cpp_lib_optional                           202110
__cpp_lib_parallel_algorithm                 201603
__cpp_lib_raw_memory_algorithms              201606
__cpp_lib_sample                             201603
__cpp_lib_scoped_lock                        201703
__cpp_lib_shared_mutex                       201505
__cpp_lib_shared_ptr_arrays                  201707
__cpp_lib_shared_ptr_weak_type               201606
__cpp_lib_string_view                        201803
__cpp_lib_to_chars                           201611
__cpp_lib_transparent_operators              201510
__cpp_lib_type_trait_variable_templates      201510
__cpp_lib_uncaught_exceptions                201411
__cpp_lib_unordered_map_try_emplace          201411
__cpp_lib_variant                            202106
__cpp_lib_void_t                             201411

C++20 CORE
__cpp_aggregate_paren_init                   201902
__cpp_char8_t                                202207
__cpp_concepts                               202002
__cpp_conditional_explicit                   201806
__cpp_consteval                              201811
__cpp_constexpr                              202002
__cpp_constexpr_dynamic_alloc                201907
__cpp_constexpr_in_decltype                  ------
__cpp_constinit                              201907
__cpp_deduction_guides                       201907
__cpp_designated_initializers                201707
__cpp_generic_lambdas                        201707
__cpp_impl_coroutine                         201902
__cpp_impl_destroying_delete                 201806
__cpp_impl_three_way_comparison              201907
__cpp_init_captures                          201803
__cpp_modules                                201907
__cpp_nontype_template_args                  201911
__cpp_using_enum                             201907

C++20 LIB
__cpp_lib_array_constexpr                    201811
__cpp_lib_assume_aligned                     201811
__cpp_lib_atomic_flag_test                   201907
__cpp_lib_atomic_float                       201711
__cpp_lib_atomic_lock_free_type_aliases      201907
__cpp_lib_atomic_ref                         201806
__cpp_lib_atomic_shared_ptr                  201711
__cpp_lib_atomic_value_initialization        201911
__cpp_lib_atomic_wait                        201907
__cpp_lib_barrier                            201907
__cpp_lib_bind_front                         201907
__cpp_lib_bit_cast                           201806
__cpp_lib_bitops                             201907
__cpp_lib_bounded_array_traits               201902
__cpp_lib_char8_t                            201907
__cpp_lib_chrono                             201907
__cpp_lib_concepts                           202002
__cpp_lib_constexpr_algorithms               201806
__cpp_lib_constexpr_complex                  201711
__cpp_lib_constexpr_dynamic_alloc            201907
__cpp_lib_constexpr_functional               201907
__cpp_lib_constexpr_iterator                 201811
__cpp_lib_constexpr_memory                   202202
__cpp_lib_constexpr_numeric                  201911
__cpp_lib_constexpr_string                   201907
__cpp_lib_constexpr_string_view              201811
__cpp_lib_constexpr_tuple                    201811
__cpp_lib_constexpr_utility                  201811
__cpp_lib_constexpr_vector                   201907
__cpp_lib_coroutine                          201902
__cpp_lib_destroying_delete                  201806
__cpp_lib_endian                             201907
__cpp_lib_erase_if                           202002
__cpp_lib_execution                          201902
__cpp_lib_format                             202207
__cpp_lib_generic_unordered_lookup           201811
__cpp_lib_int_pow2                           202002
__cpp_lib_integer_comparison_functions       202002
__cpp_lib_interpolate                        201902
__cpp_lib_is_constant_evaluated              201811
__cpp_lib_is_layout_compatible               201907
__cpp_lib_is_nothrow_convertible             201806
__cpp_lib_is_pointer_interconvertible        201907
__cpp_lib_jthread                            201911
__cpp_lib_latch                              201907
__cpp_lib_list_remove_return_type            201806
__cpp_lib_math_constants                     201907
__cpp_lib_polymorphic_allocator              201902
__cpp_lib_ranges                             202207
__cpp_lib_remove_cvref                       201711
__cpp_lib_semaphore                          201907
__cpp_lib_shared_ptr_arrays                  201707
__cpp_lib_shift                              202202
__cpp_lib_smart_ptr_for_overwrite            202002
__cpp_lib_source_location                    201907
__cpp_lib_span                               202002
__cpp_lib_ssize                              201902
__cpp_lib_starts_ends_with                   201711
__cpp_lib_string_view                        201803
__cpp_lib_syncbuf                            201803
__cpp_lib_three_way_comparison               201907
__cpp_lib_to_address                         201711
__cpp_lib_to_array                           201907
__cpp_lib_type_identity                      201806
__cpp_lib_unwrap_ref                         201811

C++23 CORE
__cpp_if_consteval                           ------
__cpp_size_t_suffix                          ------

C++23 LIB
__cpp_lib_constexpr_typeinfo                 202106
__cpp_lib_invoke_r                           202106
__cpp_lib_is_scoped_enum                     202011
__cpp_lib_stacktrace                         202011
__cpp_lib_stdatomic_h                        202011
__cpp_lib_string_contains                    202011
__cpp_lib_to_underlying                      202102
__cpp_lib_variant                            202106

ATTRIBUTES
carries_dependency                           ------
deprecated                                   ------
fallthrough                                  ------
likely                                       ------
maybe_unused                                 ------
nodiscard                                    ------
noreturn                                     ------
no_unique_address                            ------
unlikely                                     ------

2) g++ -12 (on Ubuntu 22.04)

以下是gcc的测试结果。从结果看对C++的支持也比较全面,和vs2022对比有少量差异。最后附上一个二者的对比。

  1. 编译时需要通过参数(–std)指定C++版本:
$ g++-12 -std=c++23 main.cpp -o main
  1. Ubuntu 22.04上默认是g++ -11,升级成g++ -12后进行测试(有少量更新)。
C++ GENERAL
__cplusplus                                  202100
__cpp_exceptions                             199711
__cpp_rtti                                   199711

C++11 CORE
__cpp_alias_templates                        200704
__cpp_attributes                             200809
__cpp_constexpr                              202110
__cpp_decltype                               200707
__cpp_delegating_constructors                200604
__cpp_inheriting_constructors                201511
__cpp_initializer_lists                      200806
__cpp_lambdas                                200907
__cpp_nsdmi                                  200809
__cpp_range_based_for                        201603
__cpp_raw_strings                            200710
__cpp_ref_qualifiers                         200710
__cpp_rvalue_references                      200610
__cpp_static_assert                          201411
__cpp_threadsafe_static_init                 200806
__cpp_unicode_characters                     201411
__cpp_unicode_literals                       200710
__cpp_user_defined_literals                  200809
__cpp_variadic_templates                     200704

C++14 CORE
__cpp_aggregate_nsdmi                        201304
__cpp_binary_literals                        201304
__cpp_constexpr                              202110
__cpp_decltype_auto                          201304
__cpp_generic_lambdas                        201707
__cpp_init_captures                          201803
__cpp_return_type_deduction                  201304
__cpp_sized_deallocation                     201309
__cpp_variable_templates                     201304

C++14 LIB
__cpp_lib_chrono_udls                        201304
__cpp_lib_complex_udls                       201309
__cpp_lib_exchange_function                  201304
__cpp_lib_generic_associative_lookup         201304
__cpp_lib_integer_sequence                   201304
__cpp_lib_integral_constant_callable         201304
__cpp_lib_is_final                           201402
__cpp_lib_is_null_pointer                    201309
__cpp_lib_make_reverse_iterator              201402
__cpp_lib_make_unique                        201304
__cpp_lib_null_iterators                     201304
__cpp_lib_quoted_string_io                   201304
__cpp_lib_result_of_sfinae                   201210
__cpp_lib_robust_nonmodifying_seq_ops        201304
__cpp_lib_shared_timed_mutex                 201402
__cpp_lib_string_udls                        201304
__cpp_lib_transformation_trait_aliases       201304
__cpp_lib_transparent_operators              201510
__cpp_lib_tuple_element_t                    201402
__cpp_lib_tuples_by_type                     201304

C++17 CORE
__cpp_aggregate_bases                        201603
__cpp_aligned_new                            201606
__cpp_capture_star_this                      201603
__cpp_constexpr                              202110
__cpp_deduction_guides                       201907
__cpp_enumerator_attributes                  201411
__cpp_fold_expressions                       201603
__cpp_guaranteed_copy_elision                201606
__cpp_hex_float                              201603
__cpp_if_constexpr                           201606
__cpp_inheriting_constructors                201511
__cpp_inline_variables                       201606
__cpp_namespace_attributes                   201411
__cpp_noexcept_function_type                 201510
__cpp_nontype_template_args                  201911
__cpp_nontype_template_parameter_auto        201606
__cpp_range_based_for                        201603
__cpp_static_assert                          201411
__cpp_structured_bindings                    201606
__cpp_template_template_args                 201611
__cpp_variadic_using                         201611

C++17 LIB
__cpp_lib_addressof_constexpr                201603
__cpp_lib_allocator_traits_is_always_equal   201411
__cpp_lib_any                                201606
__cpp_lib_apply                              201603
__cpp_lib_array_constexpr                    201811
__cpp_lib_as_const                           201510
__cpp_lib_atomic_is_always_lock_free         201603
__cpp_lib_bool_constant                      201505
__cpp_lib_boyer_moore_searcher               201603
__cpp_lib_byte                               201603
__cpp_lib_chrono                             201611
__cpp_lib_clamp                              201603
__cpp_lib_enable_shared_from_this            201603
__cpp_lib_execution                          201902
__cpp_lib_filesystem                         201703
__cpp_lib_gcd_lcm                            201606
__cpp_lib_hardware_interference_size         201703
__cpp_lib_has_unique_object_representations  201606
__cpp_lib_hypot                              201603
__cpp_lib_incomplete_container_elements      201505
__cpp_lib_invoke                             201411
__cpp_lib_is_aggregate                       201703
__cpp_lib_is_invocable                       201703
__cpp_lib_is_swappable                       201603
__cpp_lib_launder                            201606
__cpp_lib_logical_traits                     201510
__cpp_lib_make_from_tuple                    201606
__cpp_lib_map_try_emplace                    201411
__cpp_lib_math_special_functions             201603
__cpp_lib_memory_resource                    201603
__cpp_lib_node_extract                       201606
__cpp_lib_nonmember_container_access         201411
__cpp_lib_not_fn                             201603
__cpp_lib_optional                           202110
__cpp_lib_parallel_algorithm                 201603
__cpp_lib_raw_memory_algorithms              201606
__cpp_lib_sample                             201603
__cpp_lib_scoped_lock                        201703
__cpp_lib_shared_mutex                       201505
__cpp_lib_shared_ptr_arrays                  201707
__cpp_lib_shared_ptr_weak_type               201606
__cpp_lib_string_view                        201803
__cpp_lib_to_chars                           201611
__cpp_lib_transparent_operators              201510
__cpp_lib_type_trait_variable_templates      201510
__cpp_lib_uncaught_exceptions                201411
__cpp_lib_unordered_map_try_emplace          201411
__cpp_lib_variant                            202106
__cpp_lib_void_t                             201411

C++20 CORE
__cpp_aggregate_paren_init                   201902
__cpp_char8_t                                201811
__cpp_concepts                               202002
__cpp_conditional_explicit                   201806
__cpp_consteval                              201811
__cpp_constexpr                              202110
__cpp_constexpr_dynamic_alloc                201907
__cpp_constexpr_in_decltype                  201711
__cpp_constinit                              201907
__cpp_deduction_guides                       201907
__cpp_designated_initializers                201707
__cpp_generic_lambdas                        201707
__cpp_impl_coroutine                         201902
__cpp_impl_destroying_delete                 201806
__cpp_impl_three_way_comparison              201907
__cpp_init_captures                          201803
__cpp_modules                                ------
__cpp_nontype_template_args                  201911
__cpp_using_enum                             201907

C++20 LIB
__cpp_lib_array_constexpr                    201811
__cpp_lib_assume_aligned                     201811
__cpp_lib_atomic_flag_test                   201907
__cpp_lib_atomic_float                       201711
__cpp_lib_atomic_lock_free_type_aliases      ------
__cpp_lib_atomic_ref                         201806
__cpp_lib_atomic_shared_ptr                  201711
__cpp_lib_atomic_value_initialization        201911
__cpp_lib_atomic_wait                        201907
__cpp_lib_barrier                            201907
__cpp_lib_bind_front                         201907
__cpp_lib_bit_cast                           201806
__cpp_lib_bitops                             201907
__cpp_lib_bounded_array_traits               201902
__cpp_lib_char8_t                            201907
__cpp_lib_chrono                             201611
__cpp_lib_concepts                           202002
__cpp_lib_constexpr_algorithms               201806
__cpp_lib_constexpr_complex                  201711
__cpp_lib_constexpr_dynamic_alloc            201907
__cpp_lib_constexpr_functional               201907
__cpp_lib_constexpr_iterator                 201811
__cpp_lib_constexpr_memory                   202202
__cpp_lib_constexpr_numeric                  201911
__cpp_lib_constexpr_string                   201907
__cpp_lib_constexpr_string_view              201811
__cpp_lib_constexpr_tuple                    201811
__cpp_lib_constexpr_utility                  201811
__cpp_lib_constexpr_vector                   201907
__cpp_lib_coroutine                          201902
__cpp_lib_destroying_delete                  201806
__cpp_lib_endian                             201907
__cpp_lib_erase_if                           202002
__cpp_lib_execution                          201902
__cpp_lib_format                             ------
__cpp_lib_generic_unordered_lookup           201811
__cpp_lib_int_pow2                           202002
__cpp_lib_integer_comparison_functions       202002
__cpp_lib_interpolate                        201902
__cpp_lib_is_constant_evaluated              201811
__cpp_lib_is_layout_compatible               201907
__cpp_lib_is_nothrow_convertible             201806
__cpp_lib_is_pointer_interconvertible        201907
__cpp_lib_jthread                            201911
__cpp_lib_latch                              201907
__cpp_lib_list_remove_return_type            201806
__cpp_lib_math_constants                     201907
__cpp_lib_polymorphic_allocator              201902
__cpp_lib_ranges                             202110
__cpp_lib_remove_cvref                       201711
__cpp_lib_semaphore                          201907
__cpp_lib_shared_ptr_arrays                  201707
__cpp_lib_shift                              201806
__cpp_lib_smart_ptr_for_overwrite            202002
__cpp_lib_source_location                    201907
__cpp_lib_span                               202002
__cpp_lib_ssize                              201902
__cpp_lib_starts_ends_with                   201711
__cpp_lib_string_view                        201803
__cpp_lib_syncbuf                            201803
__cpp_lib_three_way_comparison               201907
__cpp_lib_to_address                         201711
__cpp_lib_to_array                           201907
__cpp_lib_type_identity                      201806
__cpp_lib_unwrap_ref                         201811

C++23 CORE
__cpp_if_consteval                           202106
__cpp_size_t_suffix                          202011

C++23 LIB
__cpp_lib_constexpr_typeinfo                 202106
__cpp_lib_invoke_r                           202106
__cpp_lib_is_scoped_enum                     202011
__cpp_lib_stacktrace                         ------
__cpp_lib_stdatomic_h                        202011
__cpp_lib_string_contains                    202011
__cpp_lib_to_underlying                      202102
__cpp_lib_variant                            202106

ATTRIBUTES
carries_dependency                           ------
deprecated                                   201309
fallthrough                                  201603
likely                                       201803
maybe_unused                                 201603
nodiscard                                    201907
noreturn                                     200809
no_unique_address                            201803
unlikely                                     201803

3) Visual Studio 2022 vs. g++ -12

在这里插入图片描述

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/451530.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

32道子网划分习题详细解析

目录 1 子网划分概念&#xff1a; 2 划分方法&#xff1a; 子网划分方法&#xff1a;段&#xff0c;块&#xff0c;数的计算三步。 段就是确定ip地址段中既有网络地址&#xff0c;又有主机地址的那一段是四段中的那一段&#xff1f; 块就确定上一步中确定的那一段中的主机…

【C语言】21-结构体

本文目录 • 一、什么是结构体 • 二、结构体的定义 • 三、结构体变量的定义 • 四、结构体的注意点 • 五、结构体的初始化 • 六、结构体的使用 • 七、结构体数组 • 八、结构体作为函数参数 • 九、指向结构体的指针 说明&#xff1a;这个C语言专题&#xff0c;是学习iOS开…

算法设计与智能计算 || 专题七: 主成分分析的统计学视角

主成分分析的统计学视角 文章目录 主成分分析的统计学视角PCA 的统计学视角1. 寻找第一个主成分2. 获取第二个主成分3. 非零均值随机变量的主元4. 零均值随机变量的样本主元5. PCA 降维案例 主成分分析是将高维空间中的数据集拟合成一个低维子空间的方法&#xff0c;到目前为止…

搞定常见八大排序

文章目录 注意事项插入排序插入排序希尔排序 分组预排序选择排序堆排序直接选择排序(最拉胯的排序) 交换排序冒泡排序快速排序1. hoare版本如何解决快排缺陷&#xff1f;2.挖坑法版本3.双指针法版本&#xff08;建议&#xff09;快排算法优化实现非递归快排 归并排序归并排序 非…

Rainbond 结合 Jpom 实现云原生 本地一体化项目管理

Jpom 是一个简而轻的低侵入式在线构建、自动部署、日常运维、项目运维监控软件。提供了&#xff1a; 节点管理&#xff1a;集群节点&#xff0c;统一管理多节点的项目&#xff0c;实现快速一键分发项目文件项目管理&#xff1a;创建、启动、停止、实时查看项目控制台日志&…

CentOS系统设置中文输入法,并切换输入法

1.点击Application—>System Tools—>Settings&#xff0c;选择Region&Language 2.在Input Sources中&#xff0c;选择左下角的“”&#xff0c;找到Chinese(Intelligent Pinyin)&#xff0c;选中后点击右上角的“add”即可 3.选择好后&#xff0c;就可以切换中英…

可口可乐如何管理其全球供应链

目录 &#xff08;一&#xff09;可口可乐供应链管理的核心组成部分 &#xff08;二&#xff09;可口可乐管理全球供应链的挑战 &#xff08;三&#xff09;可口可乐利用技术简化其供应链 转载自供应链星球 可口可乐在200多个国家和地区拥有约225家装瓶合作伙伴&#xff0c;并…

【李沐—AutoGluon背后的技术】

1.资料来源 AutoGluon背后的技术_哔哩哔哩_bilibili 也是一种Automl框架【在尽量不需要人的帮助下&#xff0c;对输入进行特征提取&#xff0c;选取适合的机器学习模型对它进行训练】。大部分基于超参数搜索技术【从数十或者数百个参数中选取一个合适的参数&#xff0c;媲美人…

vue插槽的使用

文章目录 前言默认插槽具名插槽作用域插槽 前言 插槽总共分为3类&#xff1a;默认插槽&#xff0c;具名插槽&#xff0c;作用域插槽 默认插槽 默认插槽只需要在子组件的新增一个slot标签&#xff0c;父组件的子组件标签的内容就是要插入的内容 父组件 <template v-bind…

mysql “order by”是怎么工作的?

开发应用的时候&#xff0c;一定会经常碰到需要根据指定的字段排序来显示结果的需求。还是以我们 前面举例用过的市民表为例&#xff0c;假设你要查询城市是“杭州”的所有人名字&#xff0c;并且按照姓名排序返回 前1000个人的姓名、年龄。 假设这个表的部分定义是这样的&…

【linux】基于单例模式实现线程池

文章目录 一、线程池1.1 池化的概念1.2 线程池的实现1.3 线程池的使用场景 二、单例模式2.1 单例模式概念2.2 单例模式的线程池2.3 防过度优化 三、源码 一、线程池 1.1 池化的概念 当我们处理任务的时候&#xff0c;一般就是来一个任务我们就创建一个线程来处理这个任务。这…

类实例化对象的存储与内存对齐,this指针与调用成员函数传参的本原面目(两种调用方式)

类的实例化对象的内存存储方式与内存对齐 对于类当中定义的成员函数&#xff0c;是放在公共代码区的&#xff0c;在公共代码区有类成员函数表。对于不同的实例化对象而言&#xff0c;它里面的各个成员变量都是不一样的&#xff0c;但是如果他们分别调用相同名字的成员函数&…

cmd切换壁纸 适用windows10

文章目录 代码代码讲解参考文章菜鸟的目录结构注意 昨天菜鸟上班但是真的没活干&#xff0c;闲着无聊&#xff0c;突然发现自己壁纸好久都是一个&#xff0c;看着真的烦了&#xff0c;但是下载一个壁纸软件又感觉实际用处不大还占着内存&#xff0c;所以菜鸟就想&#xff0c;要…

Java Type接口出现的原因以及它和泛型的关系

Java泛型很多人都用过&#xff0c;但是对于其中的原理可能很多人可能都不太清楚。 首先给出一个结论&#xff1a;Java的泛型是伪泛型&#xff0c;因为JVM在编译以后会将所有泛型参数擦除掉&#xff0c;这个就叫类型擦除。 下面用一段代码来证明&#xff0c;毕竟千言万语BB不如…

【软考数据库】第三章 数据结构与算法

目录 3.1 数据结构 3.1.1 线性结构 3.1.2 数组 3.1.3 矩阵 3.1.4 树与二叉树 3.1.5 图 3.2 查找 3.2.1 顺序查找 3.2.2 折半查找 3.2.3 哈希表 3.3 排序 3.3.1 直接插入排序 3.3.2 希尔排序 …

Win10任务栏卡死怎么办?这3个方法快收藏!

案例&#xff1a;win10任务栏卡死 【姐妹们&#xff0c;我的win10任务栏一直卡着&#xff0c;我完全没法使用计算机了&#xff0c;遇到这种情况&#xff0c;我应该怎么做呢&#xff1f;求大家给我支支招&#xff01;感谢感谢&#xff01;】 我们使用电脑的过程中&#xff0c;…

MyBatis的添加和简单使用

什么是MyBatis mybatis是一个方便我们更简单的操作数据库的框架&#xff0c;让我们不用再使用JDBC操作数据库。 MyBatis的创建 老项目添加mybatis&#xff0c;首先要安装好editstarters插件&#xff0c;然后在pom.xml中右键generate选择edit插件&#xff0c;注意不仅要添加m…

多维时序 | MATLAB实现BO-CNN-BiLSTM贝叶斯优化卷积双向长短期记忆网络数据多变量时间序列预测

多维时序 | MATLAB实现BO-CNN-BiLSTM贝叶斯优化卷积双向长短期记忆网络数据多变量时间序列预测 目录 多维时序 | MATLAB实现BO-CNN-BiLSTM贝叶斯优化卷积双向长短期记忆网络数据多变量时间序列预测效果一览基本介绍模型搭建程序设计参考资料 效果一览 基本介绍 基于贝叶斯优化卷…

C/C++|物联网开发入门+项目实战|宏定义|数据声明|位操作|类型修饰符|访问固定内存位置|嵌入式C语言高级|常见面试题目讲解-学习笔记(13)

文章目录 常见面试题目讲解宏定义数据声明类型修饰符的使用总结位操作访问固定内存位置 参考&#xff1a; 麦子学院-嵌入式C语言高级-C语言函数的使用-常见面试题目讲解 参考&#xff1a; 嵌入式程序员应该知道的0x10个基本问题 常见面试题目讲解 宏定义 1 .用预处理指令#d…

ERD Online 4.1.0对接ChatGPT,实现AI建模、SQL自由

ERD Online 是全球第一个开源、免费在线数据建模、元数据管理平台。提供简单易用的元数据设计、关系图设计、SQL查询等功能&#xff0c;辅以版本、导入、导出、数据源、SQL解析、审计、团队协作等功能、方便我们快速、安全的管理数据库中的元数据。 4.1.0 ❝ :memo: fix(erd): …