diff --git a/stl/inc/__msvc_chrono.hpp b/stl/inc/__msvc_chrono.hpp index 3e854d8e27a..3f92cd0de52 100644 --- a/stl/inc/__msvc_chrono.hpp +++ b/stl/inc/__msvc_chrono.hpp @@ -25,13 +25,20 @@ _STL_DISABLE_CLANG_WARNINGS #pragma push_macro("new") #undef new +// TRANSITION, non-_Ugly attribute tokens +#pragma push_macro("msvc") +#pragma push_macro("no_specializations") +#undef msvc +#undef no_specializations + _STD_BEGIN namespace chrono { _EXPORT_STD template struct treat_as_floating_point : is_floating_point<_Rep> {}; // tests for floating-point type _EXPORT_STD template - constexpr bool treat_as_floating_point_v = treat_as_floating_point<_Rep>::value; + _NO_SPECIALIZATIONS_OF_VARIABLE_TEMPLATES constexpr bool treat_as_floating_point_v = + treat_as_floating_point<_Rep>::value; _EXPORT_STD template struct duration_values { // gets arithmetic properties of a type @@ -53,7 +60,7 @@ namespace chrono { #if _HAS_CXX20 _EXPORT_STD template - constexpr bool is_clock_v = requires { + _NO_SPECIALIZATIONS_OF_VARIABLE_TEMPLATES constexpr bool is_clock_v = requires { typename _Clock::rep; typename _Clock::period; typename _Clock::duration; @@ -62,7 +69,7 @@ namespace chrono { _Clock::now(); }; _EXPORT_STD template - struct is_clock : bool_constant> {}; + struct _NO_SPECIALIZATIONS_CITING("N5014 [time.traits.is.clock]/2") is_clock : bool_constant> {}; template constexpr bool _Is_clock_v = is_clock_v<_Clock>; @@ -688,6 +695,10 @@ namespace chrono { } // namespace chrono _STD_END +// TRANSITION, non-_Ugly attribute tokens +#pragma pop_macro("no_specializations") +#pragma pop_macro("msvc") + #pragma pop_macro("new") _STL_RESTORE_CLANG_WARNINGS #pragma warning(pop) diff --git a/stl/inc/__msvc_formatter.hpp b/stl/inc/__msvc_formatter.hpp index dfa145a3d4d..d1355eb20fc 100644 --- a/stl/inc/__msvc_formatter.hpp +++ b/stl/inc/__msvc_formatter.hpp @@ -58,6 +58,12 @@ _STL_DISABLE_CLANG_WARNINGS #pragma push_macro("new") #undef new +// TRANSITION, non-_Ugly attribute tokens +#pragma push_macro("msvc") +#pragma push_macro("no_specializations") +#undef msvc +#undef no_specializations + _STD_BEGIN #if _HAS_CXX23 #define _FMT_P2286_BEGIN inline namespace __p2286 { @@ -90,7 +96,7 @@ enum class _Basic_format_arg_type : uint8_t { static_assert(static_cast(_Basic_format_arg_type::_Custom_type) < 16, "must fit in 4-bit bitfield"); #if _HAS_CXX23 -_EXPORT_STD template +_EXPORT_STD template // specializations allowed by N5014 [format.formatter.locking]/1 constexpr bool enable_nonlocking_formatter_optimization = false; _NODISCARD consteval bool _Is_debug_enabled_fmt_type(_Basic_format_arg_type _Ty) { @@ -126,7 +132,7 @@ struct _Dynamic_format_specs : _Basic_format_specs<_CharT> { [[noreturn]] inline void _Throw_format_error(const char* _Message); _EXPORT_STD template -class basic_format_parse_context; +class _NO_SPECIALIZATIONS_CITING("N5014 [format.parse.ctx]/2") basic_format_parse_context; template concept _Format_supported_charT = _Is_any_of_v<_CharT, char, wchar_t>; @@ -328,7 +334,7 @@ struct _Invalid_format_kind { }; _EXPORT_STD template -constexpr _Invalid_format_kind<_Ty> format_kind; +constexpr _Invalid_format_kind<_Ty> format_kind; // specializations allowed by N5014 [format.range.fmtkind]/3 template constexpr bool _Is_two_tuple = false; @@ -442,6 +448,10 @@ struct _Fill_align_and_width_formatter { #endif // _HAS_CXX23 _STD_END +// TRANSITION, non-_Ugly attribute tokens +#pragma pop_macro("no_specializations") +#pragma pop_macro("msvc") + #pragma pop_macro("new") _STL_RESTORE_CLANG_WARNINGS #pragma warning(pop) diff --git a/stl/inc/__msvc_iter_core.hpp b/stl/inc/__msvc_iter_core.hpp index 2d12dac1144..812c00cfc2d 100644 --- a/stl/inc/__msvc_iter_core.hpp +++ b/stl/inc/__msvc_iter_core.hpp @@ -16,6 +16,12 @@ _STL_DISABLE_CLANG_WARNINGS #pragma push_macro("new") #undef new +// TRANSITION, non-_Ugly attribute tokens +#pragma push_macro("msvc") +#pragma push_macro("no_specializations") +#undef msvc +#undef no_specializations + _STD_BEGIN template struct _Has_allocator_type : false_type {}; // tests for suitable _Ty::allocator_type @@ -34,7 +40,7 @@ _EXPORT_STD template struct uses_allocator : _Has_allocator_type<_Ty, _Alloc>::type {}; _EXPORT_STD template -constexpr bool uses_allocator_v = uses_allocator<_Ty, _Alloc>::value; +_NO_SPECIALIZATIONS_OF_VARIABLE_TEMPLATES constexpr bool uses_allocator_v = uses_allocator<_Ty, _Alloc>::value; // from _EXPORT_STD struct input_iterator_tag {}; @@ -406,7 +412,7 @@ concept input_or_output_iterator = requires(_It __i) { _EXPORT_STD template concept sentinel_for = semiregular<_Se> && input_or_output_iterator<_It> && _Weakly_equality_comparable_with<_Se, _It>; -_EXPORT_STD template +_EXPORT_STD template // specializations allowed by N5014 [iterator.concept.sizedsentinel]/3 constexpr bool disable_sized_sentinel_for = false; _EXPORT_STD template @@ -542,6 +548,10 @@ struct _Meta_find_unique_index_<_List<_First, _Rest...>, _Ty> { }; _STD_END +// TRANSITION, non-_Ugly attribute tokens +#pragma pop_macro("no_specializations") +#pragma pop_macro("msvc") + #pragma pop_macro("new") _STL_RESTORE_CLANG_WARNINGS #pragma warning(pop) diff --git a/stl/inc/__msvc_ranges_tuple_formatter.hpp b/stl/inc/__msvc_ranges_tuple_formatter.hpp index 45d36201b1b..e47a92f8704 100644 --- a/stl/inc/__msvc_ranges_tuple_formatter.hpp +++ b/stl/inc/__msvc_ranges_tuple_formatter.hpp @@ -61,6 +61,12 @@ _STL_DISABLE_CLANG_WARNINGS #pragma push_macro("new") #undef new +// TRANSITION, non-_Ugly attribute tokens +#pragma push_macro("msvc") +#pragma push_macro("no_specializations") +#undef msvc +#undef no_specializations + _STD_BEGIN _EXPORT_STD template class vector; @@ -93,7 +99,7 @@ template class _Compile_time_parse_context; _EXPORT_STD template -class basic_format_parse_context { +class _NO_SPECIALIZATIONS_CITING("N5014 [format.parse.ctx]/2") basic_format_parse_context { public: using char_type = _CharT; using const_iterator = basic_string_view<_CharT>::const_iterator; @@ -229,7 +235,7 @@ struct _Format_handler; _FMT_P2286_END _EXPORT_STD template -class basic_format_arg { +class _NO_SPECIALIZATIONS_CITING("N5014 [format.arg]/2") basic_format_arg { public: using _CharType = _Context::char_type; @@ -674,7 +680,7 @@ class _Lazy_locale { _EXPORT_STD template requires output_iterator<_Out, const _CharT&> -class basic_format_context { +class _NO_SPECIALIZATIONS_CITING("N5014 [format.context]/2") basic_format_context { private: _Out _OutputIt; basic_format_args _Args; @@ -1256,6 +1262,10 @@ struct formatter, _CharT> : _Tuple_formatter_base&>() <=> _STD declval&>()); _EXPORT_STD template -struct compare_three_way_result {}; +struct _NO_SPECIALIZATIONS_CITING("N5014 [cmp.result]/1") compare_three_way_result {}; template requires requires { typename compare_three_way_result_t<_Ty1, _Ty2>; } @@ -841,6 +847,10 @@ inline namespace _Cpos { } _STD_END +// TRANSITION, non-_Ugly attribute tokens +#pragma pop_macro("no_specializations") +#pragma pop_macro("msvc") + #pragma pop_macro("new") _STL_RESTORE_CLANG_WARNINGS #pragma warning(pop) diff --git a/stl/inc/coroutine b/stl/inc/coroutine index 94933610fbe..268f816a014 100644 --- a/stl/inc/coroutine +++ b/stl/inc/coroutine @@ -32,6 +32,12 @@ _STL_DISABLE_CLANG_WARNINGS #pragma push_macro("new") #undef new +// TRANSITION, non-_Ugly attribute tokens +#pragma push_macro("msvc") +#pragma push_macro("no_specializations") +#undef msvc +#undef no_specializations + _STD_BEGIN template @@ -46,7 +52,7 @@ _EXPORT_STD template struct coroutine_traits : _Coroutine_traits<_Ret> {}; _EXPORT_STD template -struct coroutine_handle; +struct _NO_SPECIALIZATIONS_CITING("N5014 [coroutine.handle.general]/2") coroutine_handle; template <> struct coroutine_handle { @@ -93,7 +99,7 @@ private: }; _EXPORT_STD template -struct coroutine_handle { +struct _NO_SPECIALIZATIONS_CITING("N5014 [coroutine.handle.general]/2") coroutine_handle { constexpr coroutine_handle() noexcept = default; constexpr coroutine_handle(nullptr_t) noexcept {} @@ -255,6 +261,10 @@ _EXPORT_STD struct suspend_always { _STD_END +// TRANSITION, non-_Ugly attribute tokens +#pragma pop_macro("no_specializations") +#pragma pop_macro("msvc") + #pragma pop_macro("new") _STL_RESTORE_CLANG_WARNINGS #pragma warning(pop) diff --git a/stl/inc/functional b/stl/inc/functional index d51e506a2f8..71cc7d7f3a0 100644 --- a/stl/inc/functional +++ b/stl/inc/functional @@ -28,6 +28,12 @@ _STL_DISABLE_CLANG_WARNINGS #pragma push_macro("new") #undef new +// TRANSITION, non-_Ugly attribute tokens +#pragma push_macro("msvc") +#pragma push_macro("no_specializations") +#undef msvc +#undef no_specializations + _STD_BEGIN // plus, minus, and multiplies are defined in @@ -301,13 +307,13 @@ _STL_RESTORE_DEPRECATED_WARNING #if _HAS_AUTO_PTR_ETC _EXPORT_STD template -struct unary_function { // base class for unary functions +struct _NO_SPECIALIZATIONS_CITING("N4140 [depr.base]/1") unary_function { // base class for unary functions using argument_type = _Arg; using result_type = _Result; }; _EXPORT_STD template -struct binary_function { // base class for binary functions +struct _NO_SPECIALIZATIONS_CITING("N4140 [depr.base]/1") binary_function { // base class for binary functions using first_argument_type = _Arg1; using second_argument_type = _Arg2; using result_type = _Result; @@ -2008,7 +2014,7 @@ template struct is_placeholder : is_placeholder<_Tx>::type {}; // ignore cv-qualifiers _EXPORT_STD template -constexpr int is_placeholder_v = is_placeholder<_Ty>::value; +_NO_SPECIALIZATIONS_OF_VARIABLE_TEMPLATES constexpr int is_placeholder_v = is_placeholder<_Ty>::value; template class _Binder; @@ -2029,7 +2035,7 @@ template struct is_bind_expression : is_bind_expression<_Tx>::type {}; // ignore cv-qualifiers _EXPORT_STD template -constexpr bool is_bind_expression_v = is_bind_expression<_Ty>::value; +_NO_SPECIALIZATIONS_OF_VARIABLE_TEMPLATES constexpr bool is_bind_expression_v = is_bind_expression<_Ty>::value; template , reference_wrapper>, bool = is_bind_expression_v<_Cv_TiD>, int = is_placeholder_v<_Cv_TiD>> @@ -3160,6 +3166,10 @@ namespace _DEPRECATE_TR1_NAMESPACE tr1 { _STD_END +// TRANSITION, non-_Ugly attribute tokens +#pragma pop_macro("no_specializations") +#pragma pop_macro("msvc") + #pragma pop_macro("new") _STL_RESTORE_CLANG_WARNINGS #pragma warning(pop) diff --git a/stl/inc/generator b/stl/inc/generator index 0bc7ab7a6a8..2b870f3952c 100644 --- a/stl/inc/generator +++ b/stl/inc/generator @@ -27,7 +27,11 @@ _STL_DISABLE_CLANG_WARNINGS #undef new // TRANSITION, non-_Ugly attribute tokens +#pragma push_macro("msvc") +#pragma push_macro("no_specializations") #pragma push_macro("empty_bases") +#undef msvc +#undef no_specializations #undef empty_bases _STD_BEGIN @@ -40,7 +44,7 @@ template constexpr bool _Stateless_allocator = default_initializable<_Alloc> && allocator_traits<_Alloc>::is_always_equal::value; _EXPORT_STD template -class generator; +class _NO_SPECIALIZATIONS_CITING("N5014 [coro.generator.class]/4") generator; namespace _Gen_detail { template @@ -518,7 +522,8 @@ namespace _Gen_detail { } // namespace _Gen_detail _EXPORT_STD template -class generator : public _RANGES view_interface> { +class _NO_SPECIALIZATIONS_CITING("N5014 [coro.generator.class]/4") generator + : public _RANGES view_interface> { private: static_assert(_Gen_detail::_Valid_allocator<_Alloc>, "generator allocators must use raw pointers (N4988 [coro.generator.class]/1.1)"); @@ -603,6 +608,8 @@ _STD_END // TRANSITION, non-_Ugly attribute tokens #pragma pop_macro("empty_bases") +#pragma pop_macro("no_specializations") +#pragma pop_macro("msvc") #pragma pop_macro("new") _STL_RESTORE_CLANG_WARNINGS diff --git a/stl/inc/initializer_list b/stl/inc/initializer_list index 8ef3c5e90cf..b5d6ae7370e 100644 --- a/stl/inc/initializer_list +++ b/stl/inc/initializer_list @@ -16,9 +16,15 @@ _STL_DISABLE_CLANG_WARNINGS #pragma push_macro("new") #undef new +// TRANSITION, non-_Ugly attribute tokens +#pragma push_macro("msvc") +#pragma push_macro("no_specializations") +#undef msvc +#undef no_specializations + _STD_BEGIN _EXPORT_STD template -class initializer_list { +class _NO_SPECIALIZATIONS_CITING("N5014 [initializer.list.syn]/2") initializer_list { public: using value_type = _Elem; using reference = const _Elem&; @@ -60,6 +66,11 @@ _NODISCARD constexpr const _Elem* end(initializer_list<_Elem> _Ilist) noexcept { return _Ilist.end(); } _STD_END + +// TRANSITION, non-_Ugly attribute tokens +#pragma pop_macro("no_specializations") +#pragma pop_macro("msvc") + #pragma pop_macro("new") _STL_RESTORE_CLANG_WARNINGS #pragma warning(pop) diff --git a/stl/inc/mdspan b/stl/inc/mdspan index ea05bb61d5c..f2f1f05375a 100644 --- a/stl/inc/mdspan +++ b/stl/inc/mdspan @@ -25,7 +25,9 @@ _STL_DISABLE_CLANG_WARNINGS // TRANSITION, non-_Ugly attribute tokens #pragma push_macro("msvc") +#pragma push_macro("no_specializations") #undef msvc +#undef no_specializations _STD_BEGIN template @@ -434,17 +436,17 @@ constexpr bool _Is_mapping_of = _EXPORT_STD struct layout_left { template - class mapping; + class _NO_SPECIALIZATIONS_OF_MEMBER_CLASS_TEMPLATES mapping; }; _EXPORT_STD struct layout_right { template - class mapping; + class _NO_SPECIALIZATIONS_OF_MEMBER_CLASS_TEMPLATES mapping; }; _EXPORT_STD struct layout_stride { template - class mapping; + class _NO_SPECIALIZATIONS_OF_MEMBER_CLASS_TEMPLATES mapping; }; template @@ -477,7 +479,8 @@ struct _Maybe_fully_static_extents<_Extents> { }; template -class layout_left::mapping : private _Maybe_fully_static_extents<_Extents> { +class _NO_SPECIALIZATIONS_OF_MEMBER_CLASS_TEMPLATES layout_left::mapping + : private _Maybe_fully_static_extents<_Extents> { public: using extents_type = _Extents; using index_type = extents_type::index_type; @@ -631,7 +634,8 @@ private: }; template -class layout_right::mapping : private _Maybe_fully_static_extents<_Extents> { +class _NO_SPECIALIZATIONS_OF_MEMBER_CLASS_TEMPLATES layout_right::mapping + : private _Maybe_fully_static_extents<_Extents> { public: using extents_type = _Extents; using index_type = extents_type::index_type; @@ -816,8 +820,9 @@ _NODISCARD constexpr pair _Count_dynamic_extents_equal_to_zero_o } template -class layout_stride::mapping : private _Maybe_fully_static_extents<_Extents>, - private _Maybe_empty_array { +class _NO_SPECIALIZATIONS_OF_MEMBER_CLASS_TEMPLATES layout_stride::mapping + : private _Maybe_fully_static_extents<_Extents>, + private _Maybe_empty_array { public: using extents_type = _Extents; using index_type = extents_type::index_type; @@ -1595,6 +1600,7 @@ mdspan(const typename _AccessorType::data_handle_type&, const _MappingType&, con _STD_END // TRANSITION, non-_Ugly attribute tokens +#pragma pop_macro("no_specializations") #pragma pop_macro("msvc") #pragma pop_macro("new") diff --git a/stl/inc/numbers b/stl/inc/numbers index e82ab5f8a70..d1410126ee1 100644 --- a/stl/inc/numbers +++ b/stl/inc/numbers @@ -27,6 +27,7 @@ namespace numbers { "variable template is ill-formed. (N4950 [math.constants]/3)"); }; + // specializations allowed by N5014 [math.constants]/2 for all of these variable templates: _EXPORT_STD template constexpr _Ty e_v = _Invalid<_Ty>{}; _EXPORT_STD template diff --git a/stl/inc/ranges b/stl/inc/ranges index 4dd831145fc..897c4d19baf 100644 --- a/stl/inc/ranges +++ b/stl/inc/ranges @@ -33,7 +33,9 @@ _STL_DISABLE_CLANG_WARNINGS // TRANSITION, non-_Ugly attribute tokens #pragma push_macro("msvc") +#pragma push_macro("no_specializations") #undef msvc +#undef no_specializations _STD_BEGIN namespace ranges { @@ -546,7 +548,8 @@ namespace ranges { #if _HAS_CXX23 _EXPORT_STD template requires is_class_v<_Derived> && same_as<_Derived, remove_cv_t<_Derived>> - class range_adaptor_closure : public _Pipe::_Base<_Derived> {}; + class _NO_SPECIALIZATIONS_CITING("N5014 [range.adaptor.object]/5") range_adaptor_closure + : public _Pipe::_Base<_Derived> {}; #endif // _HAS_CXX23 _EXPORT_STD template @@ -9275,6 +9278,7 @@ _EXPORT_STD namespace views = ranges::views; _STD_END // TRANSITION, non-_Ugly attribute tokens +#pragma pop_macro("no_specializations") #pragma pop_macro("msvc") #pragma pop_macro("new") diff --git a/stl/inc/ratio b/stl/inc/ratio index ea8ecdf7495..07117b684e5 100644 --- a/stl/inc/ratio +++ b/stl/inc/ratio @@ -17,6 +17,12 @@ _STL_DISABLE_CLANG_WARNINGS #pragma push_macro("new") #undef new +// TRANSITION, non-_Ugly attribute tokens +#pragma push_macro("msvc") +#pragma push_macro("no_specializations") +#undef msvc +#undef no_specializations + _STD_BEGIN _NODISCARD constexpr intmax_t _Abs(const intmax_t _Val) noexcept { return _Val < 0 ? -_Val : _Val; @@ -167,7 +173,7 @@ struct ratio_equal : bool_constant<_Rx1::num == _Rx2::num && _Rx1::den == _Rx2:: }; _EXPORT_STD template -constexpr bool ratio_equal_v = ratio_equal<_Rx1, _Rx2>::value; +_NO_SPECIALIZATIONS_OF_VARIABLE_TEMPLATES constexpr bool ratio_equal_v = ratio_equal<_Rx1, _Rx2>::value; _EXPORT_STD template struct ratio_not_equal : bool_constant> { // tests if ratio != ratio @@ -175,7 +181,7 @@ struct ratio_not_equal : bool_constant> { // tests if }; _EXPORT_STD template -constexpr bool ratio_not_equal_v = ratio_not_equal<_Rx1, _Rx2>::value; +_NO_SPECIALIZATIONS_OF_VARIABLE_TEMPLATES constexpr bool ratio_not_equal_v = ratio_not_equal<_Rx1, _Rx2>::value; struct _Big_uint128 { uint64_t _Upper; @@ -231,7 +237,7 @@ struct ratio_less : bool_constant<_Ratio_less(_Rx1::num, _Rx1::den, _Rx2::num, _ }; _EXPORT_STD template -constexpr bool ratio_less_v = ratio_less<_Rx1, _Rx2>::value; +_NO_SPECIALIZATIONS_OF_VARIABLE_TEMPLATES constexpr bool ratio_less_v = ratio_less<_Rx1, _Rx2>::value; _EXPORT_STD template struct ratio_less_equal : bool_constant> { // tests if ratio <= ratio @@ -240,7 +246,7 @@ struct ratio_less_equal : bool_constant> { // tests if }; _EXPORT_STD template -constexpr bool ratio_less_equal_v = ratio_less_equal<_Rx1, _Rx2>::value; +_NO_SPECIALIZATIONS_OF_VARIABLE_TEMPLATES constexpr bool ratio_less_equal_v = ratio_less_equal<_Rx1, _Rx2>::value; _EXPORT_STD template struct ratio_greater : ratio_less<_Rx2, _Rx1>::type { // tests if ratio > ratio @@ -248,7 +254,7 @@ struct ratio_greater : ratio_less<_Rx2, _Rx1>::type { // tests if ratio > ratio }; _EXPORT_STD template -constexpr bool ratio_greater_v = ratio_greater<_Rx1, _Rx2>::value; +_NO_SPECIALIZATIONS_OF_VARIABLE_TEMPLATES constexpr bool ratio_greater_v = ratio_greater<_Rx1, _Rx2>::value; _EXPORT_STD template struct ratio_greater_equal : bool_constant> { // tests if ratio >= ratio @@ -257,7 +263,7 @@ struct ratio_greater_equal : bool_constant> { // tests }; _EXPORT_STD template -constexpr bool ratio_greater_equal_v = ratio_greater_equal<_Rx1, _Rx2>::value; +_NO_SPECIALIZATIONS_OF_VARIABLE_TEMPLATES constexpr bool ratio_greater_equal_v = ratio_greater_equal<_Rx1, _Rx2>::value; _EXPORT_STD using atto = ratio<1, 1000000000000000000LL>; _EXPORT_STD using femto = ratio<1, 1000000000000000LL>; @@ -276,6 +282,11 @@ _EXPORT_STD using tera = ratio<1000000000000LL, 1>; _EXPORT_STD using peta = ratio<1000000000000000LL, 1>; _EXPORT_STD using exa = ratio<1000000000000000000LL, 1>; _STD_END + +// TRANSITION, non-_Ugly attribute tokens +#pragma pop_macro("no_specializations") +#pragma pop_macro("msvc") + #pragma pop_macro("new") _STL_RESTORE_CLANG_WARNINGS #pragma warning(pop) diff --git a/stl/inc/scoped_allocator b/stl/inc/scoped_allocator index 0ad22596afa..69ce3efbcb2 100644 --- a/stl/inc/scoped_allocator +++ b/stl/inc/scoped_allocator @@ -16,6 +16,12 @@ _STL_DISABLE_CLANG_WARNINGS #pragma push_macro("new") #undef new +// TRANSITION, non-_Ugly attribute tokens +#pragma push_macro("msvc") +#pragma push_macro("no_specializations") +#undef msvc +#undef no_specializations + _STD_BEGIN template struct _Scoped_outermost_helper { // gets the outermost allocator @@ -140,7 +146,7 @@ public: using difference_type = typename _Outer_traits::difference_type; template - struct rebind { // converts X to X<_Other> + struct _NO_SPECIALIZATIONS_OF_MEMBER_CLASS_TEMPLATES rebind { // converts X to X<_Other> using _Other_alloc = typename _Get_rebind_type<_Outer, _Other>::type; using other = scoped_allocator_adaptor<_Other_alloc, _Inner...>; }; @@ -276,6 +282,11 @@ _NODISCARD bool operator!=(const scoped_allocator_adaptor<_Outer1, _Inner...>& _ #endif // !_HAS_CXX20 _STD_END + +// TRANSITION, non-_Ugly attribute tokens +#pragma pop_macro("no_specializations") +#pragma pop_macro("msvc") + #pragma pop_macro("new") _STL_RESTORE_CLANG_WARNINGS #pragma warning(pop) diff --git a/stl/inc/system_error b/stl/inc/system_error index 4a263e93ee5..c5d2c63ca7d 100644 --- a/stl/inc/system_error +++ b/stl/inc/system_error @@ -31,8 +31,10 @@ _STL_DISABLE_CLANG_WARNINGS // TRANSITION, non-_Ugly attribute tokens #pragma push_macro("msvc") #pragma push_macro("noop_dtor") +#pragma push_macro("no_specializations") #undef msvc #undef noop_dtor +#undef no_specializations _STD_BEGIN _EXPORT_STD enum class io_errc { // error codes for ios_base::failure @@ -46,7 +48,7 @@ template <> struct is_error_code_enum : true_type {}; _EXPORT_STD template -constexpr bool is_error_code_enum_v = is_error_code_enum<_Ty>::value; +_NO_SPECIALIZATIONS_OF_VARIABLE_TEMPLATES constexpr bool is_error_code_enum_v = is_error_code_enum<_Ty>::value; _EXPORT_STD template struct is_error_condition_enum : false_type {}; @@ -55,7 +57,8 @@ template <> struct is_error_condition_enum : true_type {}; _EXPORT_STD template -constexpr bool is_error_condition_enum_v = is_error_condition_enum<_Ty>::value; +_NO_SPECIALIZATIONS_OF_VARIABLE_TEMPLATES constexpr bool is_error_condition_enum_v = + is_error_condition_enum<_Ty>::value; _EXPORT_STD class error_code; _EXPORT_STD class error_condition; @@ -733,6 +736,7 @@ _STD_END #endif // _HAS_CXX17 // TRANSITION, non-_Ugly attribute tokens +#pragma pop_macro("no_specializations") #pragma pop_macro("noop_dtor") #pragma pop_macro("msvc") diff --git a/stl/inc/type_traits b/stl/inc/type_traits index 9c8e1d740dd..fd27518631c 100644 --- a/stl/inc/type_traits +++ b/stl/inc/type_traits @@ -22,9 +22,11 @@ _STL_DISABLE_CLANG_WARNINGS #pragma push_macro("msvc") #pragma push_macro("intrinsic") #pragma push_macro("known_semantics") +#pragma push_macro("no_specializations") #undef msvc #undef intrinsic #undef known_semantics +#undef no_specializations _STD_BEGIN template @@ -41,7 +43,7 @@ struct _Conjunction { // the first trait is true, }; _EXPORT_STD template -struct conjunction : true_type {}; // If _Traits is empty, true_type +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS conjunction : true_type {}; // If _Traits is empty, true_type template struct conjunction<_First, _Rest...> : _Conjunction(_First::value), _First, _Rest...>::type { @@ -49,19 +51,21 @@ struct conjunction<_First, _Rest...> : _Conjunction(_First::va }; _EXPORT_STD template -constexpr bool conjunction_v = conjunction<_Traits...>::value; +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool conjunction_v = conjunction<_Traits...>::value; _EXPORT_STD template -struct negation : bool_constant(_Trait::value)> {}; // The negated result of _Trait +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS negation : bool_constant(_Trait::value)> { + // The negated result of _Trait +}; _EXPORT_STD template -constexpr bool negation_v = negation<_Trait>::value; +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool negation_v = negation<_Trait>::value; _EXPORT_STD template -constexpr bool is_void_v = is_same_v, void>; +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_void_v = is_same_v, void>; _EXPORT_STD template -struct is_void : bool_constant> {}; +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_void : bool_constant> {}; _EXPORT_STD template using void_t = void; @@ -75,7 +79,7 @@ using _Identity_t _MSVC_KNOWN_SEMANTICS = typename _Identity<_Ty>::type; // Type modifiers _EXPORT_STD template -struct add_const { // add top-level const qualifier +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS add_const { // add top-level const qualifier using type = const _Ty; }; @@ -83,7 +87,7 @@ _EXPORT_STD template using add_const_t = typename add_const<_Ty>::type; _EXPORT_STD template -struct add_volatile { // add top-level volatile qualifier +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS add_volatile { // add top-level volatile qualifier using type = volatile _Ty; }; @@ -91,7 +95,7 @@ _EXPORT_STD template using add_volatile_t = typename add_volatile<_Ty>::type; _EXPORT_STD template -struct add_cv { // add top-level const and volatile qualifiers +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS add_cv { // add top-level const and volatile qualifiers using type = const volatile _Ty; }; @@ -111,7 +115,7 @@ struct _Add_reference<_Ty, void_t<_Ty&>> { // (referenceable type) }; _EXPORT_STD template -struct add_lvalue_reference { +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS add_lvalue_reference { using type = typename _Add_reference<_Ty>::_Lvalue; }; @@ -119,7 +123,7 @@ _EXPORT_STD template using add_lvalue_reference_t = typename _Add_reference<_Ty>::_Lvalue; _EXPORT_STD template -struct add_rvalue_reference { +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS add_rvalue_reference { using type = typename _Add_reference<_Ty>::_Rvalue; }; @@ -132,7 +136,7 @@ add_rvalue_reference_t<_Ty> declval() noexcept { } _EXPORT_STD template -struct remove_extent { // remove array extent +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS remove_extent { // remove array extent using type = _Ty; }; @@ -150,7 +154,7 @@ _EXPORT_STD template using remove_extent_t = typename remove_extent<_Ty>::type; _EXPORT_STD template -struct remove_all_extents { // remove all array extents +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS remove_all_extents { // remove all array extents using type = _Ty; }; @@ -168,7 +172,7 @@ _EXPORT_STD template using remove_all_extents_t = typename remove_all_extents<_Ty>::type; _EXPORT_STD template -struct remove_pointer { +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS remove_pointer { using type = _Ty; }; @@ -206,7 +210,7 @@ struct _Add_pointer<_Ty, void_t*>> { // (pointer type ca }; _EXPORT_STD template -struct add_pointer { +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS add_pointer { using type = typename _Add_pointer<_Ty>::type; }; @@ -214,7 +218,7 @@ _EXPORT_STD template using add_pointer_t = typename _Add_pointer<_Ty>::type; _EXPORT_STD template -constexpr bool is_array_v = false; // determine whether type argument is an array +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_array_v = false; // determine whether type argument is an array template constexpr bool is_array_v<_Ty[_Nx]> = true; @@ -223,48 +227,51 @@ template constexpr bool is_array_v<_Ty[]> = true; _EXPORT_STD template -struct is_array : bool_constant> {}; +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_array : bool_constant> {}; #if _HAS_CXX20 _EXPORT_STD template -constexpr bool is_bounded_array_v = false; +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_bounded_array_v = false; template constexpr bool is_bounded_array_v<_Ty[_Nx]> = true; _EXPORT_STD template -struct is_bounded_array : bool_constant> {}; +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_bounded_array : bool_constant> {}; _EXPORT_STD template -constexpr bool is_unbounded_array_v = false; +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_unbounded_array_v = false; template constexpr bool is_unbounded_array_v<_Ty[]> = true; _EXPORT_STD template -struct is_unbounded_array : bool_constant> {}; +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_unbounded_array : bool_constant> {}; #endif // _HAS_CXX20 _EXPORT_STD template -constexpr bool is_lvalue_reference_v = false; // determine whether type argument is an lvalue reference +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_lvalue_reference_v = + false; // determine whether type argument is an lvalue reference template constexpr bool is_lvalue_reference_v<_Ty&> = true; _EXPORT_STD template -struct is_lvalue_reference : bool_constant> {}; +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_lvalue_reference : bool_constant> {}; _EXPORT_STD template -constexpr bool is_rvalue_reference_v = false; // determine whether type argument is an rvalue reference +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_rvalue_reference_v = + false; // determine whether type argument is an rvalue reference template constexpr bool is_rvalue_reference_v<_Ty&&> = true; _EXPORT_STD template -struct is_rvalue_reference : bool_constant> {}; +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_rvalue_reference : bool_constant> {}; _EXPORT_STD template -constexpr bool is_reference_v = false; // determine whether type argument is a reference +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_reference_v = + false; // determine whether type argument is a reference template constexpr bool is_reference_v<_Ty&> = true; @@ -273,10 +280,10 @@ template constexpr bool is_reference_v<_Ty&&> = true; _EXPORT_STD template -struct is_reference : bool_constant> {}; +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_reference : bool_constant> {}; _EXPORT_STD template -constexpr bool is_pointer_v = false; // determine whether _Ty is a pointer +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_pointer_v = false; // determine whether _Ty is a pointer template constexpr bool is_pointer_v<_Ty*> = true; @@ -291,69 +298,78 @@ template constexpr bool is_pointer_v<_Ty* const volatile> = true; _EXPORT_STD template -struct is_pointer : bool_constant> {}; +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_pointer : bool_constant> {}; _EXPORT_STD template -constexpr bool is_null_pointer_v = +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_null_pointer_v = is_same_v, nullptr_t>; // determine whether _Ty is cv-qualified nullptr_t _EXPORT_STD template -struct is_null_pointer : bool_constant> {}; +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_null_pointer : bool_constant> {}; _EXPORT_STD template -struct is_union : bool_constant<__is_union(_Ty)> {}; // determine whether _Ty is a union +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_union : bool_constant<__is_union(_Ty)> { +}; // determine whether _Ty is a union _EXPORT_STD template -constexpr bool is_union_v = __is_union(_Ty); +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_union_v = __is_union(_Ty); _EXPORT_STD template -struct is_class : bool_constant<__is_class(_Ty)> {}; // determine whether _Ty is a class +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_class : bool_constant<__is_class(_Ty)> { +}; // determine whether _Ty is a class _EXPORT_STD template -constexpr bool is_class_v = __is_class(_Ty); +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_class_v = __is_class(_Ty); _EXPORT_STD template -constexpr bool is_fundamental_v = is_arithmetic_v<_Ty> || is_void_v<_Ty> || is_null_pointer_v<_Ty>; +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_fundamental_v = + is_arithmetic_v<_Ty> || is_void_v<_Ty> || is_null_pointer_v<_Ty>; _EXPORT_STD template -struct is_fundamental : bool_constant> {}; // determine whether _Ty is a fundamental type +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_fundamental : bool_constant> { + // determine whether _Ty is a fundamental type +}; _EXPORT_STD template -struct is_convertible : bool_constant<__is_convertible_to(_From, _To)> { +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_convertible : bool_constant<__is_convertible_to(_From, _To)> { // determine whether _From is convertible to _To }; _EXPORT_STD template -constexpr bool is_convertible_v = __is_convertible_to(_From, _To); +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_convertible_v = __is_convertible_to(_From, _To); _EXPORT_STD template -struct is_enum : bool_constant<__is_enum(_Ty)> {}; // determine whether _Ty is an enumerated type +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_enum : bool_constant<__is_enum(_Ty)> { +}; // determine whether _Ty is an enumerated type _EXPORT_STD template -constexpr bool is_enum_v = __is_enum(_Ty); +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_enum_v = __is_enum(_Ty); #if _HAS_CXX23 #if defined(__clang__) && !defined(__EDG__) \ && __clang_major__ >= 16 // TRANSITION, DevCom-10870354 (MSVC, EDG), VSO-2397560 (RWC relying on ancient Clang) _EXPORT_STD template -constexpr bool is_scoped_enum_v = __is_scoped_enum(_Ty); +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_scoped_enum_v = __is_scoped_enum(_Ty); _EXPORT_STD template -struct is_scoped_enum : bool_constant<__is_scoped_enum(_Ty)> {}; +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_scoped_enum : bool_constant<__is_scoped_enum(_Ty)> {}; #else // ^^^ no workaround / workaround vvv _EXPORT_STD template -constexpr bool is_scoped_enum_v = conjunction_v, negation>>; +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_scoped_enum_v = + conjunction_v, negation>>; _EXPORT_STD template -struct is_scoped_enum : bool_constant> {}; +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_scoped_enum : bool_constant> {}; #endif // ^^^ workaround ^^^ #endif // _HAS_CXX23 _EXPORT_STD template -struct is_compound : bool_constant> {}; // determine whether _Ty is a compound type +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_compound : bool_constant> { + // determine whether _Ty is a compound type +}; _EXPORT_STD template -constexpr bool is_compound_v = !is_fundamental_v<_Ty>; +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_compound_v = !is_fundamental_v<_Ty>; #define _EMIT_CDECL(FUNC, OPT1, OPT2, OPT3) FUNC(__cdecl, OPT1, OPT2, OPT3) @@ -541,46 +557,52 @@ _NON_MEMBER_CALL(_IS_MEMFUNPTR_EXPLICIT_THIS_GUIDES, , , noexcept) #ifdef __clang__ _EXPORT_STD template -constexpr bool is_member_function_pointer_v = __is_member_function_pointer(_Ty); +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_member_function_pointer_v = __is_member_function_pointer(_Ty); #else // ^^^ Clang / Other vvv _EXPORT_STD template -constexpr bool is_member_function_pointer_v = _Is_memfunptr>::_Bool_type::value; +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_member_function_pointer_v = + _Is_memfunptr>::_Bool_type::value; #endif // ^^^ Other ^^^ _EXPORT_STD template -struct is_member_function_pointer : bool_constant> {}; +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_member_function_pointer + : bool_constant> {}; _EXPORT_STD template -constexpr bool is_const_v = false; // determine whether type argument is const qualified +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_const_v = + false; // determine whether type argument is const qualified template constexpr bool is_const_v = true; _EXPORT_STD template -struct is_const : bool_constant> {}; +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_const : bool_constant> {}; _EXPORT_STD template -constexpr bool is_volatile_v = false; // determine whether type argument is volatile qualified +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_volatile_v = + false; // determine whether type argument is volatile qualified template constexpr bool is_volatile_v = true; _EXPORT_STD template -struct is_volatile : bool_constant> {}; +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_volatile : bool_constant> {}; _EXPORT_STD template -constexpr bool is_function_v = // only function types and reference types can't be const qualified +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool + is_function_v = // only function types and reference types can't be const qualified !is_const_v && !is_reference_v<_Ty>; _EXPORT_STD template -struct is_function : bool_constant> {}; +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_function : bool_constant> {}; _EXPORT_STD template -constexpr bool is_object_v = // only function types and reference types can't be const qualified +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool + is_object_v = // only function types and reference types can't be const qualified is_const_v && !is_void_v<_Ty>; _EXPORT_STD template -struct is_object : bool_constant> {}; +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_object : bool_constant> {}; template struct _Is_member_object_pointer { @@ -595,151 +617,173 @@ struct _Is_member_object_pointer<_Ty1 _Ty2::*> { #ifdef __clang__ _EXPORT_STD template -constexpr bool is_member_object_pointer_v = __is_member_object_pointer(_Ty); +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_member_object_pointer_v = __is_member_object_pointer(_Ty); #else // ^^^ Clang / Other vvv _EXPORT_STD template -constexpr bool is_member_object_pointer_v = _Is_member_object_pointer>::value; +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_member_object_pointer_v = + _Is_member_object_pointer>::value; #endif // ^^^ Other ^^^ _EXPORT_STD template -struct is_member_object_pointer : bool_constant> {}; +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_member_object_pointer : bool_constant> {}; #ifdef __clang__ _EXPORT_STD template -constexpr bool is_member_pointer_v = __is_member_pointer(_Ty); +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_member_pointer_v = __is_member_pointer(_Ty); #else // ^^^ Clang / Other vvv _EXPORT_STD template -constexpr bool is_member_pointer_v = is_member_object_pointer_v<_Ty> || is_member_function_pointer_v<_Ty>; +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_member_pointer_v = + is_member_object_pointer_v<_Ty> || is_member_function_pointer_v<_Ty>; #endif // ^^^ Other ^^^ _EXPORT_STD template -struct is_member_pointer : bool_constant> {}; // determine whether _Ty is a pointer to member +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_member_pointer : bool_constant> { + // determine whether _Ty is a pointer to member +}; _EXPORT_STD template -constexpr bool is_scalar_v = // determine whether _Ty is a scalar type +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_scalar_v = // determine whether _Ty is a scalar type is_arithmetic_v<_Ty> || is_enum_v<_Ty> || is_pointer_v<_Ty> || is_member_pointer_v<_Ty> || is_null_pointer_v<_Ty>; _EXPORT_STD template -struct is_scalar : bool_constant> {}; +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_scalar : bool_constant> {}; _EXPORT_STD template -struct _CXX20_DEPRECATE_IS_POD is_pod : bool_constant<__is_pod(_Ty)> {}; // determine whether _Ty is a POD type +struct _CXX20_DEPRECATE_IS_POD _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_pod : bool_constant<__is_pod(_Ty)> { + // determine whether _Ty is a POD type +}; _EXPORT_STD template -_CXX20_DEPRECATE_IS_POD constexpr bool is_pod_v = __is_pod(_Ty); +_CXX20_DEPRECATE_IS_POD _NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_pod_v = __is_pod(_Ty); _EXPORT_STD template -struct is_empty : bool_constant<__is_empty(_Ty)> {}; // determine whether _Ty is an empty class +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_empty : bool_constant<__is_empty(_Ty)> { +}; // determine whether _Ty is an empty class _EXPORT_STD template -constexpr bool is_empty_v = __is_empty(_Ty); +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_empty_v = __is_empty(_Ty); _EXPORT_STD template -struct is_polymorphic : bool_constant<__is_polymorphic(_Ty)> {}; // determine whether _Ty is a polymorphic type +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_polymorphic : bool_constant<__is_polymorphic(_Ty)> { + // determine whether _Ty is a polymorphic type +}; _EXPORT_STD template -constexpr bool is_polymorphic_v = __is_polymorphic(_Ty); +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_polymorphic_v = __is_polymorphic(_Ty); _EXPORT_STD template -struct is_abstract : bool_constant<__is_abstract(_Ty)> {}; // determine whether _Ty is an abstract class +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_abstract : bool_constant<__is_abstract(_Ty)> { + // determine whether _Ty is an abstract class +}; _EXPORT_STD template -constexpr bool is_abstract_v = __is_abstract(_Ty); +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_abstract_v = __is_abstract(_Ty); _EXPORT_STD template -struct is_final : bool_constant<__is_final(_Ty)> {}; // determine whether _Ty is a final class +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_final : bool_constant<__is_final(_Ty)> { +}; // determine whether _Ty is a final class _EXPORT_STD template -constexpr bool is_final_v = __is_final(_Ty); +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_final_v = __is_final(_Ty); _EXPORT_STD template -struct is_standard_layout : bool_constant<__is_standard_layout(_Ty)> {}; // determine whether _Ty is standard layout +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_standard_layout : bool_constant<__is_standard_layout(_Ty)> { + // determine whether _Ty is standard layout +}; _EXPORT_STD template -constexpr bool is_standard_layout_v = __is_standard_layout(_Ty); +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_standard_layout_v = __is_standard_layout(_Ty); #if _HAS_DEPRECATED_IS_LITERAL_TYPE _EXPORT_STD template -struct _CXX17_DEPRECATE_IS_LITERAL_TYPE is_literal_type : bool_constant<__is_literal_type(_Ty)> { +struct _CXX17_DEPRECATE_IS_LITERAL_TYPE _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_literal_type + : bool_constant<__is_literal_type(_Ty)> { // determine whether _Ty is a literal type }; _EXPORT_STD template -_CXX17_DEPRECATE_IS_LITERAL_TYPE constexpr bool is_literal_type_v = __is_literal_type(_Ty); +_CXX17_DEPRECATE_IS_LITERAL_TYPE _NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_literal_type_v = + __is_literal_type(_Ty); #endif // _HAS_DEPRECATED_IS_LITERAL_TYPE _EXPORT_STD template -struct is_trivial : bool_constant<__is_trivial(_Ty)> {}; // determine whether _Ty is a trivial type +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_trivial : bool_constant<__is_trivial(_Ty)> { +}; // determine whether _Ty is a trivial type _EXPORT_STD template -constexpr bool is_trivial_v = __is_trivial(_Ty); +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_trivial_v = __is_trivial(_Ty); _EXPORT_STD template -struct is_trivially_copyable : bool_constant<__is_trivially_copyable(_Ty)> { +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_trivially_copyable : bool_constant<__is_trivially_copyable(_Ty)> { // determine whether _Ty is a trivially copyable type }; _EXPORT_STD template -constexpr bool is_trivially_copyable_v = __is_trivially_copyable(_Ty); +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_trivially_copyable_v = __is_trivially_copyable(_Ty); _EXPORT_STD template -struct has_virtual_destructor : bool_constant<__has_virtual_destructor(_Ty)> { +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS has_virtual_destructor : bool_constant<__has_virtual_destructor(_Ty)> { // determine whether _Ty has a virtual destructor }; _EXPORT_STD template -constexpr bool has_virtual_destructor_v = __has_virtual_destructor(_Ty); +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool has_virtual_destructor_v = __has_virtual_destructor(_Ty); #if _HAS_CXX17 _EXPORT_STD template -struct has_unique_object_representations : bool_constant<__has_unique_object_representations(_Ty)> { +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS has_unique_object_representations + : bool_constant<__has_unique_object_representations(_Ty)> { // determine whether _Ty has unique object representations }; _EXPORT_STD template -constexpr bool has_unique_object_representations_v = __has_unique_object_representations(_Ty); +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool has_unique_object_representations_v = + __has_unique_object_representations(_Ty); #ifdef __EDG__ // TRANSITION, VSO-1690654 template struct _Is_aggregate_impl : bool_constant<__is_aggregate(_Ty)> {}; _EXPORT_STD template -constexpr bool is_aggregate_v = disjunction_v, _Is_aggregate_impl<_Ty>>; +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_aggregate_v = + disjunction_v, _Is_aggregate_impl<_Ty>>; _EXPORT_STD template -struct is_aggregate : bool_constant> {}; +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_aggregate : bool_constant> {}; #else // ^^^ workaround / no workaround vvv _EXPORT_STD template -struct is_aggregate : bool_constant<__is_aggregate(_Ty)> {}; +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_aggregate : bool_constant<__is_aggregate(_Ty)> {}; _EXPORT_STD template -constexpr bool is_aggregate_v = __is_aggregate(_Ty); +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_aggregate_v = __is_aggregate(_Ty); #endif // ^^^ no workaround ^^^ #endif // _HAS_CXX17 _EXPORT_STD template -struct is_constructible : bool_constant<__is_constructible(_Ty, _Args...)> { +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_constructible : bool_constant<__is_constructible(_Ty, _Args...)> { // determine whether _Ty can be direct-initialized with _Args... }; _EXPORT_STD template -constexpr bool is_constructible_v = __is_constructible(_Ty, _Args...); +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_constructible_v = __is_constructible(_Ty, _Args...); _EXPORT_STD template -struct is_copy_constructible : bool_constant<__is_constructible(_Ty, add_lvalue_reference_t)> { +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_copy_constructible + : bool_constant<__is_constructible(_Ty, add_lvalue_reference_t)> { // determine whether _Ty can be direct-initialized with an lvalue const _Ty }; _EXPORT_STD template -constexpr bool is_copy_constructible_v = __is_constructible(_Ty, add_lvalue_reference_t); +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_copy_constructible_v = + __is_constructible(_Ty, add_lvalue_reference_t); _EXPORT_STD template -struct is_default_constructible : bool_constant<__is_constructible(_Ty)> { +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_default_constructible : bool_constant<__is_constructible(_Ty)> { // determine whether _Ty can be value-initialized }; _EXPORT_STD template -constexpr bool is_default_constructible_v = __is_constructible(_Ty); +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_default_constructible_v = __is_constructible(_Ty); template struct _Is_implicitly_default_constructible : false_type { @@ -754,18 +798,20 @@ struct _Is_implicitly_default_constructible<_Ty, void_t -struct is_move_constructible : bool_constant<__is_constructible(_Ty, _Ty)> { +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_move_constructible : bool_constant<__is_constructible(_Ty, _Ty)> { // determine whether _Ty can be direct-initialized from an rvalue _Ty }; _EXPORT_STD template -constexpr bool is_move_constructible_v = __is_constructible(_Ty, _Ty); +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_move_constructible_v = __is_constructible(_Ty, _Ty); _EXPORT_STD template -struct is_assignable : bool_constant<__is_assignable(_To, _From)> {}; // determine whether _From can be assigned to _To +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_assignable : bool_constant<__is_assignable(_To, _From)> { + // determine whether _From can be assigned to _To +}; _EXPORT_STD template -constexpr bool is_assignable_v = __is_assignable(_To, _From); +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_assignable_v = __is_assignable(_To, _From); #if defined(_IS_ASSIGNABLE_NOCHECK_SUPPORTED) && !defined(__CUDACC__) template @@ -776,13 +822,14 @@ using _Is_assignable_no_precondition_check = is_assignable<_To, _From>; #endif // ^^^ intrinsic not supported ^^^ _EXPORT_STD template -struct is_copy_assignable +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_copy_assignable : bool_constant<__is_assignable(add_lvalue_reference_t<_Ty>, add_lvalue_reference_t)> { // determine whether an lvalue const _Ty can be assigned to an lvalue _Ty }; _EXPORT_STD template -constexpr bool is_copy_assignable_v = __is_assignable(add_lvalue_reference_t<_Ty>, add_lvalue_reference_t); +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_copy_assignable_v = + __is_assignable(add_lvalue_reference_t<_Ty>, add_lvalue_reference_t); #if defined(_IS_ASSIGNABLE_NOCHECK_SUPPORTED) && !defined(__CUDACC__) template @@ -802,12 +849,14 @@ constexpr bool _Is_copy_assignable_unchecked_v = is_copy_assignable_v<_Ty>; #endif // ^^^ intrinsic not supported ^^^ _EXPORT_STD template -struct is_move_assignable : bool_constant<__is_assignable(add_lvalue_reference_t<_Ty>, _Ty)> { +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_move_assignable + : bool_constant<__is_assignable(add_lvalue_reference_t<_Ty>, _Ty)> { // determine whether an rvalue _Ty can be assigned to an lvalue _Ty }; _EXPORT_STD template -constexpr bool is_move_assignable_v = __is_assignable(add_lvalue_reference_t<_Ty>, _Ty); +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_move_assignable_v = + __is_assignable(add_lvalue_reference_t<_Ty>, _Ty); #if defined(_IS_ASSIGNABLE_NOCHECK_SUPPORTED) && !defined(__CUDACC__) template @@ -826,148 +875,166 @@ constexpr bool _Is_move_assignable_unchecked_v = is_move_assignable_v<_Ty>; #endif // ^^^ intrinsic not supported ^^^ _EXPORT_STD template -struct is_destructible : bool_constant<__is_destructible(_Ty)> { +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_destructible : bool_constant<__is_destructible(_Ty)> { // true iff remove_all_extents_t<_Ty> is a reference type, or can be explicitly destroyed }; _EXPORT_STD template -constexpr bool is_destructible_v = __is_destructible(_Ty); +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_destructible_v = __is_destructible(_Ty); _EXPORT_STD template -struct is_trivially_constructible : bool_constant<__is_trivially_constructible(_Ty, _Args...)> { +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_trivially_constructible + : bool_constant<__is_trivially_constructible(_Ty, _Args...)> { // determine whether direct-initialization of _Ty with _Args... is trivial }; _EXPORT_STD template -constexpr bool is_trivially_constructible_v = __is_trivially_constructible(_Ty, _Args...); +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_trivially_constructible_v = + __is_trivially_constructible(_Ty, _Args...); _EXPORT_STD template -struct is_trivially_copy_constructible +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_trivially_copy_constructible : bool_constant<__is_trivially_constructible(_Ty, add_lvalue_reference_t)> { // determine whether direct-initialization of _Ty with an lvalue const _Ty is trivial }; _EXPORT_STD template -constexpr bool is_trivially_copy_constructible_v = __is_trivially_constructible(_Ty, add_lvalue_reference_t); +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_trivially_copy_constructible_v = + __is_trivially_constructible(_Ty, add_lvalue_reference_t); _EXPORT_STD template -struct is_trivially_default_constructible : bool_constant<__is_trivially_constructible(_Ty)> { +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_trivially_default_constructible + : bool_constant<__is_trivially_constructible(_Ty)> { // determine whether value-initialization of _Ty is trivial }; _EXPORT_STD template -constexpr bool is_trivially_default_constructible_v = __is_trivially_constructible(_Ty); +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_trivially_default_constructible_v = + __is_trivially_constructible(_Ty); _EXPORT_STD template -struct is_trivially_move_constructible : bool_constant<__is_trivially_constructible(_Ty, _Ty)> { +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_trivially_move_constructible + : bool_constant<__is_trivially_constructible(_Ty, _Ty)> { // determine whether direct-initialization of _Ty with an rvalue _Ty is trivial }; _EXPORT_STD template -constexpr bool is_trivially_move_constructible_v = __is_trivially_constructible(_Ty, _Ty); +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_trivially_move_constructible_v = + __is_trivially_constructible(_Ty, _Ty); _EXPORT_STD template -struct is_trivially_assignable : bool_constant<__is_trivially_assignable(_To, _From)> { +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_trivially_assignable + : bool_constant<__is_trivially_assignable(_To, _From)> { // determine whether _From can be trivially assigned to _To }; _EXPORT_STD template -constexpr bool is_trivially_assignable_v = __is_trivially_assignable(_To, _From); +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_trivially_assignable_v = __is_trivially_assignable(_To, _From); _EXPORT_STD template -struct is_trivially_copy_assignable +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_trivially_copy_assignable : bool_constant<__is_trivially_assignable(add_lvalue_reference_t<_Ty>, add_lvalue_reference_t)> { // determine whether an lvalue const _Ty can be trivially assigned to an lvalue _Ty }; _EXPORT_STD template -constexpr bool is_trivially_copy_assignable_v = +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_trivially_copy_assignable_v = __is_trivially_assignable(add_lvalue_reference_t<_Ty>, add_lvalue_reference_t); _EXPORT_STD template -struct is_trivially_move_assignable : bool_constant<__is_trivially_assignable(add_lvalue_reference_t<_Ty>, _Ty)> { +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_trivially_move_assignable + : bool_constant<__is_trivially_assignable(add_lvalue_reference_t<_Ty>, _Ty)> { // determine whether an rvalue _Ty can be trivially assigned to an lvalue _Ty }; _EXPORT_STD template -constexpr bool is_trivially_move_assignable_v = __is_trivially_assignable(add_lvalue_reference_t<_Ty>, _Ty); +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_trivially_move_assignable_v = + __is_trivially_assignable(add_lvalue_reference_t<_Ty>, _Ty); _EXPORT_STD template -struct is_trivially_destructible : bool_constant<__is_trivially_destructible(_Ty)> { +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_trivially_destructible : bool_constant<__is_trivially_destructible(_Ty)> { // determine whether remove_all_extents_t<_Ty> is a reference type or can trivially be explicitly destroyed }; _EXPORT_STD template -constexpr bool is_trivially_destructible_v = __is_trivially_destructible(_Ty); +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_trivially_destructible_v = __is_trivially_destructible(_Ty); _EXPORT_STD template -struct is_nothrow_constructible : bool_constant<__is_nothrow_constructible(_Ty, _Args...)> { +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_nothrow_constructible + : bool_constant<__is_nothrow_constructible(_Ty, _Args...)> { // determine whether direct-initialization of _Ty from _Args... is both valid and not potentially-throwing }; _EXPORT_STD template -constexpr bool is_nothrow_constructible_v = __is_nothrow_constructible(_Ty, _Args...); +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_nothrow_constructible_v = + __is_nothrow_constructible(_Ty, _Args...); _EXPORT_STD template -struct is_nothrow_copy_constructible +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_nothrow_copy_constructible : bool_constant<__is_nothrow_constructible(_Ty, add_lvalue_reference_t)> { // determine whether direct-initialization of _Ty from an lvalue const _Ty is both valid // and not potentially-throwing }; _EXPORT_STD template -constexpr bool is_nothrow_copy_constructible_v = __is_nothrow_constructible(_Ty, add_lvalue_reference_t); +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_nothrow_copy_constructible_v = + __is_nothrow_constructible(_Ty, add_lvalue_reference_t); _EXPORT_STD template -struct is_nothrow_default_constructible : bool_constant<__is_nothrow_constructible(_Ty)> { +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_nothrow_default_constructible + : bool_constant<__is_nothrow_constructible(_Ty)> { // determine whether value-initialization of _Ty is both valid and not potentially-throwing }; _EXPORT_STD template -constexpr bool is_nothrow_default_constructible_v = __is_nothrow_constructible(_Ty); +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_nothrow_default_constructible_v = __is_nothrow_constructible(_Ty); _EXPORT_STD template -struct is_nothrow_move_constructible : bool_constant<__is_nothrow_constructible(_Ty, _Ty)> { +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_nothrow_move_constructible + : bool_constant<__is_nothrow_constructible(_Ty, _Ty)> { // determine whether direct-initialization of _Ty from an rvalue _Ty is both valid and not potentially-throwing }; _EXPORT_STD template -constexpr bool is_nothrow_move_constructible_v = __is_nothrow_constructible(_Ty, _Ty); +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_nothrow_move_constructible_v = + __is_nothrow_constructible(_Ty, _Ty); _EXPORT_STD template -struct is_nothrow_assignable : bool_constant<__is_nothrow_assignable(_To, _From)> { +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_nothrow_assignable : bool_constant<__is_nothrow_assignable(_To, _From)> { // determine whether assignment of _From to _To is both valid and not potentially-throwing }; _EXPORT_STD template -constexpr bool is_nothrow_assignable_v = __is_nothrow_assignable(_To, _From); +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_nothrow_assignable_v = __is_nothrow_assignable(_To, _From); _EXPORT_STD template -struct is_nothrow_copy_assignable +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_nothrow_copy_assignable : bool_constant<__is_nothrow_assignable(add_lvalue_reference_t<_Ty>, add_lvalue_reference_t)> { // determine whether assignment of an lvalue const _Ty to an lvalue _Ty is both valid and not potentially-throwing }; _EXPORT_STD template -constexpr bool is_nothrow_copy_assignable_v = +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_nothrow_copy_assignable_v = __is_nothrow_assignable(add_lvalue_reference_t<_Ty>, add_lvalue_reference_t); _EXPORT_STD template -struct is_nothrow_move_assignable : bool_constant<__is_nothrow_assignable(add_lvalue_reference_t<_Ty>, _Ty)> { +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_nothrow_move_assignable + : bool_constant<__is_nothrow_assignable(add_lvalue_reference_t<_Ty>, _Ty)> { // determine whether assignment of an rvalue _Ty to an lvalue _Ty is both valid and not potentially-throwing }; _EXPORT_STD template -constexpr bool is_nothrow_move_assignable_v = __is_nothrow_assignable(add_lvalue_reference_t<_Ty>, _Ty); +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_nothrow_move_assignable_v = + __is_nothrow_assignable(add_lvalue_reference_t<_Ty>, _Ty); _EXPORT_STD template -struct is_nothrow_destructible : bool_constant<__is_nothrow_destructible(_Ty)> { +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_nothrow_destructible : bool_constant<__is_nothrow_destructible(_Ty)> { // determine whether remove_all_extents_t<_Ty> is a reference type or has // non-potentially-throwing explicit destruction }; _EXPORT_STD template -constexpr bool is_nothrow_destructible_v = __is_nothrow_destructible(_Ty); +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_nothrow_destructible_v = __is_nothrow_destructible(_Ty); template > struct _Sign_base { // determine whether integral type _Ty is signed or unsigned @@ -985,16 +1052,20 @@ struct _Sign_base<_Ty, false> { // floating-point _Ty is signed }; _EXPORT_STD template -struct is_signed : bool_constant<_Sign_base<_Ty>::_Signed> {}; // determine whether _Ty is a signed type +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_signed : bool_constant<_Sign_base<_Ty>::_Signed> { + // determine whether _Ty is a signed type +}; _EXPORT_STD template -constexpr bool is_signed_v = _Sign_base<_Ty>::_Signed; +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_signed_v = _Sign_base<_Ty>::_Signed; _EXPORT_STD template -struct is_unsigned : bool_constant<_Sign_base<_Ty>::_Unsigned> {}; // determine whether _Ty is an unsigned type +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_unsigned : bool_constant<_Sign_base<_Ty>::_Unsigned> { + // determine whether _Ty is an unsigned type +}; _EXPORT_STD template -constexpr bool is_unsigned_v = _Sign_base<_Ty>::_Unsigned; +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_unsigned_v = _Sign_base<_Ty>::_Unsigned; template constexpr bool _Is_nonbool_integral = is_integral_v<_Ty> && !is_same_v, bool>; @@ -1044,7 +1115,7 @@ using _Make_signed1 = // signed partner to cv-unqualified _Ty typename _Make_signed2::template _Apply<_Ty>; _EXPORT_STD template -struct make_signed { // signed partner to _Ty +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS make_signed { // signed partner to _Ty static_assert(_Is_nonbool_integral<_Ty> || is_enum_v<_Ty>, "make_signed requires that T shall be a (possibly cv-qualified) " "integral type or enumeration but not a bool type."); @@ -1089,7 +1160,7 @@ using _Make_unsigned1 = // unsigned partner to cv-unqualified _Ty typename _Make_unsigned2::template _Apply<_Ty>; _EXPORT_STD template -struct make_unsigned { // unsigned partner to _Ty +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS make_unsigned { // unsigned partner to _Ty static_assert(_Is_nonbool_integral<_Ty> || is_enum_v<_Ty>, "make_unsigned requires that T shall be a (possibly cv-qualified) " "integral type or enumeration but not a bool type."); @@ -1106,10 +1177,11 @@ constexpr make_unsigned_t<_Rep> _Unsigned_value(_Rep _Val) { // makes _Val unsig } _EXPORT_STD template -struct alignment_of : integral_constant {}; // determine alignment of _Ty +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS alignment_of : integral_constant { +}; // determine alignment of _Ty _EXPORT_STD template -constexpr size_t alignment_of_v = alignof(_Ty); +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr size_t alignment_of_v = alignof(_Ty); template union _Align_type { // union with size _Len bytes and alignment of _Ty @@ -1180,7 +1252,8 @@ template using _Aligned_storage_t = typename _Aligned_storage<_Len, _Align>::type; _EXPORT_STD template -struct _CXX23_DEPRECATE_ALIGNED_STORAGE aligned_storage { // define type with size _Len and alignment _Align +struct _CXX23_DEPRECATE_ALIGNED_STORAGE _NO_SPECIALIZATIONS_OF_TYPE_TRAITS aligned_storage { + // define type with size _Len and alignment _Align using type = _Aligned_storage_t<_Len, _Align>; }; @@ -1202,7 +1275,7 @@ struct _Maximum<_First, _Second, _Rest...> : _Maximum<(_First < _Second ? _Secon }; _EXPORT_STD template -struct _CXX23_DEPRECATE_ALIGNED_UNION aligned_union { +struct _CXX23_DEPRECATE_ALIGNED_UNION _NO_SPECIALIZATIONS_OF_TYPE_TRAITS aligned_union { // define type with size at least _Len, for storing anything in _Types static constexpr size_t _Max_len = _Maximum<_Len, sizeof(_Types)...>::value; // NOT sizeof...(_Types) static constexpr size_t alignment_value = _Maximum::value; @@ -1224,13 +1297,14 @@ template struct _Underlying_type<_Ty, false> {}; _EXPORT_STD template -struct underlying_type : _Underlying_type<_Ty> {}; // determine underlying type for enum +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS underlying_type : _Underlying_type<_Ty> { +}; // determine underlying type for enum _EXPORT_STD template using underlying_type_t = typename _Underlying_type<_Ty>::type; _EXPORT_STD template -constexpr size_t rank_v = 0; // determine number of dimensions of array _Ty +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr size_t rank_v = 0; // determine number of dimensions of array _Ty template constexpr size_t rank_v<_Ty[_Nx]> = rank_v<_Ty> + 1; @@ -1239,10 +1313,10 @@ template constexpr size_t rank_v<_Ty[]> = rank_v<_Ty> + 1; _EXPORT_STD template -struct rank : integral_constant> {}; +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS rank : integral_constant> {}; _EXPORT_STD template -constexpr size_t extent_v = 0; // determine extent of dimension _Ix of array _Ty +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr size_t extent_v = 0; // determine extent of dimension _Ix of array _Ty template constexpr size_t extent_v<_Ty[_Nx], 0> = _Nx; @@ -1254,18 +1328,18 @@ template constexpr size_t extent_v<_Ty[], _Ix> = extent_v<_Ty, _Ix - 1>; _EXPORT_STD template -struct extent : integral_constant> {}; +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS extent : integral_constant> {}; _EXPORT_STD template -struct is_base_of : bool_constant<__is_base_of(_Base, _Derived)> { +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_base_of : bool_constant<__is_base_of(_Base, _Derived)> { // determine whether _Base is a base of or the same as _Derived }; _EXPORT_STD template -constexpr bool is_base_of_v = __is_base_of(_Base, _Derived); +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_base_of_v = __is_base_of(_Base, _Derived); _EXPORT_STD template -struct decay { // determines decayed version of _Ty +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS decay { // determines decayed version of _Ty using _Ty1 = remove_reference_t<_Ty>; using _Ty2 = typename _Select>::template _Apply, remove_cv<_Ty1>>; using type = typename _Select>::template _Apply>, _Ty2>::type; @@ -1302,7 +1376,7 @@ struct _Decayed_cond_oper<_Ty1, _Ty2, void_t<_Conditional_type<_Ty1, _Ty2>>> { }; _EXPORT_STD template -struct common_type; +struct common_type; // specializations allowed by N5014 [meta.trans.other]/5 _EXPORT_STD template using common_type_t = typename common_type<_Ty...>::type; @@ -1337,7 +1411,7 @@ _Ty _Returns_exactly() noexcept; // not defined #if _HAS_CXX20 _EXPORT_STD template class, template class> -struct basic_common_reference {}; +struct basic_common_reference {}; // specializations allowed by N5014 [meta.trans.other]/7 template struct _Copy_cv_impl { @@ -1384,7 +1458,8 @@ using _Cond_res = // N4950 [meta.trans.other]/2.4 decltype(false ? _Returns_exactly<_Ty1>() : _Returns_exactly<_Ty2>()); _EXPORT_STD template -struct common_reference; +struct _NO_SPECIALIZATIONS_CITING("N5014 [meta.rqmts]/4; instead, you should specialize std::basic_common_reference " + "as allowed by N5014 [meta.trans.other]/7") common_reference; _EXPORT_STD template using common_reference_t = common_reference<_Types...>::type; @@ -1490,7 +1565,7 @@ struct common_reference<_Ty1, _Ty2, _Ty3, _Rest...> : common_reference -struct type_identity { +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS type_identity { using type = _Ty; }; _EXPORT_STD template @@ -1730,10 +1805,11 @@ struct _Is_nothrow_convertible : bool_constant<_Is_nothrow_convertible_v<_From, #if _HAS_CXX20 _EXPORT_STD template -constexpr bool is_nothrow_convertible_v = _Is_nothrow_convertible_v<_From, _To>; +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_nothrow_convertible_v = _Is_nothrow_convertible_v<_From, _To>; _EXPORT_STD template -struct is_nothrow_convertible : bool_constant<_Is_nothrow_convertible_v<_From, _To>> {}; +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_nothrow_convertible + : bool_constant<_Is_nothrow_convertible_v<_From, _To>> {}; #endif // _HAS_CXX20 template @@ -1805,7 +1881,7 @@ using _Select_invoke_traits = conditional_t -struct _CXX17_DEPRECATE_RESULT_OF result_of { // explain usage +struct _CXX17_DEPRECATE_RESULT_OF _NO_SPECIALIZATIONS_OF_TYPE_TRAITS result_of { // explain usage static_assert(_Always_false<_Fty>, "result_of is invalid; use " "result_of instead."); }; @@ -1838,7 +1914,7 @@ struct _Is_invocable_r : _Is_invocable_r_<_Rx, _Callable, _Args...> { #if _HAS_CXX17 _EXPORT_STD template -struct invoke_result : _Select_invoke_traits<_Callable, _Args...> { +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS invoke_result : _Select_invoke_traits<_Callable, _Args...> { // determine the result type of invoking _Callable with _Args }; @@ -1846,60 +1922,68 @@ _EXPORT_STD template using invoke_result_t = typename _Select_invoke_traits<_Callable, _Args...>::type; _EXPORT_STD template -struct is_invocable : _Select_invoke_traits<_Callable, _Args...>::_Is_invocable { +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_invocable : _Select_invoke_traits<_Callable, _Args...>::_Is_invocable { // determines whether _Callable is callable with _Args }; _EXPORT_STD template -constexpr bool is_invocable_v = _Select_invoke_traits<_Callable, _Args...>::_Is_invocable::value; +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_invocable_v = + _Select_invoke_traits<_Callable, _Args...>::_Is_invocable::value; _EXPORT_STD template -struct is_nothrow_invocable : _Select_invoke_traits<_Callable, _Args...>::_Is_nothrow_invocable { +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_nothrow_invocable + : _Select_invoke_traits<_Callable, _Args...>::_Is_nothrow_invocable { // determines whether _Callable is nothrow-callable with _Args }; _EXPORT_STD template -constexpr bool is_nothrow_invocable_v = _Select_invoke_traits<_Callable, _Args...>::_Is_nothrow_invocable::value; +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_nothrow_invocable_v = + _Select_invoke_traits<_Callable, _Args...>::_Is_nothrow_invocable::value; _EXPORT_STD template -struct is_invocable_r : _Is_invocable_r_<_Rx, _Callable, _Args...> { +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_invocable_r : _Is_invocable_r_<_Rx, _Callable, _Args...> { // determines whether _Callable is callable with _Args and return type _Rx }; _EXPORT_STD template -constexpr bool is_invocable_r_v = _Is_invocable_r_<_Rx, _Callable, _Args...>::value; +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_invocable_r_v = _Is_invocable_r_<_Rx, _Callable, _Args...>::value; _EXPORT_STD template -struct is_nothrow_invocable_r : _Select_invoke_traits<_Callable, _Args...>::template _Is_nothrow_invocable_r<_Rx> { +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_nothrow_invocable_r + : _Select_invoke_traits<_Callable, _Args...>::template _Is_nothrow_invocable_r<_Rx> { // determines whether _Callable is nothrow-callable with _Args and return type _Rx }; _EXPORT_STD template -constexpr bool is_nothrow_invocable_r_v = +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_nothrow_invocable_r_v = _Select_invoke_traits<_Callable, _Args...>::template _Is_nothrow_invocable_r<_Rx>::value; #endif // _HAS_CXX17 #if _HAS_CXX20 #ifndef __clang__ // TRANSITION, LLVM-48860 _EXPORT_STD template -struct is_layout_compatible : bool_constant<__is_layout_compatible(_Ty1, _Ty2)> {}; +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_layout_compatible : bool_constant<__is_layout_compatible(_Ty1, _Ty2)> {}; _EXPORT_STD template -constexpr bool is_layout_compatible_v = __is_layout_compatible(_Ty1, _Ty2); +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_layout_compatible_v = __is_layout_compatible(_Ty1, _Ty2); _EXPORT_STD template -struct is_pointer_interconvertible_base_of : bool_constant<__is_pointer_interconvertible_base_of(_Base, _Derived)> {}; +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_pointer_interconvertible_base_of + : bool_constant<__is_pointer_interconvertible_base_of(_Base, _Derived)> {}; _EXPORT_STD template -constexpr bool is_pointer_interconvertible_base_of_v = __is_pointer_interconvertible_base_of(_Base, _Derived); +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_pointer_interconvertible_base_of_v = + __is_pointer_interconvertible_base_of(_Base, _Derived); _EXPORT_STD template -_NODISCARD constexpr bool is_pointer_interconvertible_with_class(_MemberTy _ClassTy::* _Pm) noexcept { +_NODISCARD _NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_pointer_interconvertible_with_class( + _MemberTy _ClassTy::* _Pm) noexcept { return __is_pointer_interconvertible_with_class(_ClassTy, _Pm); } _EXPORT_STD template -_NODISCARD constexpr bool is_corresponding_member(_MemberTy1 _ClassTy1::* _Pm1, _MemberTy2 _ClassTy2::* _Pm2) noexcept { +_NODISCARD _NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_corresponding_member( + _MemberTy1 _ClassTy1::* _Pm1, _MemberTy2 _ClassTy2::* _Pm2) noexcept { return __is_corresponding_member(_ClassTy1, _ClassTy2, _Pm1, _Pm2); } #endif // ^^^ no workaround ^^^ @@ -2050,7 +2134,7 @@ _NODISCARD _CONSTEXPR20 reference_wrapper cref(reference_wrapper<_Ty> #if _HAS_CXX20 _EXPORT_STD template -struct unwrap_reference { +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS unwrap_reference { using type = _Ty; }; template @@ -2063,7 +2147,7 @@ using unwrap_reference_t = unwrap_reference<_Ty>::type; _EXPORT_STD template using unwrap_ref_decay_t = unwrap_reference_t>; _EXPORT_STD template -struct unwrap_ref_decay { +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS unwrap_ref_decay { using type = unwrap_ref_decay_t<_Ty>; }; #endif // _HAS_CXX20 @@ -2124,37 +2208,40 @@ struct _Is_nothrow_swappable #if _HAS_CXX17 _EXPORT_STD template -struct is_swappable_with : _Is_swappable_with<_Ty1, _Ty2>::type { +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_swappable_with : _Is_swappable_with<_Ty1, _Ty2>::type { // Determine if expressions with type and value category _Ty1 and _Ty2 // can be swapped (and vice versa) }; _EXPORT_STD template -constexpr bool is_swappable_with_v = +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_swappable_with_v = conjunction_v<_Swappable_with_helper<_Ty1, _Ty2>, _Swappable_with_helper<_Ty2, _Ty1>>; _EXPORT_STD template -struct is_swappable : _Is_swappable<_Ty>::type {}; // Determine if _Ty lvalues satisfy is_swappable_with +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_swappable : _Is_swappable<_Ty>::type { + // Determine if _Ty lvalues satisfy is_swappable_with +}; _EXPORT_STD template -constexpr bool is_swappable_v = _Is_swappable<_Ty>::value; +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_swappable_v = _Is_swappable<_Ty>::value; _EXPORT_STD template -struct is_nothrow_swappable_with : _Is_nothrow_swappable_with<_Ty1, _Ty2>::type { +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_nothrow_swappable_with : _Is_nothrow_swappable_with<_Ty1, _Ty2>::type { // Determine if expressions with type and value category _Ty1 and _Ty2 // satisfy is_swappable_with, and can be swapped without emitting exceptions }; _EXPORT_STD template -constexpr bool is_nothrow_swappable_with_v = _Is_nothrow_swappable_with<_Ty1, _Ty2>::value; +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_nothrow_swappable_with_v = + _Is_nothrow_swappable_with<_Ty1, _Ty2>::value; _EXPORT_STD template -struct is_nothrow_swappable : _Is_nothrow_swappable<_Ty>::type { +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_nothrow_swappable : _Is_nothrow_swappable<_Ty>::type { // Determine if _Ty lvalues satisfy is_nothrow_swappable_with }; _EXPORT_STD template -constexpr bool is_nothrow_swappable_v = _Is_nothrow_swappable<_Ty>::value; +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_nothrow_swappable_v = _Is_nothrow_swappable<_Ty>::value; #endif // _HAS_CXX17 namespace _Has_ADL_swap_detail { @@ -2610,6 +2697,7 @@ _STL_RESTORE_DEPRECATED_WARNING _STD_END // TRANSITION, non-_Ugly attribute tokens +#pragma pop_macro("no_specializations") #pragma pop_macro("known_semantics") #pragma pop_macro("intrinsic") #pragma pop_macro("msvc") diff --git a/stl/inc/utility b/stl/inc/utility index dd4d327ea21..d1e0b4238bd 100644 --- a/stl/inc/utility +++ b/stl/inc/utility @@ -31,10 +31,12 @@ _STL_DISABLE_CLANG_WARNINGS #pragma push_macro("intrinsic") #pragma push_macro("known_semantics") #pragma push_macro("lifetimebound") +#pragma push_macro("no_specializations") #undef msvc #undef intrinsic #undef known_semantics #undef lifetimebound +#undef no_specializations _STD_BEGIN _EXPORT_STD template @@ -158,7 +160,7 @@ struct _Ignore { // struct that ignores assignments _EXPORT_STD _INLINE_VAR constexpr _Ignore ignore{}; _EXPORT_STD template -class tuple; +class _NO_SPECIALIZATIONS_CITING("N5014 [tuple.tuple.general]/1") tuple; _EXPORT_STD template struct pair; @@ -170,7 +172,7 @@ _EXPORT_STD template struct tuple_size; _EXPORT_STD template -constexpr size_t tuple_size_v = tuple_size<_Ty>::value; +_NO_SPECIALIZATIONS_OF_VARIABLE_TEMPLATES constexpr size_t tuple_size_v = tuple_size<_Ty>::value; _EXPORT_STD template struct tuple_element; @@ -1021,6 +1023,7 @@ namespace _DEPRECATE_TR1_NAMESPACE tr1 { _STD_END // TRANSITION, non-_Ugly attribute tokens +#pragma pop_macro("no_specializations") #pragma pop_macro("lifetimebound") #pragma pop_macro("known_semantics") #pragma pop_macro("intrinsic") diff --git a/stl/inc/variant b/stl/inc/variant index c17d88fe17e..6cddd331a9c 100644 --- a/stl/inc/variant +++ b/stl/inc/variant @@ -28,6 +28,12 @@ _STL_DISABLE_CLANG_WARNINGS #pragma push_macro("new") #undef new +// TRANSITION, non-_Ugly attribute tokens +#pragma push_macro("msvc") +#pragma push_macro("no_specializations") +#undef msvc +#undef no_specializations + _STD_BEGIN template @@ -283,7 +289,7 @@ struct _Meta_cartesian_product_<_List1<_List2<_Items...>, _Lists...>> { #define _STL_STAMP(n, x) x(_STL_STAMP##n, n) _EXPORT_STD template -class variant; +class _NO_SPECIALIZATIONS_CITING("N5014 [variant.variant.general]/4") variant; _EXPORT_STD template struct variant_size; // undefined @@ -294,7 +300,7 @@ struct _CXX20_DEPRECATE_VOLATILE variant_size : variant_size<_Ty>: template struct _CXX20_DEPRECATE_VOLATILE variant_size : variant_size<_Ty>::type {}; _EXPORT_STD template -constexpr size_t variant_size_v = variant_size<_Ty>::value; +_NO_SPECIALIZATIONS_OF_VARIABLE_TEMPLATES constexpr size_t variant_size_v = variant_size<_Ty>::value; template struct variant_size> : integral_constant {}; @@ -928,7 +934,8 @@ template constexpr bool _Is_in_place_index_specialization> = true; _EXPORT_STD template -class variant : private _SMF_control<_Variant_destroy_layer<_Types...>, _Types...> { // discriminated union +class _NO_SPECIALIZATIONS_CITING("N5014 [variant.variant.general]/4") variant + : private _SMF_control<_Variant_destroy_layer<_Types...>, _Types...> { // discriminated union public: static_assert(conjunction_v..., negation>..., is_destructible<_Types>...>, "variant requires all of the Types to meet the Cpp17Destructible requirements " @@ -1684,6 +1691,10 @@ _STD_END #undef _STL_STAMP16 #undef _STL_STAMP4 +// TRANSITION, non-_Ugly attribute tokens +#pragma pop_macro("no_specializations") +#pragma pop_macro("msvc") + #pragma pop_macro("new") _STL_RESTORE_CLANG_WARNINGS #pragma warning(pop) diff --git a/stl/inc/xmemory b/stl/inc/xmemory index f1e86a66e1e..f746e72dce8 100644 --- a/stl/inc/xmemory +++ b/stl/inc/xmemory @@ -27,7 +27,9 @@ _STL_DISABLE_CLANG_WARNINGS // TRANSITION, non-_Ugly attribute tokens #pragma push_macro("msvc") +#pragma push_macro("no_specializations") #undef msvc +#undef no_specializations #if _USE_STD_VECTOR_ALGORITHMS extern "C" { @@ -555,7 +557,7 @@ struct allocation_result { #endif // _HAS_CXX23 _EXPORT_STD template -struct allocator_traits; +struct _NO_SPECIALIZATIONS_CITING("N5014 [allocator.traits.general]/1") allocator_traits; _STL_DISABLE_DEPRECATED_WARNING template @@ -756,8 +758,9 @@ struct _Default_allocator_traits { // traits for std::allocator }; _EXPORT_STD template -struct allocator_traits : conditional_t<_Is_default_allocator<_Alloc>::value, _Default_allocator_traits<_Alloc>, - _Normal_allocator_traits<_Alloc>> {}; +struct _NO_SPECIALIZATIONS_CITING("N5014 [allocator.traits.general]/1") allocator_traits + : conditional_t<_Is_default_allocator<_Alloc>::value, _Default_allocator_traits<_Alloc>, + _Normal_allocator_traits<_Alloc>> {}; // _Choose_pocca_v returns whether an attempt to propagate allocators is necessary in copy assignment operations. // Note that even when false_type, callers should call _Pocca as we want to assign allocators even when equal. @@ -962,7 +965,7 @@ public: #if _HAS_DEPRECATED_ALLOCATOR_MEMBERS template - struct _CXX17_DEPRECATE_OLD_ALLOCATOR_MEMBERS rebind { + struct _CXX17_DEPRECATE_OLD_ALLOCATOR_MEMBERS _NO_SPECIALIZATIONS_OF_MEMBER_CLASS_TEMPLATES rebind { using other = allocator<_Other>; }; @@ -1035,7 +1038,7 @@ public: using const_pointer _CXX17_DEPRECATE_OLD_ALLOCATOR_MEMBERS = const void*; template - struct _CXX17_DEPRECATE_OLD_ALLOCATOR_MEMBERS rebind { + struct _CXX17_DEPRECATE_OLD_ALLOCATOR_MEMBERS _NO_SPECIALIZATIONS_OF_MEMBER_CLASS_TEMPLATES rebind { using other = allocator<_Other>; }; #endif // _HAS_DEPRECATED_ALLOCATOR_MEMBERS @@ -2812,6 +2815,7 @@ _STD_END #endif // ^^^ !_HAS_CXX20 ^^^ // TRANSITION, non-_Ugly attribute tokens +#pragma pop_macro("no_specializations") #pragma pop_macro("msvc") #pragma pop_macro("new") diff --git a/stl/inc/xtr1common b/stl/inc/xtr1common index b1829b8b323..18d30c10c89 100644 --- a/stl/inc/xtr1common +++ b/stl/inc/xtr1common @@ -18,12 +18,14 @@ _STL_DISABLE_CLANG_WARNINGS // TRANSITION, non-_Ugly attribute tokens #pragma push_macro("msvc") #pragma push_macro("known_semantics") +#pragma push_macro("no_specializations") #undef msvc #undef known_semantics +#undef no_specializations _STD_BEGIN _EXPORT_STD template -struct integral_constant { +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS integral_constant { static constexpr _Ty value = _Val; using value_type = _Ty; @@ -45,7 +47,7 @@ _EXPORT_STD using true_type = bool_constant; _EXPORT_STD using false_type = bool_constant; _EXPORT_STD template -struct enable_if {}; // no member "type" when !_Test +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS enable_if {}; // no member "type" when !_Test template struct enable_if { // type is _Ty for _Test @@ -56,7 +58,7 @@ _EXPORT_STD template using enable_if_t = typename enable_if<_Test, _Ty>::type; _EXPORT_STD template -struct conditional { // Choose _Ty1 if _Test is true, and _Ty2 otherwise +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS conditional { // Choose _Ty1 if _Test is true, and _Ty2 otherwise using type = _Ty1; }; @@ -70,22 +72,22 @@ using conditional_t = typename conditional<_Test, _Ty1, _Ty2>::type; #ifdef __clang__ _EXPORT_STD template -constexpr bool is_same_v = __is_same(_Ty1, _Ty2); +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_same_v = __is_same(_Ty1, _Ty2); _EXPORT_STD template -struct is_same : bool_constant<__is_same(_Ty1, _Ty2)> {}; +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_same : bool_constant<__is_same(_Ty1, _Ty2)> {}; #else // ^^^ Clang / not Clang vvv _EXPORT_STD template -constexpr bool is_same_v = false; // determine whether arguments are the same type +_NO_SPECIALIZATIONS_OF_TYPE_TRAITS constexpr bool is_same_v = false; // determine whether arguments are the same type template constexpr bool is_same_v<_Ty, _Ty> = true; _EXPORT_STD template -struct is_same : bool_constant> {}; +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS is_same : bool_constant> {}; #endif // ^^^ not Clang ^^^ _EXPORT_STD template -struct remove_const { // remove top-level const qualifier +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS remove_const { // remove top-level const qualifier using type = _Ty; }; @@ -98,7 +100,7 @@ _EXPORT_STD template using remove_const_t = typename remove_const<_Ty>::type; _EXPORT_STD template -struct remove_volatile { // remove top-level volatile qualifier +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS remove_volatile { // remove top-level volatile qualifier using type = _Ty; }; @@ -111,7 +113,7 @@ _EXPORT_STD template using remove_volatile_t = typename remove_volatile<_Ty>::type; _EXPORT_STD template -struct remove_cv { // remove top-level const and volatile qualifiers +struct _NO_SPECIALIZATIONS_OF_TYPE_TRAITS remove_cv { // remove top-level const and volatile qualifiers using type = _Ty; template