diff --git a/.gitattributes b/.gitattributes index 938b5267f7..e52cc8c23e 100644 --- a/.gitattributes +++ b/.gitattributes @@ -6,6 +6,7 @@ # Ensure GitHub detects our C++ code as C++ code. /stl/inc/** linguist-language=C++ +/stl/modules/** linguist-language=C++ /stl/src/** linguist-language=C++ *.h linguist-language=C++ diff --git a/stl/CMakeLists.txt b/stl/CMakeLists.txt index 59998db215..ce5a5d44ce 100644 --- a/stl/CMakeLists.txt +++ b/stl/CMakeLists.txt @@ -255,6 +255,16 @@ foreach(header ${HEADERS}) configure_file("${header}" "${PROJECT_BINARY_DIR}/out/inc/${_header_path}" COPYONLY) endforeach() +set(IXX_FILES + ${CMAKE_CURRENT_LIST_DIR}/modules/std.ixx + ${CMAKE_CURRENT_LIST_DIR}/modules/std.compat.ixx +) + +foreach(ixx_file ${IXX_FILES}) + file(RELATIVE_PATH _ixx_file_path "${CMAKE_CURRENT_LIST_DIR}/modules" "${ixx_file}") + configure_file("${ixx_file}" "${PROJECT_BINARY_DIR}/out/modules/${_ixx_file_path}" COPYONLY) +endforeach() + # Objs that implement aliases; these are completely independent of the configuration set(ALIAS_SOURCES_X86_X64 ${CMAKE_CURRENT_LIST_DIR}/src/alias_init_once_begin_initialize.asm diff --git a/stl/inc/__msvc_chrono.hpp b/stl/inc/__msvc_chrono.hpp index 1f787a25b5..e7051c28d4 100644 --- a/stl/inc/__msvc_chrono.hpp +++ b/stl/inc/__msvc_chrono.hpp @@ -28,13 +28,13 @@ _STL_DISABLE_CLANG_WARNINGS _STD_BEGIN namespace chrono { - template + _EXPORT_STD template struct treat_as_floating_point : is_floating_point<_Rep> {}; // tests for floating-point type - template + _EXPORT_STD template _INLINE_VAR constexpr bool treat_as_floating_point_v = treat_as_floating_point<_Rep>::value; - template + _EXPORT_STD template struct duration_values { // gets arithmetic properties of a type _NODISCARD static constexpr _Rep zero() noexcept { // get zero value @@ -62,23 +62,23 @@ namespace chrono { typename _Clock::time_point, decltype(_Clock::is_steady), decltype(_Clock::now())>> = true; // TRANSITION, GH-602 - template + _EXPORT_STD template struct is_clock : bool_constant<_Is_clock_v<_Clock>> {}; - template + _EXPORT_STD template inline constexpr bool is_clock_v = _Is_clock_v<_Clock>; #endif // _HAS_CXX20 - template > + _EXPORT_STD template > class duration; template _INLINE_VAR constexpr bool _Is_duration_v = _Is_specialization_v<_Ty, duration>; - template , int> = 0> + _EXPORT_STD template , int> = 0> constexpr _To duration_cast(const duration<_Rep, _Period>&) noexcept( is_arithmetic_v<_Rep>&& is_arithmetic_v); // strengthened - template + _EXPORT_STD template class duration { // represents a time duration public: using rep = _Rep; @@ -188,7 +188,7 @@ namespace chrono { _Rep _MyRep; // the stored rep }; - template + _EXPORT_STD template class time_point { // represents a point in time public: using clock = _Clock; @@ -277,7 +277,7 @@ struct common_type<_CHRONO time_point<_Clock, _Duration1>, }; namespace chrono { - template + _EXPORT_STD template _NODISCARD constexpr common_type_t, duration<_Rep2, _Period2>> operator+(const duration<_Rep1, _Period1>& _Left, const duration<_Rep2, _Period2>& _Right) noexcept( is_arithmetic_v<_Rep1>&& is_arithmetic_v<_Rep2>) /* strengthened */ { @@ -285,7 +285,7 @@ namespace chrono { return _CD(_CD(_Left).count() + _CD(_Right).count()); } - template + _EXPORT_STD template _NODISCARD constexpr common_type_t, duration<_Rep2, _Period2>> operator-(const duration<_Rep1, _Period1>& _Left, const duration<_Rep2, _Period2>& _Right) noexcept( is_arithmetic_v<_Rep1>&& is_arithmetic_v<_Rep2>) /* strengthened */ { @@ -293,7 +293,7 @@ namespace chrono { return _CD(_CD(_Left).count() - _CD(_Right).count()); } - template >, int> = 0> _NODISCARD constexpr duration, _Period1> operator*( const duration<_Rep1, _Period1>& _Left, @@ -303,7 +303,7 @@ namespace chrono { return _CD(_CD(_Left).count() * _Right); } - template >, int> = 0> _NODISCARD constexpr duration, _Period2> operator*(const _Rep1& _Left, const duration<_Rep2, _Period2>& _Right) noexcept( @@ -327,7 +327,7 @@ namespace chrono { // return type for duration / rep and duration % rep }; - template + _EXPORT_STD template _NODISCARD constexpr typename _Duration_div_mod, _Period1, _Rep2>::type operator/( const duration<_Rep1, _Period1>& _Left, const _Rep2& _Right) noexcept(is_arithmetic_v<_Rep1>&& is_arithmetic_v<_Rep2>) /* strengthened */ { @@ -336,7 +336,7 @@ namespace chrono { return _CD(_CD(_Left).count() / _Right); } - template + _EXPORT_STD template _NODISCARD constexpr common_type_t<_Rep1, _Rep2> operator/(const duration<_Rep1, _Period1>& _Left, const duration<_Rep2, _Period2>& _Right) noexcept( is_arithmetic_v<_Rep1>&& is_arithmetic_v<_Rep2>) /* strengthened */ { @@ -344,7 +344,7 @@ namespace chrono { return _CD(_Left).count() / _CD(_Right).count(); } - template + _EXPORT_STD template _NODISCARD constexpr typename _Duration_div_mod, _Period1, _Rep2>::type operator%( const duration<_Rep1, _Period1>& _Left, const _Rep2& _Right) noexcept(is_arithmetic_v<_Rep1>&& is_arithmetic_v<_Rep2>) /* strengthened */ { @@ -353,7 +353,7 @@ namespace chrono { return _CD(_CD(_Left).count() % _Right); } - template + _EXPORT_STD template _NODISCARD constexpr common_type_t, duration<_Rep2, _Period2>> operator%(const duration<_Rep1, _Period1>& _Left, const duration<_Rep2, _Period2>& _Right) noexcept( is_arithmetic_v<_Rep1>&& is_arithmetic_v<_Rep2>) /* strengthened */ { @@ -361,7 +361,7 @@ namespace chrono { return _CD(_CD(_Left).count() % _CD(_Right).count()); } - template + _EXPORT_STD template _NODISCARD constexpr bool operator==(const duration<_Rep1, _Period1>& _Left, const duration<_Rep2, _Period2>& _Right) noexcept( is_arithmetic_v<_Rep1>&& is_arithmetic_v<_Rep2>) /* strengthened */ { @@ -378,7 +378,7 @@ namespace chrono { } #endif // !_HAS_CXX20 - template + _EXPORT_STD template _NODISCARD constexpr bool operator<(const duration<_Rep1, _Period1>& _Left, const duration<_Rep2, _Period2>& _Right) noexcept( is_arithmetic_v<_Rep1>&& is_arithmetic_v<_Rep2>) /* strengthened */ { @@ -386,21 +386,21 @@ namespace chrono { return _CT(_Left).count() < _CT(_Right).count(); } - template + _EXPORT_STD template _NODISCARD constexpr bool operator<=(const duration<_Rep1, _Period1>& _Left, const duration<_Rep2, _Period2>& _Right) noexcept( is_arithmetic_v<_Rep1>&& is_arithmetic_v<_Rep2>) /* strengthened */ { return !(_Right < _Left); } - template + _EXPORT_STD template _NODISCARD constexpr bool operator>(const duration<_Rep1, _Period1>& _Left, const duration<_Rep2, _Period2>& _Right) noexcept( is_arithmetic_v<_Rep1>&& is_arithmetic_v<_Rep2>) /* strengthened */ { return _Right < _Left; } - template + _EXPORT_STD template _NODISCARD constexpr bool operator>=(const duration<_Rep1, _Period1>& _Left, const duration<_Rep2, _Period2>& _Right) noexcept( is_arithmetic_v<_Rep1>&& is_arithmetic_v<_Rep2>) /* strengthened */ { @@ -409,7 +409,7 @@ namespace chrono { #ifdef __cpp_lib_concepts // clang-format off - template + _EXPORT_STD template requires three_way_comparable, duration<_Rep2, _Period2>>::rep> _NODISCARD constexpr auto operator<=>(const duration<_Rep1, _Period1>& _Left, const duration<_Rep2, _Period2>& _Right) noexcept( @@ -420,7 +420,7 @@ namespace chrono { } #endif // defined(__cpp_lib_concepts) - template , int> _Enabled> + _EXPORT_STD template , int> _Enabled> _NODISCARD constexpr _To duration_cast(const duration<_Rep, _Period>& _Dur) noexcept( is_arithmetic_v<_Rep>&& is_arithmetic_v) /* strengthened */ { // convert duration to another duration; truncate @@ -450,7 +450,7 @@ namespace chrono { } } - template , int> = 0> + _EXPORT_STD template , int> = 0> _NODISCARD constexpr _To floor(const duration<_Rep, _Period>& _Dur) noexcept( is_arithmetic_v<_Rep>&& is_arithmetic_v) /* strengthened */ { // convert duration to another duration; round towards negative infinity @@ -463,7 +463,7 @@ namespace chrono { return _Casted; } - template , int> = 0> + _EXPORT_STD template , int> = 0> _NODISCARD constexpr _To ceil(const duration<_Rep, _Period>& _Dur) noexcept( is_arithmetic_v<_Rep>&& is_arithmetic_v) /* strengthened */ { // convert duration to another duration; round towards positive infinity @@ -482,7 +482,7 @@ namespace chrono { return _Val % 2 == 0; } - template && !treat_as_floating_point_v, int> = 0> _NODISCARD constexpr _To round(const duration<_Rep, _Period>& _Dur) noexcept( is_arithmetic_v<_Rep>&& is_arithmetic_v) /* strengthened */ { @@ -499,7 +499,7 @@ namespace chrono { return _Ceiled; } - template ::is_signed, int> = 0> + _EXPORT_STD template ::is_signed, int> = 0> _NODISCARD constexpr duration<_Rep, _Period> abs(const duration<_Rep, _Period> _Dur) noexcept( is_arithmetic_v<_Rep>) /* strengthened */ { // create a duration whose count() is the absolute value of _Dur.count() @@ -510,20 +510,20 @@ namespace chrono { } } - using nanoseconds = duration; - using microseconds = duration; - using milliseconds = duration; - using seconds = duration; - using minutes = duration>; - using hours = duration>; + _EXPORT_STD using nanoseconds = duration; + _EXPORT_STD using microseconds = duration; + _EXPORT_STD using milliseconds = duration; + _EXPORT_STD using seconds = duration; + _EXPORT_STD using minutes = duration>; + _EXPORT_STD using hours = duration>; #if _HAS_CXX20 - using days = duration, hours::period>>; - using weeks = duration, days::period>>; - using years = duration, days::period>>; - using months = duration>>; + _EXPORT_STD using days = duration, hours::period>>; + _EXPORT_STD using weeks = duration, days::period>>; + _EXPORT_STD using years = duration, days::period>>; + _EXPORT_STD using months = duration>>; #endif // _HAS_CXX20 - template + _EXPORT_STD template _NODISCARD constexpr time_point<_Clock, common_type_t<_Duration, duration<_Rep, _Period>>> operator+(const time_point<_Clock, _Duration>& _Left, const duration<_Rep, _Period>& _Right) noexcept( is_arithmetic_v&& is_arithmetic_v<_Rep>) /* strengthened */ { @@ -531,14 +531,14 @@ namespace chrono { return _RT(_Left.time_since_epoch() + _Right); } - template + _EXPORT_STD template _NODISCARD constexpr time_point<_Clock, common_type_t, _Duration>> operator+(const duration<_Rep, _Period>& _Left, const time_point<_Clock, _Duration>& _Right) noexcept( is_arithmetic_v<_Rep>&& is_arithmetic_v) /* strengthened */ { return _Right + _Left; } - template + _EXPORT_STD template _NODISCARD constexpr time_point<_Clock, common_type_t<_Duration, duration<_Rep, _Period>>> operator-(const time_point<_Clock, _Duration>& _Left, const duration<_Rep, _Period>& _Right) noexcept( is_arithmetic_v&& is_arithmetic_v<_Rep>) /* strengthened */ { @@ -546,14 +546,14 @@ namespace chrono { return _RT(_Left.time_since_epoch() - _Right); } - template + _EXPORT_STD template _NODISCARD constexpr common_type_t<_Duration1, _Duration2> operator-(const time_point<_Clock, _Duration1>& _Left, const time_point<_Clock, _Duration2>& _Right) noexcept( is_arithmetic_v&& is_arithmetic_v) /* strengthened */ { return _Left.time_since_epoch() - _Right.time_since_epoch(); } - template + _EXPORT_STD template _NODISCARD constexpr bool operator==(const time_point<_Clock, _Duration1>& _Left, const time_point<_Clock, _Duration2>& _Right) noexcept( is_arithmetic_v&& is_arithmetic_v) /* strengthened */ { @@ -569,28 +569,28 @@ namespace chrono { } #endif // !_HAS_CXX20 - template + _EXPORT_STD template _NODISCARD constexpr bool operator<(const time_point<_Clock, _Duration1>& _Left, const time_point<_Clock, _Duration2>& _Right) noexcept( is_arithmetic_v&& is_arithmetic_v) /* strengthened */ { return _Left.time_since_epoch() < _Right.time_since_epoch(); } - template + _EXPORT_STD template _NODISCARD constexpr bool operator<=(const time_point<_Clock, _Duration1>& _Left, const time_point<_Clock, _Duration2>& _Right) noexcept( is_arithmetic_v&& is_arithmetic_v) /* strengthened */ { return !(_Right < _Left); } - template + _EXPORT_STD template _NODISCARD constexpr bool operator>(const time_point<_Clock, _Duration1>& _Left, const time_point<_Clock, _Duration2>& _Right) noexcept( is_arithmetic_v&& is_arithmetic_v) /* strengthened */ { return _Right < _Left; } - template + _EXPORT_STD template _NODISCARD constexpr bool operator>=(const time_point<_Clock, _Duration1>& _Left, const time_point<_Clock, _Duration2>& _Right) noexcept( is_arithmetic_v&& is_arithmetic_v) /* strengthened */ { @@ -598,7 +598,7 @@ namespace chrono { } #ifdef __cpp_lib_concepts - template _Duration2> + _EXPORT_STD template _Duration2> _NODISCARD constexpr auto operator<=>(const time_point<_Clock, _Duration1>& _Left, const time_point<_Clock, _Duration2>& _Right) noexcept( is_arithmetic_v&& is_arithmetic_v) /* strengthened */ { @@ -606,28 +606,28 @@ namespace chrono { } #endif // defined(__cpp_lib_concepts) - template , int> = 0> + _EXPORT_STD template , int> = 0> _NODISCARD constexpr time_point<_Clock, _To> time_point_cast(const time_point<_Clock, _Duration>& _Time) noexcept( is_arithmetic_v&& is_arithmetic_v) /* strengthened */ { // change the duration type of a time_point; truncate return time_point<_Clock, _To>(_CHRONO duration_cast<_To>(_Time.time_since_epoch())); } - template , int> = 0> + _EXPORT_STD template , int> = 0> _NODISCARD constexpr time_point<_Clock, _To> floor(const time_point<_Clock, _Duration>& _Time) noexcept( is_arithmetic_v&& is_arithmetic_v) /* strengthened */ { // change the duration type of a time_point; round towards negative infinity return time_point<_Clock, _To>(_CHRONO floor<_To>(_Time.time_since_epoch())); } - template , int> = 0> + _EXPORT_STD template , int> = 0> _NODISCARD constexpr time_point<_Clock, _To> ceil(const time_point<_Clock, _Duration>& _Time) noexcept( is_arithmetic_v&& is_arithmetic_v) /* strengthened */ { // change the duration type of a time_point; round towards positive infinity return time_point<_Clock, _To>(_CHRONO ceil<_To>(_Time.time_since_epoch())); } - template && !treat_as_floating_point_v, int> = 0> _NODISCARD constexpr time_point<_Clock, _To> round(const time_point<_Clock, _Duration>& _Time) noexcept( is_arithmetic_v&& is_arithmetic_v) /* strengthened */ { @@ -635,7 +635,7 @@ namespace chrono { return time_point<_Clock, _To>(_CHRONO round<_To>(_Time.time_since_epoch())); } - struct system_clock { // wraps GetSystemTimePreciseAsFileTime/GetSystemTimeAsFileTime + _EXPORT_STD struct system_clock { // wraps GetSystemTimePreciseAsFileTime/GetSystemTimeAsFileTime using rep = long long; using period = ratio<1, 10'000'000>; // 100 nanoseconds using duration = _CHRONO duration; @@ -656,13 +656,13 @@ namespace chrono { }; #if _HAS_CXX20 - template - using sys_time = time_point; - using sys_seconds = sys_time; - using sys_days = sys_time; + _EXPORT_STD template + using sys_time = time_point; + _EXPORT_STD using sys_seconds = sys_time; + _EXPORT_STD using sys_days = sys_time; #endif // _HAS_CXX20 - struct steady_clock { // wraps QueryPerformanceCounter + _EXPORT_STD struct steady_clock { // wraps QueryPerformanceCounter using rep = long long; using period = nano; using duration = nanoseconds; @@ -694,7 +694,7 @@ namespace chrono { } }; - using high_resolution_clock = steady_clock; + _EXPORT_STD using high_resolution_clock = steady_clock; } // namespace chrono template @@ -723,55 +723,62 @@ _NODISCARD bool _To_xtime_10_day_clamped(_CSTD xtime& _Xt, const _CHRONO duratio inline namespace literals { inline namespace chrono_literals { - _NODISCARD constexpr _CHRONO hours operator"" h(unsigned long long _Val) noexcept /* strengthened */ { + _EXPORT_STD _NODISCARD constexpr _CHRONO hours operator"" h(unsigned long long _Val) noexcept + /* strengthened */ { return _CHRONO hours(_Val); } - _NODISCARD constexpr _CHRONO duration> operator"" h(long double _Val) noexcept + _EXPORT_STD _NODISCARD constexpr _CHRONO duration> operator"" h(long double _Val) noexcept /* strengthened */ { return _CHRONO duration>(_Val); } - _NODISCARD constexpr _CHRONO minutes(operator"" min)(unsigned long long _Val) noexcept /* strengthened */ { + _EXPORT_STD _NODISCARD constexpr _CHRONO minutes(operator"" min)(unsigned long long _Val) noexcept + /* strengthened */ { return _CHRONO minutes(_Val); } - _NODISCARD constexpr _CHRONO duration>(operator"" min)(long double _Val) noexcept + _EXPORT_STD _NODISCARD constexpr _CHRONO duration>(operator"" min)(long double _Val) noexcept /* strengthened */ { return _CHRONO duration>(_Val); } - _NODISCARD constexpr _CHRONO seconds operator"" s(unsigned long long _Val) noexcept /* strengthened */ { + _EXPORT_STD _NODISCARD constexpr _CHRONO seconds operator"" s(unsigned long long _Val) noexcept + /* strengthened */ { return _CHRONO seconds(_Val); } - _NODISCARD constexpr _CHRONO duration operator"" s(long double _Val) noexcept /* strengthened */ { + _EXPORT_STD _NODISCARD constexpr _CHRONO duration operator"" s(long double _Val) noexcept + /* strengthened */ { return _CHRONO duration(_Val); } - _NODISCARD constexpr _CHRONO milliseconds operator"" ms(unsigned long long _Val) noexcept /* strengthened */ { + _EXPORT_STD _NODISCARD constexpr _CHRONO milliseconds operator"" ms(unsigned long long _Val) noexcept + /* strengthened */ { return _CHRONO milliseconds(_Val); } - _NODISCARD constexpr _CHRONO duration operator"" ms(long double _Val) noexcept + _EXPORT_STD _NODISCARD constexpr _CHRONO duration operator"" ms(long double _Val) noexcept /* strengthened */ { return _CHRONO duration(_Val); } - _NODISCARD constexpr _CHRONO microseconds operator"" us(unsigned long long _Val) noexcept /* strengthened */ { + _EXPORT_STD _NODISCARD constexpr _CHRONO microseconds operator"" us(unsigned long long _Val) noexcept + /* strengthened */ { return _CHRONO microseconds(_Val); } - _NODISCARD constexpr _CHRONO duration operator"" us(long double _Val) noexcept + _EXPORT_STD _NODISCARD constexpr _CHRONO duration operator"" us(long double _Val) noexcept /* strengthened */ { return _CHRONO duration(_Val); } - _NODISCARD constexpr _CHRONO nanoseconds operator"" ns(unsigned long long _Val) noexcept /* strengthened */ { + _EXPORT_STD _NODISCARD constexpr _CHRONO nanoseconds operator"" ns(unsigned long long _Val) noexcept + /* strengthened */ { return _CHRONO nanoseconds(_Val); } - _NODISCARD constexpr _CHRONO duration operator"" ns(long double _Val) noexcept + _EXPORT_STD _NODISCARD constexpr _CHRONO duration operator"" ns(long double _Val) noexcept /* strengthened */ { return _CHRONO duration(_Val); } @@ -779,7 +786,7 @@ inline namespace literals { } // namespace literals namespace chrono { - using namespace literals::chrono_literals; + _EXPORT_STD using namespace literals::chrono_literals; } // namespace chrono _STD_END diff --git a/stl/inc/__msvc_iter_core.hpp b/stl/inc/__msvc_iter_core.hpp index f552728d36..502c024eb8 100644 --- a/stl/inc/__msvc_iter_core.hpp +++ b/stl/inc/__msvc_iter_core.hpp @@ -19,18 +19,18 @@ _STL_DISABLE_CLANG_WARNINGS _STD_BEGIN // from -struct input_iterator_tag {}; +_EXPORT_STD struct input_iterator_tag {}; -struct output_iterator_tag {}; +_EXPORT_STD struct output_iterator_tag {}; -struct forward_iterator_tag : input_iterator_tag {}; +_EXPORT_STD struct forward_iterator_tag : input_iterator_tag {}; -struct bidirectional_iterator_tag : forward_iterator_tag {}; +_EXPORT_STD struct bidirectional_iterator_tag : forward_iterator_tag {}; -struct random_access_iterator_tag : bidirectional_iterator_tag {}; +_EXPORT_STD struct random_access_iterator_tag : bidirectional_iterator_tag {}; #ifdef __cpp_lib_concepts -struct contiguous_iterator_tag : random_access_iterator_tag {}; +_EXPORT_STD struct contiguous_iterator_tag : random_access_iterator_tag {}; template concept _Dereferenceable = requires(_Ty& __t) { @@ -72,7 +72,7 @@ concept _Has_member_reference = requires { typename _Ty::reference; }; -template +_EXPORT_STD template struct incrementable_traits {}; template @@ -105,10 +105,10 @@ struct incrementable_traits<_Ty> { template concept _Is_from_primary = _Same_impl; -template +_EXPORT_STD template struct iterator_traits; -template +_EXPORT_STD template using iter_difference_t = typename conditional_t<_Is_from_primary>>, incrementable_traits>, iterator_traits>>::difference_type; @@ -121,7 +121,7 @@ struct _Cond_value_type<_Ty> { using value_type = remove_cv_t<_Ty>; }; -template +_EXPORT_STD template struct indirectly_readable_traits {}; template @@ -153,11 +153,11 @@ template <_Has_member_value_type _Ty> struct indirectly_readable_traits<_Ty> : _Cond_value_type {}; // clang-format on -template +_EXPORT_STD template using iter_value_t = typename conditional_t<_Is_from_primary>>, indirectly_readable_traits>, iterator_traits>>::value_type; -template <_Dereferenceable _Ty> +_EXPORT_STD template <_Dereferenceable _Ty> using iter_reference_t = decltype(*_STD declval<_Ty&>()); template @@ -365,7 +365,7 @@ struct _Iterator_traits_base<_It> { }; // clang-format on -template +_EXPORT_STD template struct iterator_traits : _Iterator_traits_base<_Ty> { using _From_primary = iterator_traits; }; @@ -394,7 +394,7 @@ template concept _Signed_integer_like = _Integer_like<_Ty> && static_cast<_Ty>(-1) < static_cast<_Ty>(0); // clang-format off -template +_EXPORT_STD template concept weakly_incrementable = movable<_Ty> && requires(_Ty __i) { typename iter_difference_t<_Ty>; @@ -407,21 +407,21 @@ concept weakly_incrementable = movable<_Ty> #endif // TRANSITION, LLVM-48173 ; -template +_EXPORT_STD template concept input_or_output_iterator = requires(_It __i) { { *__i } -> _Can_reference; } && weakly_incrementable<_It>; -template +_EXPORT_STD template concept sentinel_for = semiregular<_Se> && input_or_output_iterator<_It> && _Weakly_equality_comparable_with<_Se, _It>; // clang-format on -template +_EXPORT_STD template inline constexpr bool disable_sized_sentinel_for = false; // clang-format off -template +_EXPORT_STD template concept sized_sentinel_for = sentinel_for<_Se, _It> && !disable_sized_sentinel_for, remove_cv_t<_It>> && requires(const _It& __i, const _Se& __s) { @@ -432,24 +432,24 @@ concept sized_sentinel_for = sentinel_for<_Se, _It> namespace ranges { // clang-format off - enum class subrange_kind : bool { unsized, sized }; + _EXPORT_STD enum class subrange_kind : bool { unsized, sized }; - template _Se = _It, + _EXPORT_STD template _Se = _It, subrange_kind _Ki = sized_sentinel_for<_Se, _It> ? subrange_kind::sized : subrange_kind::unsized> requires (_Ki == subrange_kind::sized || !sized_sentinel_for<_Se, _It>) class subrange; - template + _EXPORT_STD template requires ((_Idx == 0 && copyable<_It>) || _Idx == 1) _NODISCARD constexpr auto get(const subrange<_It, _Se, _Ki>& _Val); - template + _EXPORT_STD template requires (_Idx < 2) _NODISCARD constexpr auto get(subrange<_It, _Se, _Ki>&& _Val); // clang-format on } // namespace ranges -using ranges::get; +_EXPORT_STD using ranges::get; template struct tuple_size> : integral_constant {}; diff --git a/stl/inc/__msvc_tzdb.hpp b/stl/inc/__msvc_tzdb.hpp index d252f8a6d5..3948efa3e7 100644 --- a/stl/inc/__msvc_tzdb.hpp +++ b/stl/inc/__msvc_tzdb.hpp @@ -20,6 +20,8 @@ _STL_DISABLE_CLANG_WARNINGS #pragma push_macro("new") #undef new +_EXTERN_C + using __std_tzdb_epoch_milli = double; struct __std_tzdb_leap_info { @@ -64,8 +66,6 @@ struct __std_tzdb_sys_info { const char* _Abbrev; }; -_EXTERN_C - _NODISCARD __std_tzdb_time_zones_info* __stdcall __std_tzdb_get_time_zones() noexcept; void __stdcall __std_tzdb_delete_time_zones(__std_tzdb_time_zones_info* _Info) noexcept; diff --git a/stl/inc/algorithm b/stl/inc/algorithm index 7805a59839..1eb4f33e12 100644 --- a/stl/inc/algorithm +++ b/stl/inc/algorithm @@ -171,7 +171,7 @@ struct _Optimistic_temporary_buffer { // temporary storage with _alloca-like att #ifdef __cpp_lib_concepts namespace ranges { - template + _EXPORT_STD template struct in_fun_result { /* [[no_unique_address]] */ _In in; /* [[no_unique_address]] */ _Fun fun; @@ -187,7 +187,7 @@ namespace ranges { } }; - template + _EXPORT_STD template struct in_in_out_result { /* [[no_unique_address]] */ _In1 in1; /* [[no_unique_address]] */ _In2 in2; @@ -205,7 +205,7 @@ namespace ranges { } }; - template + _EXPORT_STD template struct in_out_out_result { /* [[no_unique_address]] */ _In in; /* [[no_unique_address]] */ _Out1 out1; @@ -223,7 +223,7 @@ namespace ranges { } }; - template + _EXPORT_STD template struct min_max_result { /* [[no_unique_address]] */ _Ty min; /* [[no_unique_address]] */ _Ty max; @@ -239,7 +239,7 @@ namespace ranges { } }; - template + _EXPORT_STD template struct in_found_result { /* [[no_unique_address]] */ _In in; bool found; @@ -257,7 +257,7 @@ namespace ranges { } // namespace ranges #endif // __cpp_lib_concepts -template +_EXPORT_STD template _CONSTEXPR20 _Fn for_each(_InIt _First, _InIt _Last, _Fn _Func) { // perform function for each element [_First, _Last) _Adl_verify_range(_First, _Last); auto _UFirst = _Get_unwrapped(_First); @@ -270,10 +270,10 @@ _CONSTEXPR20 _Fn for_each(_InIt _First, _InIt _Last, _Fn _Func) { // perform fun } #if _HAS_CXX17 -template = 0> +_EXPORT_STD template = 0> void for_each(_ExPo&& _Exec, _FwdIt _First, _FwdIt _Last, _Fn _Func) noexcept; // terminates -template +_EXPORT_STD template _CONSTEXPR20 _InIt for_each_n(_InIt _First, const _Diff _Count_raw, _Fn _Func) { // perform function for each element [_First, _First + _Count) _Algorithm_int_t<_Diff> _Count = _Count_raw; @@ -291,13 +291,13 @@ _CONSTEXPR20 _InIt for_each_n(_InIt _First, const _Diff _Count_raw, _Fn _Func) { return _First; } -template = 0> +_EXPORT_STD template = 0> _FwdIt for_each_n(_ExPo&& _Exec, _FwdIt _First, _Diff _Count_raw, _Fn _Func) noexcept; // terminates #endif // _HAS_CXX17 #ifdef __cpp_lib_concepts namespace ranges { - template + _EXPORT_STD template using for_each_result = in_fun_result<_In, _Fun>; class _For_each_fn : private _Not_quite_object { @@ -345,9 +345,9 @@ namespace ranges { } }; - inline constexpr _For_each_fn for_each{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _For_each_fn for_each{_Not_quite_object::_Construct_tag{}}; - template + _EXPORT_STD template using for_each_n_result = in_fun_result<_In, _Fun>; class _For_each_n_fn : private _Not_quite_object { @@ -372,16 +372,16 @@ namespace ranges { } }; - inline constexpr _For_each_n_fn for_each_n{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _For_each_n_fn for_each_n{_Not_quite_object::_Construct_tag{}}; } // namespace ranges #endif // __cpp_lib_concepts #if _HAS_CXX17 -template = 0> +_EXPORT_STD template = 0> _NODISCARD _FwdIt find_if(_ExPo&& _Exec, _FwdIt _First, const _FwdIt _Last, _Pr _Pred) noexcept; // terminates #endif // _HAS_CXX17 -template +_EXPORT_STD template _NODISCARD _CONSTEXPR20 _InIt find_if_not(_InIt _First, const _InIt _Last, _Pr _Pred) { // find first element that satisfies !_Pred _Adl_verify_range(_First, _Last); @@ -398,11 +398,11 @@ _NODISCARD _CONSTEXPR20 _InIt find_if_not(_InIt _First, const _InIt _Last, _Pr _ } #if _HAS_CXX17 -template = 0> +_EXPORT_STD template = 0> _NODISCARD _FwdIt find_if_not(_ExPo&& _Exec, _FwdIt _First, _FwdIt _Last, _Pr _Pred) noexcept; // terminates #endif // _HAS_CXX17 -template +_EXPORT_STD template _NODISCARD _CONSTEXPR20 _FwdIt adjacent_find(const _FwdIt _First, _FwdIt _Last, _Pr _Pred) { // find first satisfying _Pred with successor _Adl_verify_range(_First, _Last); @@ -421,16 +421,16 @@ _NODISCARD _CONSTEXPR20 _FwdIt adjacent_find(const _FwdIt _First, _FwdIt _Last, return _Last; } -template +_EXPORT_STD template _NODISCARD _CONSTEXPR20 _FwdIt adjacent_find(const _FwdIt _First, const _FwdIt _Last) { // find first matching successor return _STD adjacent_find(_First, _Last, equal_to<>{}); } #if _HAS_CXX17 -template = 0> +_EXPORT_STD template = 0> _NODISCARD _FwdIt adjacent_find(_ExPo&& _Exec, _FwdIt _First, _FwdIt _Last, _Pr _Pred) noexcept; // terminates -template = 0> +_EXPORT_STD template = 0> _NODISCARD _FwdIt adjacent_find(_ExPo&& _Exec, const _FwdIt _First, const _FwdIt _Last) noexcept /* terminates */ { // find first matching successor return _STD adjacent_find(_STD forward<_ExPo>(_Exec), _First, _Last, equal_to{}); @@ -494,11 +494,11 @@ namespace ranges { } }; - inline constexpr _Count_fn count{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Count_fn count{_Not_quite_object::_Construct_tag{}}; } // namespace ranges #endif // __cpp_lib_concepts -template +_EXPORT_STD template _NODISCARD _CONSTEXPR20 _Iter_diff_t<_InIt> count_if(_InIt _First, _InIt _Last, _Pr _Pred) { // count elements satisfying _Pred _Adl_verify_range(_First, _Last); @@ -515,7 +515,7 @@ _NODISCARD _CONSTEXPR20 _Iter_diff_t<_InIt> count_if(_InIt _First, _InIt _Last, } #if _HAS_CXX17 -template = 0> +_EXPORT_STD template = 0> _NODISCARD _Iter_diff_t<_FwdIt> count_if( _ExPo&& _Exec, const _FwdIt _First, const _FwdIt _Last, _Pr _Pred) noexcept; // terminates #endif // _HAS_CXX17 @@ -559,11 +559,11 @@ namespace ranges { } }; - inline constexpr _Count_if_fn count_if{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Count_if_fn count_if{_Not_quite_object::_Construct_tag{}}; } // namespace ranges #endif // __cpp_lib_concepts -template +_EXPORT_STD template _NODISCARD _CONSTEXPR20 pair<_InIt1, _InIt2> mismatch(_InIt1 _First1, const _InIt1 _Last1, _InIt2 _First2, _Pr _Pred) { // return [_First1, _Last1)/[_First2, ...) mismatch _Adl_verify_range(_First1, _Last1); @@ -581,19 +581,19 @@ _NODISCARD _CONSTEXPR20 pair<_InIt1, _InIt2> mismatch(_InIt1 _First1, const _InI } #if _HAS_CXX17 -template = 0> +_EXPORT_STD template = 0> _NODISCARD pair<_FwdIt1, _FwdIt2> mismatch( _ExPo&& _Exec, _FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _First2, _Pr _Pred) noexcept; // terminates #endif // _HAS_CXX17 -template +_EXPORT_STD template _NODISCARD _CONSTEXPR20 pair<_InIt1, _InIt2> mismatch(const _InIt1 _First1, const _InIt1 _Last1, const _InIt2 _First2) { // return [_First1, _Last1)/[_First2, ...) mismatch return _STD mismatch(_First1, _Last1, _First2, equal_to<>{}); } #if _HAS_CXX17 -template = 0> +_EXPORT_STD template = 0> _NODISCARD pair<_FwdIt1, _FwdIt2> mismatch( _ExPo&& _Exec, const _FwdIt1 _First1, const _FwdIt1 _Last1, const _FwdIt2 _First2) noexcept /* terminates */ { // return [_First1, _Last1)/[_First2, ...) mismatch @@ -603,7 +603,7 @@ _NODISCARD pair<_FwdIt1, _FwdIt2> mismatch( } #endif // _HAS_CXX17 -template +_EXPORT_STD template _NODISCARD _CONSTEXPR20 pair<_InIt1, _InIt2> mismatch( _InIt1 _First1, _InIt1 _Last1, _InIt2 _First2, _InIt2 _Last2, _Pr _Pred) { // return [_First1, _Last1)/[_First2, _Last2) mismatch @@ -636,19 +636,19 @@ _NODISCARD _CONSTEXPR20 pair<_InIt1, _InIt2> mismatch( } #if _HAS_CXX17 -template = 0> +_EXPORT_STD template = 0> _NODISCARD pair<_FwdIt1, _FwdIt2> mismatch( _ExPo&& _Exec, _FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _First2, _FwdIt2 _Last2, _Pr _Pred) noexcept; // terminates #endif // _HAS_CXX17 -template +_EXPORT_STD template _NODISCARD _CONSTEXPR20 pair<_InIt1, _InIt2> mismatch(_InIt1 _First1, _InIt1 _Last1, _InIt2 _First2, _InIt2 _Last2) { // return [_First1, _Last1)/[_First2, _Last2) mismatch return _STD mismatch(_First1, _Last1, _First2, _Last2, equal_to<>{}); } #if _HAS_CXX17 -template = 0> +_EXPORT_STD template = 0> _NODISCARD pair<_FwdIt1, _FwdIt2> mismatch( _ExPo&& _Exec, _FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _First2, _FwdIt2 _Last2) noexcept /* terminates */ { // return [_First1, _Last1)/[_First2, _Last2) mismatch @@ -759,11 +759,11 @@ namespace ranges { // clang-format on }; - inline constexpr _Equal_fn equal{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Equal_fn equal{_Not_quite_object::_Construct_tag{}}; } // namespace ranges #endif // __cpp_lib_concepts -template +_EXPORT_STD template _NODISCARD _CONSTEXPR20 bool is_permutation(_FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _First2, _Pr _Pred) { // test if [_First1, _Last1) == permuted [_First2, ...) _Adl_verify_range(_First1, _Last1); @@ -787,13 +787,13 @@ _NODISCARD _CONSTEXPR20 bool is_permutation(_FwdIt1 _First1, _FwdIt1 _Last1, _Fw return _Check_match_counts(_UFirst1, _ULast1, _UFirst2, _STD next(_UFirst2, _Dist2), _Pass_fn(_Pred)); } -template +_EXPORT_STD template _NODISCARD _CONSTEXPR20 bool is_permutation(_FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _First2) { // test if [_First1, _Last1) == permuted [_First2, ...) return _STD is_permutation(_First1, _Last1, _First2, equal_to<>{}); } -template +_EXPORT_STD template _NODISCARD _CONSTEXPR20 bool is_permutation( _FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _First2, _FwdIt2 _Last2, _Pr _Pred) { // test if [_First1, _Last1) == permuted [_First2, _Last2) @@ -851,7 +851,7 @@ _NODISCARD _CONSTEXPR20 bool is_permutation( } } -template +_EXPORT_STD template _NODISCARD _CONSTEXPR20 bool is_permutation(_FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _First2, _FwdIt2 _Last2) { // test if [_First1, _Last1) == permuted [_First2, _Last2) return _STD is_permutation(_First1, _Last1, _First2, _Last2, equal_to<>{}); @@ -1127,11 +1127,11 @@ namespace ranges { } }; - inline constexpr _Is_permutation_fn is_permutation{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Is_permutation_fn is_permutation{_Not_quite_object::_Construct_tag{}}; } // namespace ranges #endif // __cpp_lib_concepts -template +_EXPORT_STD template _NODISCARD _CONSTEXPR20 bool all_of(_InIt _First, _InIt _Last, _Pr _Pred) { // test if all elements satisfy _Pred _Adl_verify_range(_First, _Last); auto _UFirst = _Get_unwrapped(_First); @@ -1146,7 +1146,7 @@ _NODISCARD _CONSTEXPR20 bool all_of(_InIt _First, _InIt _Last, _Pr _Pred) { // t } #if _HAS_CXX17 -template = 0> +_EXPORT_STD template = 0> _NODISCARD bool all_of(_ExPo&&, _FwdIt _First, _FwdIt _Last, _Pr _Pred) noexcept; // terminates #endif // _HAS_CXX17 @@ -1188,11 +1188,11 @@ namespace ranges { } }; - inline constexpr _All_of_fn all_of{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _All_of_fn all_of{_Not_quite_object::_Construct_tag{}}; } // namespace ranges #endif // __cpp_lib_concepts -template +_EXPORT_STD template _NODISCARD _CONSTEXPR20 bool any_of(const _InIt _First, const _InIt _Last, _Pr _Pred) { // test if any element satisfies _Pred _Adl_verify_range(_First, _Last); @@ -1208,7 +1208,7 @@ _NODISCARD _CONSTEXPR20 bool any_of(const _InIt _First, const _InIt _Last, _Pr _ } #if _HAS_CXX17 -template = 0> +_EXPORT_STD template = 0> _NODISCARD bool any_of(_ExPo&&, const _FwdIt _First, const _FwdIt _Last, _Pr _Pred) noexcept; // terminates #endif // _HAS_CXX17 @@ -1250,11 +1250,11 @@ namespace ranges { } }; - inline constexpr _Any_of_fn any_of{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Any_of_fn any_of{_Not_quite_object::_Construct_tag{}}; } // namespace ranges #endif // __cpp_lib_concepts -template +_EXPORT_STD template _NODISCARD _CONSTEXPR20 bool none_of(const _InIt _First, const _InIt _Last, _Pr _Pred) { // test if no elements satisfy _Pred _Adl_verify_range(_First, _Last); @@ -1270,7 +1270,7 @@ _NODISCARD _CONSTEXPR20 bool none_of(const _InIt _First, const _InIt _Last, _Pr } #if _HAS_CXX17 -template = 0> +_EXPORT_STD template = 0> _NODISCARD bool none_of(_ExPo&&, const _FwdIt _First, const _FwdIt _Last, _Pr _Pred) noexcept; // terminates #endif // _HAS_CXX17 @@ -1312,7 +1312,7 @@ namespace ranges { } }; - inline constexpr _None_of_fn none_of{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _None_of_fn none_of{_Not_quite_object::_Construct_tag{}}; #if _HAS_CXX23 class _Contains_fn : private _Not_quite_object { @@ -1341,7 +1341,7 @@ namespace ranges { } }; - inline constexpr _Contains_fn contains{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Contains_fn contains{_Not_quite_object::_Construct_tag{}}; class _Contains_subrange_fn : private _Not_quite_object { public: @@ -1383,10 +1383,10 @@ namespace ranges { } }; - inline constexpr _Contains_subrange_fn contains_subrange{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Contains_subrange_fn contains_subrange{_Not_quite_object::_Construct_tag{}}; #endif // _HAS_CXX23 - template + _EXPORT_STD template using copy_n_result = in_out_result<_In, _Out>; class _Copy_n_fn : private _Not_quite_object { @@ -1415,9 +1415,9 @@ namespace ranges { } }; - inline constexpr _Copy_n_fn copy_n{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Copy_n_fn copy_n{_Not_quite_object::_Construct_tag{}}; - template + _EXPORT_STD template using copy_backward_result = in_out_result<_In, _Out>; class _Copy_backward_fn : private _Not_quite_object { @@ -1444,11 +1444,11 @@ namespace ranges { } }; - inline constexpr _Copy_backward_fn copy_backward{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Copy_backward_fn copy_backward{_Not_quite_object::_Construct_tag{}}; } // namespace ranges #endif // __cpp_lib_concepts -template +_EXPORT_STD template _CONSTEXPR20 _OutIt copy_if(_InIt _First, _InIt _Last, _OutIt _Dest, _Pr _Pred) { // copy each satisfying _Pred _Adl_verify_range(_First, _Last); auto _UFirst = _Get_unwrapped(_First); @@ -1466,7 +1466,7 @@ _CONSTEXPR20 _OutIt copy_if(_InIt _First, _InIt _Last, _OutIt _Dest, _Pr _Pred) } #if _HAS_CXX17 -template = 0> +_EXPORT_STD template = 0> _FwdIt2 copy_if(_ExPo&&, _FwdIt1 _First, _FwdIt1 _Last, _FwdIt2 _Dest, _Pr _Pred) noexcept /* terminates */ { // copy each satisfying _Pred // not parallelized at present, parallelism expected to be feasible in a future release @@ -1478,7 +1478,7 @@ _FwdIt2 copy_if(_ExPo&&, _FwdIt1 _First, _FwdIt1 _Last, _FwdIt2 _Dest, _Pr _Pred #ifdef __cpp_lib_concepts namespace ranges { - template + _EXPORT_STD template using copy_if_result = in_out_result<_In, _Out>; class _Copy_if_fn : private _Not_quite_object { @@ -1529,9 +1529,9 @@ namespace ranges { } }; - inline constexpr _Copy_if_fn copy_if{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Copy_if_fn copy_if{_Not_quite_object::_Construct_tag{}}; - template + _EXPORT_STD template using move_result = in_out_result<_In, _Out>; template _Se, weakly_incrementable _Out> @@ -1579,9 +1579,9 @@ namespace ranges { } }; - inline constexpr _Move_fn move{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Move_fn move{_Not_quite_object::_Construct_tag{}}; - template + _EXPORT_STD template using move_backward_result = in_out_result<_In, _Out>; // concept-constrained for strict enforcement as it is used by several algorithms @@ -1625,11 +1625,11 @@ namespace ranges { } }; - inline constexpr _Move_backward_fn move_backward{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Move_backward_fn move_backward{_Not_quite_object::_Construct_tag{}}; } // namespace ranges #endif // __cpp_lib_concepts -template +_EXPORT_STD template _CONSTEXPR20 pair<_OutIt1, _OutIt2> partition_copy( _InIt _First, _InIt _Last, _OutIt1 _Dest_true, _OutIt2 _Dest_false, _Pr _Pred) { // copy true partition to _Dest_true, false to _Dest_false @@ -1654,7 +1654,8 @@ _CONSTEXPR20 pair<_OutIt1, _OutIt2> partition_copy( } #if _HAS_CXX17 -template = 0> +_EXPORT_STD template = 0> pair<_FwdIt2, _FwdIt3> partition_copy(_ExPo&&, _FwdIt1 _First, _FwdIt1 _Last, _FwdIt2 _Dest_true, _FwdIt3 _Dest_false, _Pr _Pred) noexcept /* terminates */ { // copy true partition to _Dest_true, false to _Dest_false @@ -1667,7 +1668,7 @@ pair<_FwdIt2, _FwdIt3> partition_copy(_ExPo&&, _FwdIt1 _First, _FwdIt1 _Last, _F #ifdef __cpp_lib_concepts namespace ranges { - template + _EXPORT_STD template using partition_copy_result = in_out_out_result<_In, _Out1, _Out2>; class _Partition_copy_fn : private _Not_quite_object { @@ -1729,12 +1730,12 @@ namespace ranges { } }; - inline constexpr _Partition_copy_fn partition_copy{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Partition_copy_fn partition_copy{_Not_quite_object::_Construct_tag{}}; } // namespace ranges #endif // __cpp_lib_concepts #endif // _HAS_CXX17 -template +_EXPORT_STD template _NODISCARD _CONSTEXPR20 bool is_partitioned(const _InIt _First, const _InIt _Last, _Pr _Pred) { // test if [_First, _Last) partitioned by _Pred _Adl_verify_range(_First, _Last); @@ -1761,7 +1762,7 @@ _NODISCARD _CONSTEXPR20 bool is_partitioned(const _InIt _First, const _InIt _Las } #if _HAS_CXX17 -template = 0> +_EXPORT_STD template = 0> _NODISCARD bool is_partitioned(_ExPo&&, const _FwdIt _First, const _FwdIt _Last, _Pr _Pred) noexcept; // terminates #endif // _HAS_CXX17 @@ -1813,11 +1814,11 @@ namespace ranges { } }; - inline constexpr _Is_partitioned_fn is_partitioned{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Is_partitioned_fn is_partitioned{_Not_quite_object::_Construct_tag{}}; } // namespace ranges #endif // __cpp_lib_concepts -template +_EXPORT_STD template _NODISCARD _CONSTEXPR20 _FwdIt partition_point(_FwdIt _First, _FwdIt _Last, _Pr _Pred) { // find beginning of false partition in [_First, _Last) _Adl_verify_range(_First, _Last); @@ -1935,7 +1936,7 @@ namespace ranges { } }; - inline constexpr _Partition_point_fn partition_point{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Partition_point_fn partition_point{_Not_quite_object::_Construct_tag{}}; } // namespace ranges #endif // __cpp_lib_concepts @@ -1960,7 +1961,7 @@ _NODISCARD _CONSTEXPR20 bool _Equal_rev_pred_unchecked(_InIt1 _First1, _InIt2 _F return true; } -template +_EXPORT_STD template _NODISCARD _CONSTEXPR20 _FwdItHaystack search(_FwdItHaystack _First1, _FwdItHaystack _Last1, const _FwdItPat _First2, const _FwdItPat _Last2, _Pr _Pred) { // find first [_First2, _Last2) satisfying _Pred _Adl_verify_range(_First1, _Last1); @@ -2004,12 +2005,13 @@ _NODISCARD _CONSTEXPR20 _FwdItHaystack search(_FwdItHaystack _First1, _FwdItHays } #if _HAS_CXX17 -template = 0> +_EXPORT_STD template = 0> _NODISCARD _FwdItHaystack search(_ExPo&& _Exec, const _FwdItHaystack _First1, _FwdItHaystack _Last1, const _FwdItPat _First2, const _FwdItPat _Last2, _Pr _Pred) noexcept; // terminates #endif // _HAS_CXX17 -template +_EXPORT_STD template _NODISCARD _CONSTEXPR20 _FwdItHaystack search( const _FwdItHaystack _First1, const _FwdItHaystack _Last1, const _FwdItPat _First2, const _FwdItPat _Last2) { // find first [_First2, _Last2) match @@ -2017,7 +2019,7 @@ _NODISCARD _CONSTEXPR20 _FwdItHaystack search( } #if _HAS_CXX17 -template = 0> +_EXPORT_STD template = 0> _NODISCARD _FwdItHaystack search(_ExPo&& _Exec, const _FwdItHaystack _First1, const _FwdItHaystack _Last1, const _FwdItPat _First2, const _FwdItPat _Last2) noexcept /* terminates */ { // find first [_First2, _Last2) match @@ -2025,14 +2027,14 @@ _NODISCARD _FwdItHaystack search(_ExPo&& _Exec, const _FwdItHaystack _First1, co } #endif // _HAS_CXX17 -template +_EXPORT_STD template _NODISCARD _CONSTEXPR20 _FwdItHaystack search( const _FwdItHaystack _First, const _FwdItHaystack _Last, const _Searcher& _Search) { // find _Search's pattern in [_First, _Last) return _Search(_First, _Last).first; } -template +_EXPORT_STD template _NODISCARD _CONSTEXPR20 _FwdIt search_n( const _FwdIt _First, _FwdIt _Last, const _Diff _Count_raw, const _Ty& _Val, _Pr _Pred) { // find first _Count * _Val satisfying _Pred @@ -2105,19 +2107,20 @@ _NODISCARD _CONSTEXPR20 _FwdIt search_n( } #if _HAS_CXX17 -template = 0> +_EXPORT_STD template = 0> _NODISCARD _FwdIt search_n(_ExPo&& _Exec, const _FwdIt _First, _FwdIt _Last, const _Diff _Count_raw, const _Ty& _Val, _Pr _Pred) noexcept; // terminates #endif // _HAS_CXX17 -template +_EXPORT_STD template _NODISCARD _CONSTEXPR20 _FwdIt search_n(const _FwdIt _First, const _FwdIt _Last, const _Diff _Count, const _Ty& _Val) { // find first _Count * _Val match return _STD search_n(_First, _Last, _Count, _Val, equal_to<>{}); } #if _HAS_CXX17 -template = 0> +_EXPORT_STD template = 0> _NODISCARD _FwdIt search_n(_ExPo&& _Exec, const _FwdIt _First, const _FwdIt _Last, const _Diff _Count, const _Ty& _Val) noexcept /* terminates */ { // find first _Count * _Val match return _STD search_n(_STD forward<_ExPo>(_Exec), _First, _Last, _Count, _Val, equal_to{}); @@ -2283,7 +2286,7 @@ namespace ranges { } }; - inline constexpr _Search_n_fn search_n{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Search_n_fn search_n{_Not_quite_object::_Construct_tag{}}; #if _HAS_CXX23 class _Starts_with_fn : private _Not_quite_object { @@ -2348,7 +2351,7 @@ namespace ranges { } }; - inline constexpr _Starts_with_fn starts_with{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Starts_with_fn starts_with{_Not_quite_object::_Construct_tag{}}; class _Ends_with_fn : private _Not_quite_object { public: @@ -2576,12 +2579,12 @@ namespace ranges { } }; - inline constexpr _Ends_with_fn ends_with{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Ends_with_fn ends_with{_Not_quite_object::_Construct_tag{}}; #endif // _HAS_CXX23 } // namespace ranges #endif // __cpp_lib_concepts -template +_EXPORT_STD template _NODISCARD _CONSTEXPR20 _FwdIt1 find_end( _FwdIt1 _First1, const _FwdIt1 _Last1, const _FwdIt2 _First2, const _FwdIt2 _Last2, _Pr _Pred) { // find last [_First2, _Last2) satisfying _Pred @@ -2662,7 +2665,7 @@ _NODISCARD _CONSTEXPR20 _FwdIt1 find_end( } } -template +_EXPORT_STD template _NODISCARD _CONSTEXPR20 _FwdIt1 find_end( _FwdIt1 const _First1, const _FwdIt1 _Last1, const _FwdIt2 _First2, const _FwdIt2 _Last2) { // find last [_First2, _Last2) match @@ -2670,11 +2673,11 @@ _NODISCARD _CONSTEXPR20 _FwdIt1 find_end( } #if _HAS_CXX17 -template = 0> +_EXPORT_STD template = 0> _NODISCARD _FwdIt1 find_end( _ExPo&& _Exec, _FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _First2, _FwdIt2 _Last2, _Pr _Pred) noexcept; // terminates -template = 0> +_EXPORT_STD template = 0> _NODISCARD _FwdIt1 find_end(_ExPo&& _Exec, _FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _First2, _FwdIt2 _Last2) noexcept /* terminates */ { // find last [_First2, _Last2) match return _STD find_end(_STD forward<_ExPo>(_Exec), _First1, _Last1, _First2, _Last2, equal_to{}); @@ -2842,11 +2845,11 @@ namespace ranges { // clang-format on }; - inline constexpr _Find_end_fn find_end{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Find_end_fn find_end{_Not_quite_object::_Construct_tag{}}; } // namespace ranges #endif // __cpp_lib_concepts -template +_EXPORT_STD template _NODISCARD _CONSTEXPR20 _FwdIt1 find_first_of( _FwdIt1 _First1, const _FwdIt1 _Last1, const _FwdIt2 _First2, const _FwdIt2 _Last2, _Pr _Pred) { // look for one of [_First2, _Last2) satisfying _Pred with element @@ -2869,18 +2872,18 @@ _NODISCARD _CONSTEXPR20 _FwdIt1 find_first_of( return _First1; } -template +_EXPORT_STD template _NODISCARD _CONSTEXPR20 _FwdIt1 find_first_of(const _FwdIt1 _First1, const _FwdIt1 _Last1, const _FwdIt2 _First2, const _FwdIt2 _Last2) { // look for one of [_First2, _Last2) that matches element return _STD find_first_of(_First1, _Last1, _First2, _Last2, equal_to<>{}); } #if _HAS_CXX17 -template = 0> +_EXPORT_STD template = 0> _NODISCARD _FwdIt1 find_first_of(_ExPo&& _Exec, const _FwdIt1 _First1, _FwdIt1 _Last1, const _FwdIt2 _First2, const _FwdIt2 _Last2, _Pr _Pred) noexcept; // terminates -template = 0> +_EXPORT_STD template = 0> _NODISCARD _FwdIt1 find_first_of(_ExPo&& _Exec, const _FwdIt1 _First1, const _FwdIt1 _Last1, const _FwdIt2 _First2, const _FwdIt2 _Last2) noexcept /* terminates */ { // look for one of [_First2, _Last2) that matches element return _STD find_first_of(_STD forward<_ExPo>(_Exec), _First1, _Last1, _First2, _Last2, equal_to{}); @@ -2946,9 +2949,9 @@ namespace ranges { } }; - inline constexpr _Find_first_of_fn find_first_of{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Find_first_of_fn find_first_of{_Not_quite_object::_Construct_tag{}}; - template + _EXPORT_STD template using swap_ranges_result = in_in_result<_In1, _In2>; class _Swap_ranges_fn : private _Not_quite_object { @@ -3038,11 +3041,11 @@ namespace ranges { } }; - inline constexpr _Swap_ranges_fn swap_ranges{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Swap_ranges_fn swap_ranges{_Not_quite_object::_Construct_tag{}}; } // namespace ranges #endif // __cpp_lib_concepts -template +_EXPORT_STD template _CONSTEXPR20 _FwdIt2 swap_ranges(const _FwdIt1 _First1, const _FwdIt1 _Last1, _FwdIt2 _First2) { // swap [_First1, _Last1) with [_First2, ...) _Adl_verify_range(_First1, _Last1); @@ -3055,7 +3058,7 @@ _CONSTEXPR20 _FwdIt2 swap_ranges(const _FwdIt1 _First1, const _FwdIt1 _Last1, _F } #if _HAS_CXX17 -template = 0> +_EXPORT_STD template = 0> _FwdIt2 swap_ranges(_ExPo&&, _FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _Dest) noexcept /* terminates */ { // swap [_First1, _Last1) with [_Dest, ...) // not parallelized as benchmarks show it isn't worth it @@ -3063,7 +3066,7 @@ _FwdIt2 swap_ranges(_ExPo&&, _FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _Dest) noe } #endif // _HAS_CXX17 -template +_EXPORT_STD template _CONSTEXPR20 _OutIt transform(const _InIt _First, const _InIt _Last, _OutIt _Dest, _Fn _Func) { // transform [_First, _Last) with _Func _Adl_verify_range(_First, _Last); @@ -3079,12 +3082,12 @@ _CONSTEXPR20 _OutIt transform(const _InIt _First, const _InIt _Last, _OutIt _Des } #if _HAS_CXX17 -template = 0> +_EXPORT_STD template = 0> _FwdIt2 transform( _ExPo&& _Exec, const _FwdIt1 _First, const _FwdIt1 _Last, _FwdIt2 _Dest, _Fn _Func) noexcept; // terminates #endif // _HAS_CXX17 -template +_EXPORT_STD template _CONSTEXPR20 _OutIt transform( const _InIt1 _First1, const _InIt1 _Last1, const _InIt2 _First2, _OutIt _Dest, _Fn _Func) { // transform [_First1, _Last1) and [_First2, ...) with _Func @@ -3103,17 +3106,18 @@ _CONSTEXPR20 _OutIt transform( } #if _HAS_CXX17 -template = 0> +_EXPORT_STD template = 0> _FwdIt3 transform(_ExPo&& _Exec, const _FwdIt1 _First1, const _FwdIt1 _Last1, const _FwdIt2 _First2, _FwdIt3 _Dest, _Fn _Func) noexcept; // terminates #endif // _HAS_CXX17 #ifdef __cpp_lib_concepts namespace ranges { - template + _EXPORT_STD template using unary_transform_result = in_out_result<_In, _Out>; - template + _EXPORT_STD template using binary_transform_result = in_in_out_result<_In1, _In2, _Out>; class _Transform_fn : private _Not_quite_object { @@ -3213,11 +3217,11 @@ namespace ranges { } }; - inline constexpr _Transform_fn transform{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Transform_fn transform{_Not_quite_object::_Construct_tag{}}; } // namespace ranges #endif // __cpp_lib_concepts -template +_EXPORT_STD template _CONSTEXPR20 void replace(const _FwdIt _First, const _FwdIt _Last, const _Ty& _Oldval, const _Ty& _Newval) { // replace each matching _Oldval with _Newval _Adl_verify_range(_First, _Last); @@ -3231,7 +3235,7 @@ _CONSTEXPR20 void replace(const _FwdIt _First, const _FwdIt _Last, const _Ty& _O } #if _HAS_CXX17 -template = 0> +_EXPORT_STD template = 0> void replace(_ExPo&& _Exec, const _FwdIt _First, const _FwdIt _Last, const _Ty& _Oldval, const _Ty& _Newval) noexcept; // terminates #endif // _HAS_CXX17 @@ -3292,11 +3296,11 @@ namespace ranges { } }; - inline constexpr _Replace_fn replace{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Replace_fn replace{_Not_quite_object::_Construct_tag{}}; } // namespace ranges #endif // __cpp_lib_concepts -template +_EXPORT_STD template _CONSTEXPR20 void replace_if(const _FwdIt _First, const _FwdIt _Last, _Pr _Pred, const _Ty& _Val) { // replace each satisfying _Pred with _Val _Adl_verify_range(_First, _Last); @@ -3310,7 +3314,7 @@ _CONSTEXPR20 void replace_if(const _FwdIt _First, const _FwdIt _Last, _Pr _Pred, } #if _HAS_CXX17 -template = 0> +_EXPORT_STD template = 0> void replace_if(_ExPo&& _Exec, _FwdIt _First, _FwdIt _Last, _Pr _Pred, const _Ty& _Val) noexcept; // terminates #endif // _HAS_CXX17 @@ -3369,11 +3373,11 @@ namespace ranges { } }; - inline constexpr _Replace_if_fn replace_if{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Replace_if_fn replace_if{_Not_quite_object::_Construct_tag{}}; } // namespace ranges #endif // __cpp_lib_concepts -template +_EXPORT_STD template _CONSTEXPR20 _OutIt replace_copy(_InIt _First, _InIt _Last, _OutIt _Dest, const _Ty& _Oldval, const _Ty& _Newval) { // copy replacing each matching _Oldval with _Newval _Adl_verify_range(_First, _Last); @@ -3393,7 +3397,7 @@ _CONSTEXPR20 _OutIt replace_copy(_InIt _First, _InIt _Last, _OutIt _Dest, const } #if _HAS_CXX17 -template = 0> +_EXPORT_STD template = 0> _FwdIt2 replace_copy(_ExPo&&, _FwdIt1 _First, _FwdIt1 _Last, _FwdIt2 _Dest, const _Ty& _Oldval, const _Ty& _Newval) noexcept /* terminates */ { // copy replacing each matching _Oldval with _Newval @@ -3406,7 +3410,7 @@ _FwdIt2 replace_copy(_ExPo&&, _FwdIt1 _First, _FwdIt1 _Last, _FwdIt2 _Dest, cons #ifdef __cpp_lib_concepts namespace ranges { - template + _EXPORT_STD template using replace_copy_result = in_out_result<_In, _Out>; class _Replace_copy_fn : private _Not_quite_object { @@ -3467,11 +3471,11 @@ namespace ranges { } }; - inline constexpr _Replace_copy_fn replace_copy{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Replace_copy_fn replace_copy{_Not_quite_object::_Construct_tag{}}; } // namespace ranges #endif // __cpp_lib_concepts -template +_EXPORT_STD template _CONSTEXPR20 _OutIt replace_copy_if(_InIt _First, _InIt _Last, _OutIt _Dest, _Pr _Pred, const _Ty& _Val) { // copy replacing each satisfying _Pred with _Val _Adl_verify_range(_First, _Last); @@ -3491,7 +3495,8 @@ _CONSTEXPR20 _OutIt replace_copy_if(_InIt _First, _InIt _Last, _OutIt _Dest, _Pr } #if _HAS_CXX17 -template = 0> +_EXPORT_STD template = 0> _FwdIt2 replace_copy_if(_ExPo&&, _FwdIt1 _First, _FwdIt1 _Last, _FwdIt2 _Dest, _Pr _Pred, const _Ty& _Val) noexcept /* terminates */ { // copy replacing each satisfying _Pred with _Val @@ -3504,7 +3509,7 @@ _FwdIt2 replace_copy_if(_ExPo&&, _FwdIt1 _First, _FwdIt1 _Last, _FwdIt2 _Dest, _ #ifdef __cpp_lib_concepts namespace ranges { - template + _EXPORT_STD template using replace_copy_if_result = in_out_result<_In, _Out>; class _Replace_copy_if_fn : private _Not_quite_object { @@ -3560,7 +3565,7 @@ namespace ranges { } }; - inline constexpr _Replace_copy_if_fn replace_copy_if{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Replace_copy_if_fn replace_copy_if{_Not_quite_object::_Construct_tag{}}; class _Fill_fn : private _Not_quite_object { public: @@ -3605,7 +3610,7 @@ namespace ranges { } }; - inline constexpr _Fill_fn fill{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Fill_fn fill{_Not_quite_object::_Construct_tag{}}; class _Generate_fn : private _Not_quite_object { public: @@ -3646,7 +3651,7 @@ namespace ranges { } }; - inline constexpr _Generate_fn generate{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Generate_fn generate{_Not_quite_object::_Construct_tag{}}; class _Generate_n_fn : private _Not_quite_object { public: @@ -3669,11 +3674,11 @@ namespace ranges { } }; - inline constexpr _Generate_n_fn generate_n{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Generate_n_fn generate_n{_Not_quite_object::_Construct_tag{}}; } // namespace ranges #endif // __cpp_lib_concepts -template +_EXPORT_STD template _CONSTEXPR20 void generate(_FwdIt _First, _FwdIt _Last, _Fn _Func) { // replace [_First, _Last) with _Func() _Adl_verify_range(_First, _Last); auto _UFirst = _Get_unwrapped(_First); @@ -3684,7 +3689,7 @@ _CONSTEXPR20 void generate(_FwdIt _First, _FwdIt _Last, _Fn _Func) { // replace } #if _HAS_CXX17 -template = 0> +_EXPORT_STD template = 0> void generate(_ExPo&&, _FwdIt _First, _FwdIt _Last, _Fn _Func) noexcept /* terminates */ { // replace [_First, _Last) with _Func() // not parallelized at present due to unclear parallelism requirements on _Func @@ -3692,7 +3697,7 @@ void generate(_ExPo&&, _FwdIt _First, _FwdIt _Last, _Fn _Func) noexcept /* termi } #endif // _HAS_CXX17 -template +_EXPORT_STD template _CONSTEXPR20 _OutIt generate_n(_OutIt _Dest, const _Diff _Count_raw, _Fn _Func) { // replace [_Dest, _Dest + _Count) with _Func() _Algorithm_int_t<_Diff> _Count = _Count_raw; @@ -3711,7 +3716,7 @@ _CONSTEXPR20 _OutIt generate_n(_OutIt _Dest, const _Diff _Count_raw, _Fn _Func) } #if _HAS_CXX17 -template = 0> +_EXPORT_STD template = 0> _FwdIt generate_n(_ExPo&&, const _FwdIt _Dest, const _Diff _Count_raw, _Fn _Func) noexcept /* terminates */ { // replace [_Dest, _Dest + _Count) with _Func() // not parallelized at present due to unclear parallelism requirements on _Func @@ -3720,7 +3725,7 @@ _FwdIt generate_n(_ExPo&&, const _FwdIt _Dest, const _Diff _Count_raw, _Fn _Func } #endif // _HAS_CXX17 -template +_EXPORT_STD template _CONSTEXPR20 _OutIt remove_copy(_InIt _First, _InIt _Last, _OutIt _Dest, const _Ty& _Val) { // copy omitting each matching _Val _Adl_verify_range(_First, _Last); @@ -3739,7 +3744,7 @@ _CONSTEXPR20 _OutIt remove_copy(_InIt _First, _InIt _Last, _OutIt _Dest, const _ } #if _HAS_CXX17 -template = 0> +_EXPORT_STD template = 0> _FwdIt2 remove_copy(_ExPo&&, _FwdIt1 _First, _FwdIt1 _Last, _FwdIt2 _Dest, const _Ty& _Val) noexcept /* terminates */ { // copy omitting each matching _Val // not parallelized at present, parallelism expected to be feasible in a future release @@ -3749,7 +3754,7 @@ _FwdIt2 remove_copy(_ExPo&&, _FwdIt1 _First, _FwdIt1 _Last, _FwdIt2 _Dest, const } #endif // _HAS_CXX17 -template +_EXPORT_STD template _CONSTEXPR20 _OutIt remove_copy_if(_InIt _First, _InIt _Last, _OutIt _Dest, _Pr _Pred) { // copy omitting each element satisfying _Pred _Adl_verify_range(_First, _Last); @@ -3768,7 +3773,7 @@ _CONSTEXPR20 _OutIt remove_copy_if(_InIt _First, _InIt _Last, _OutIt _Dest, _Pr } #if _HAS_CXX17 -template = 0> +_EXPORT_STD template = 0> _FwdIt2 remove_copy_if(_ExPo&&, _FwdIt1 _First, _FwdIt1 _Last, _FwdIt2 _Dest, _Pr _Pred) noexcept /* terminates */ { // copy omitting each element satisfying _Pred // not parallelized at present, parallelism expected to be feasible in a future release @@ -3779,11 +3784,11 @@ _FwdIt2 remove_copy_if(_ExPo&&, _FwdIt1 _First, _FwdIt1 _Last, _FwdIt2 _Dest, _P #endif // _HAS_CXX17 #if _HAS_CXX17 -template = 0> +_EXPORT_STD template = 0> _NODISCARD_REMOVE_ALG _FwdIt remove( _ExPo&& _Exec, const _FwdIt _First, const _FwdIt _Last, const _Ty& _Val) noexcept; // terminates -template = 0> +_EXPORT_STD template = 0> _NODISCARD_REMOVE_ALG _FwdIt remove_if( _ExPo&& _Exec, _FwdIt _First, const _FwdIt _Last, _Pr _Pred) noexcept; // terminates #endif // _HAS_CXX17 @@ -3842,7 +3847,7 @@ namespace ranges { } }; - inline constexpr _Remove_fn remove{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Remove_fn remove{_Not_quite_object::_Construct_tag{}}; class _Remove_if_fn : private _Not_quite_object { public: @@ -3896,9 +3901,9 @@ namespace ranges { } }; - inline constexpr _Remove_if_fn remove_if{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Remove_if_fn remove_if{_Not_quite_object::_Construct_tag{}}; - template + _EXPORT_STD template using remove_copy_result = in_out_result<_In, _Out>; class _Remove_copy_fn : private _Not_quite_object { @@ -3960,9 +3965,9 @@ namespace ranges { } }; - inline constexpr _Remove_copy_fn remove_copy{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Remove_copy_fn remove_copy{_Not_quite_object::_Construct_tag{}}; - template + _EXPORT_STD template using remove_copy_if_result = in_out_result<_In, _Out>; class _Remove_copy_if_fn : private _Not_quite_object { @@ -4020,11 +4025,11 @@ namespace ranges { } }; - inline constexpr _Remove_copy_if_fn remove_copy_if{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Remove_copy_if_fn remove_copy_if{_Not_quite_object::_Construct_tag{}}; } // namespace ranges #endif // __cpp_lib_concepts -template +_EXPORT_STD template _NODISCARD_UNIQUE_ALG _CONSTEXPR20 _FwdIt unique(_FwdIt _First, _FwdIt _Last, _Pr _Pred) { // remove each satisfying _Pred with previous _Adl_verify_range(_First, _Last); @@ -4049,20 +4054,20 @@ _NODISCARD_UNIQUE_ALG _CONSTEXPR20 _FwdIt unique(_FwdIt _First, _FwdIt _Last, _P return _Last; } -template +_EXPORT_STD template _NODISCARD_UNIQUE_ALG _CONSTEXPR20 _FwdIt unique(_FwdIt _First, _FwdIt _Last) { // remove each matching previous return _STD unique(_First, _Last, equal_to<>{}); } #if _HAS_CXX17 -template = 0> +_EXPORT_STD template = 0> _NODISCARD_UNIQUE_ALG _FwdIt unique(_ExPo&&, _FwdIt _First, _FwdIt _Last, _Pr _Pred) noexcept /* terminates */ { // remove each satisfying _Pred with previous // not parallelized at present, parallelism expected to be feasible in a future release return _STD unique(_First, _Last, _Pass_fn(_Pred)); } -template = 0> +_EXPORT_STD template = 0> _NODISCARD_UNIQUE_ALG _FwdIt unique(_ExPo&&, _FwdIt _First, _FwdIt _Last) noexcept /* terminates */ { // remove each matching previous // not parallelized at present, parallelism expected to be feasible in a future release @@ -4134,7 +4139,7 @@ namespace ranges { } }; - inline constexpr _Unique_fn unique{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Unique_fn unique{_Not_quite_object::_Construct_tag{}}; } // namespace ranges #endif // __cpp_lib_concepts @@ -4146,7 +4151,7 @@ _INLINE_VAR constexpr bool #endif _Can_reread_dest = _Is_cpp17_fwd_iter_v<_OutIt> && is_same_v<_Iter_value_t<_InIt>, _Iter_value_t<_OutIt>>; -template +_EXPORT_STD template _CONSTEXPR20 _OutIt unique_copy(_InIt _First, _InIt _Last, _OutIt _Dest, _Pr _Pred) { // copy compressing pairs that match _Adl_verify_range(_First, _Last); @@ -4202,13 +4207,13 @@ _CONSTEXPR20 _OutIt unique_copy(_InIt _First, _InIt _Last, _OutIt _Dest, _Pr _Pr return _Dest; } -template +_EXPORT_STD template _CONSTEXPR20 _OutIt unique_copy(_InIt _First, _InIt _Last, _OutIt _Dest) { // copy compressing pairs that match return _STD unique_copy(_First, _Last, _Dest, equal_to<>{}); } #if _HAS_CXX17 -template = 0> +_EXPORT_STD template = 0> _FwdIt2 unique_copy(_ExPo&&, _FwdIt1 _First, _FwdIt1 _Last, _FwdIt2 _Dest, _Pr _Pred) noexcept /* terminates */ { // copy compressing pairs that match // not parallelized at present, parallelism expected to be feasible in a future release @@ -4217,7 +4222,7 @@ _FwdIt2 unique_copy(_ExPo&&, _FwdIt1 _First, _FwdIt1 _Last, _FwdIt2 _Dest, _Pr _ return _STD unique_copy(_First, _Last, _Dest, _Pass_fn(_Pred)); } -template = 0> +_EXPORT_STD template = 0> _FwdIt2 unique_copy(_ExPo&&, _FwdIt1 _First, _FwdIt1 _Last, _FwdIt2 _Dest) noexcept /* terminates */ { // copy compressing pairs that match // not parallelized at present, parallelism expected to be feasible in a future release @@ -4229,7 +4234,7 @@ _FwdIt2 unique_copy(_ExPo&&, _FwdIt1 _First, _FwdIt1 _Last, _FwdIt2 _Dest) noexc #ifdef __cpp_lib_concepts namespace ranges { - template + _EXPORT_STD template using unique_copy_result = in_out_result<_In, _Out>; template @@ -4331,7 +4336,7 @@ namespace ranges { } }; - inline constexpr _Unique_copy_fn unique_copy{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Unique_copy_fn unique_copy{_Not_quite_object::_Construct_tag{}}; // concept-constrained for strict enforcement as it is used by several algorithms template @@ -4393,11 +4398,11 @@ namespace ranges { } }; - inline constexpr _Reverse_fn reverse{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Reverse_fn reverse{_Not_quite_object::_Construct_tag{}}; } // namespace ranges #endif // __cpp_lib_concepts -template +_EXPORT_STD template _CONSTEXPR20 _OutIt reverse_copy(_BidIt _First, _BidIt _Last, _OutIt _Dest) { // copy reversing elements in [_First, _Last) _Adl_verify_range(_First, _Last); @@ -4444,7 +4449,7 @@ _CONSTEXPR20 _OutIt reverse_copy(_BidIt _First, _BidIt _Last, _OutIt _Dest) { } #if _HAS_CXX17 -template = 0> +_EXPORT_STD template = 0> _FwdIt reverse_copy(_ExPo&&, _BidIt _First, _BidIt _Last, _FwdIt _Dest) noexcept /* terminates */ { // copy reversing elements in [_First, _Last) // not parallelized as benchmarks show it isn't worth it @@ -4455,7 +4460,7 @@ _FwdIt reverse_copy(_ExPo&&, _BidIt _First, _BidIt _Last, _FwdIt _Dest) noexcept #ifdef __cpp_lib_concepts namespace ranges { - template + _EXPORT_STD template using reverse_copy_result = in_out_result<_In, _Out>; class _Reverse_copy_fn : private _Not_quite_object { @@ -4531,7 +4536,7 @@ namespace ranges { } }; - inline constexpr _Reverse_copy_fn reverse_copy{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Reverse_copy_fn reverse_copy{_Not_quite_object::_Construct_tag{}}; } // namespace ranges #endif // __cpp_lib_concepts #endif // _HAS_CXX17 @@ -4641,11 +4646,11 @@ namespace ranges { } }; - inline constexpr _Rotate_fn rotate{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Rotate_fn rotate{_Not_quite_object::_Construct_tag{}}; } // namespace ranges #endif // __cpp_lib_concepts -template +_EXPORT_STD template _CONSTEXPR20 _OutIt rotate_copy(_FwdIt _First, _FwdIt _Mid, _FwdIt _Last, _OutIt _Dest) { // copy rotating [_First, _Last) _Adl_verify_range(_First, _Mid); @@ -4660,7 +4665,7 @@ _CONSTEXPR20 _OutIt rotate_copy(_FwdIt _First, _FwdIt _Mid, _FwdIt _Last, _OutIt } #if _HAS_CXX17 -template = 0> +_EXPORT_STD template = 0> _FwdIt2 rotate_copy(_ExPo&&, _FwdIt1 _First, _FwdIt1 _Mid, _FwdIt1 _Last, _FwdIt2 _Dest) noexcept /* terminates */ { // copy rotating [_First, _Last) // not parallelized as benchmarks show it isn't worth it @@ -4671,7 +4676,7 @@ _FwdIt2 rotate_copy(_ExPo&&, _FwdIt1 _First, _FwdIt1 _Mid, _FwdIt1 _Last, _FwdIt #ifdef __cpp_lib_concepts namespace ranges { - template + _EXPORT_STD template using rotate_copy_result = in_out_result<_In, _Out>; class _Rotate_copy_fn : private _Not_quite_object { @@ -4718,7 +4723,7 @@ namespace ranges { } }; - inline constexpr _Rotate_copy_fn rotate_copy{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Rotate_copy_fn rotate_copy{_Not_quite_object::_Construct_tag{}}; } // namespace ranges #endif // __cpp_lib_concepts @@ -4766,7 +4771,7 @@ _SampleIt _Sample_selection_unchecked( return _Dest; } -template +_EXPORT_STD template _SampleIt sample(_PopIt _First, _PopIt _Last, _SampleIt _Dest, _Diff _Count, _Urng&& _Func) { // randomly select _Count elements from [_First, _Last) into _Dest static_assert(_Is_ranges_fwd_iter_v<_PopIt> || _Is_cpp17_random_iter_v<_SampleIt>, @@ -4802,7 +4807,7 @@ _SampleIt sample(_PopIt _First, _PopIt _Last, _SampleIt _Dest, _Diff _Count, _Ur #ifdef __cpp_lib_concepts // clang-format off -template +_EXPORT_STD template concept uniform_random_bit_generator = invocable<_Ty&> && unsigned_integral> && requires { @@ -4915,7 +4920,7 @@ namespace ranges { } }; - inline constexpr _Sample_fn sample{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Sample_fn sample{_Not_quite_object::_Construct_tag{}}; } // namespace ranges #endif // __cpp_lib_concepts #endif // _HAS_CXX17 @@ -4942,7 +4947,7 @@ void _Random_shuffle1(_RanIt _First, _RanIt _Last, _RngFn& _RngFunc) { } } -template +_EXPORT_STD template void shuffle(_RanIt _First, _RanIt _Last, _Urng&& _Func) { // shuffle [_First, _Last) using URNG _Func using _Urng0 = remove_reference_t<_Urng>; _Rng_from_urng<_Iter_diff_t<_RanIt>, _Urng0> _RngFunc(_Func); @@ -5004,12 +5009,12 @@ namespace ranges { } }; - inline constexpr _Shuffle_fn shuffle{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Shuffle_fn shuffle{_Not_quite_object::_Construct_tag{}}; } // namespace ranges #endif // __cpp_lib_concepts #if _HAS_AUTO_PTR_ETC -template +_EXPORT_STD template void random_shuffle(_RanIt _First, _RanIt _Last, _RngFn&& _RngFunc) { // shuffle [_First, _Last) using random function _RngFunc _Random_shuffle1(_First, _Last, _RngFunc); @@ -5031,7 +5036,7 @@ struct _Rand_urng_from_func { // wrap rand() as a URNG } }; -template +_EXPORT_STD template void random_shuffle(_RanIt _First, _RanIt _Last) { // shuffle [_First, _Last) using rand() _Rand_urng_from_func _Func; _STD shuffle(_First, _Last, _Func); @@ -5039,7 +5044,7 @@ void random_shuffle(_RanIt _First, _RanIt _Last) { // shuffle [_First, _Last) us #endif // _HAS_AUTO_PTR_ETC #if _HAS_CXX20 -template +_EXPORT_STD template constexpr _FwdIt shift_left(_FwdIt _First, const _FwdIt _Last, _Iter_diff_t<_FwdIt> _Pos_to_shift) { // shift [_First, _Last) left by _Pos_to_shift // positions; returns the end of the resulting range @@ -5073,14 +5078,14 @@ constexpr _FwdIt shift_left(_FwdIt _First, const _FwdIt _Last, _Iter_diff_t<_Fwd return _First; } -template = 0> +_EXPORT_STD template = 0> _FwdIt shift_left(_ExPo&&, _FwdIt _First, _FwdIt _Last, _Iter_diff_t<_FwdIt> _Pos_to_shift) noexcept /* terminates */ { // shift [_First, _Last) left by _Pos_to_shift positions // not parallelized as benchmarks show it isn't worth it return _STD shift_left(_First, _Last, _Pos_to_shift); } -template +_EXPORT_STD template constexpr _FwdIt shift_right(_FwdIt _First, const _FwdIt _Last, _Iter_diff_t<_FwdIt> _Pos_to_shift) { // shift [_First, _Last) right by _Pos_to_shift // positions; returns the beginning of the resulting range @@ -5154,7 +5159,7 @@ constexpr _FwdIt shift_right(_FwdIt _First, const _FwdIt _Last, _Iter_diff_t<_Fw } } -template = 0> +_EXPORT_STD template = 0> _FwdIt shift_right(_ExPo&&, _FwdIt _First, _FwdIt _Last, _Iter_diff_t<_FwdIt> _Pos_to_shift) noexcept /* terminates */ { // shift [_First, _Last) right by _Pos_to_shift positions // not parallelized as benchmarks show it isn't worth it @@ -5227,7 +5232,7 @@ namespace ranges { } }; - inline constexpr _Shift_left_fn shift_left{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Shift_left_fn shift_left{_Not_quite_object::_Construct_tag{}}; class _Shift_right_fn : private _Not_quite_object { public: @@ -5388,11 +5393,11 @@ namespace ranges { } }; - inline constexpr _Shift_right_fn shift_right{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Shift_right_fn shift_right{_Not_quite_object::_Construct_tag{}}; } // namespace ranges #endif // _HAS_CXX23 && defined(__cpp_lib_concepts) -template +_EXPORT_STD template _CONSTEXPR20 _FwdIt partition(_FwdIt _First, const _FwdIt _Last, _Pr _Pred) { // move elements satisfying _Pred to beginning of sequence _Adl_verify_range(_First, _Last); @@ -5451,7 +5456,7 @@ _CONSTEXPR20 _FwdIt partition(_FwdIt _First, const _FwdIt _Last, _Pr _Pred) { } #if _HAS_CXX17 -template = 0> +_EXPORT_STD template = 0> _FwdIt partition(_ExPo&& _Exec, _FwdIt _First, const _FwdIt _Last, _Pr _Pred) noexcept; // terminates #ifdef __cpp_lib_concepts @@ -5532,7 +5537,7 @@ namespace ranges { } }; - inline constexpr _Partition_fn partition{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Partition_fn partition{_Not_quite_object::_Construct_tag{}}; } // namespace ranges #endif // __cpp_lib_concepts #endif // _HAS_CXX17 @@ -5689,7 +5694,7 @@ _BidIt _Stable_partition_unchecked(_BidIt _First, _BidIt _Last, _Pr _Pred) { return _Stable_partition_unchecked1(_First, _Last, _Pred, _Total_count, _Temp_buf._Data, _Temp_buf._Capacity).first; } -template +_EXPORT_STD template _BidIt stable_partition(_BidIt _First, _BidIt _Last, _Pr _Pred) { // partition preserving order of equivalents _Adl_verify_range(_First, _Last); @@ -5698,7 +5703,7 @@ _BidIt stable_partition(_BidIt _First, _BidIt _Last, _Pr _Pred) { } #if _HAS_CXX17 -template = 0> +_EXPORT_STD template = 0> _BidIt stable_partition(_ExPo&&, _BidIt _First, _BidIt _Last, _Pr _Pred) noexcept /* terminates */ { // partition preserving order of equivalents // not parallelized at present, parallelism expected to be feasible in a future release @@ -5905,7 +5910,7 @@ namespace ranges { } }; - inline constexpr _Stable_partition_fn stable_partition{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Stable_partition_fn stable_partition{_Not_quite_object::_Construct_tag{}}; } // namespace ranges #endif // __cpp_lib_concepts @@ -5925,7 +5930,7 @@ _CONSTEXPR20 void _Push_heap_by_index( *(_First + _Hole) = _STD forward<_Ty>(_Val); // drop _Val into final hole } -template +_EXPORT_STD template _CONSTEXPR20 void push_heap(_RanIt _First, _RanIt _Last, _Pr _Pred) { // push *(_Last - 1) onto heap at [_First, _Last - 1) _Adl_verify_range(_First, _Last); @@ -5939,7 +5944,7 @@ _CONSTEXPR20 void push_heap(_RanIt _First, _RanIt _Last, _Pr _Pred) { } } -template +_EXPORT_STD template _CONSTEXPR20 void push_heap(_RanIt _First, _RanIt _Last) { // push *(_Last - 1) onto heap at [_First, _Last - 1) _STD push_heap(_First, _Last, less<>{}); @@ -6015,7 +6020,7 @@ namespace ranges { } }; - inline constexpr _Push_heap_fn push_heap{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Push_heap_fn push_heap{_Not_quite_object::_Construct_tag{}}; } // namespace ranges #endif // __cpp_lib_concepts @@ -6070,14 +6075,14 @@ _CONSTEXPR20 void _Pop_heap_unchecked(_RanIt _First, _RanIt _Last, _Pr _Pred) { } } -template +_EXPORT_STD template _CONSTEXPR20 void pop_heap(_RanIt _First, _RanIt _Last, _Pr _Pred) { // pop *_First to *(_Last - 1) and reheap _Adl_verify_range(_First, _Last); _Pop_heap_unchecked(_Get_unwrapped(_First), _Get_unwrapped(_Last), _Pass_fn(_Pred)); } -template +_EXPORT_STD template _CONSTEXPR20 void pop_heap(_RanIt _First, _RanIt _Last) { // pop *_First to *(_Last - 1) and reheap _STD pop_heap(_First, _Last, less<>{}); @@ -6181,7 +6186,7 @@ namespace ranges { } }; - inline constexpr _Pop_heap_fn pop_heap{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Pop_heap_fn pop_heap{_Not_quite_object::_Construct_tag{}}; } // namespace ranges #endif // __cpp_lib_concepts @@ -6198,13 +6203,13 @@ _CONSTEXPR20 void _Make_heap_unchecked(_RanIt _First, _RanIt _Last, _Pr _Pred) { } } -template +_EXPORT_STD template _CONSTEXPR20 void make_heap(_RanIt _First, _RanIt _Last, _Pr _Pred) { // make [_First, _Last) into a heap _Adl_verify_range(_First, _Last); _Make_heap_unchecked(_Get_unwrapped(_First), _Get_unwrapped(_Last), _Pass_fn(_Pred)); } -template +_EXPORT_STD template _CONSTEXPR20 void make_heap(_RanIt _First, _RanIt _Last) { // make [_First, _Last) into a heap _STD make_heap(_First, _Last, less<>{}); } @@ -6255,7 +6260,7 @@ namespace ranges { } }; - inline constexpr _Make_heap_fn make_heap{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Make_heap_fn make_heap{_Not_quite_object::_Construct_tag{}}; } // namespace ranges #endif // __cpp_lib_concepts @@ -6273,7 +6278,7 @@ _CONSTEXPR20 _RanIt _Is_heap_until_unchecked(_RanIt _First, _RanIt _Last, _Pr _P return _Last; } -template +_EXPORT_STD template _NODISCARD _CONSTEXPR20 _RanIt is_heap_until(_RanIt _First, _RanIt _Last, _Pr _Pred) { // find extent of range that is a heap _Adl_verify_range(_First, _Last); @@ -6281,7 +6286,7 @@ _NODISCARD _CONSTEXPR20 _RanIt is_heap_until(_RanIt _First, _RanIt _Last, _Pr _P return _First; } -template +_EXPORT_STD template _NODISCARD _CONSTEXPR20 bool is_heap(_RanIt _First, _RanIt _Last, _Pr _Pred) { // test if range is a heap _Adl_verify_range(_First, _Last); @@ -6290,34 +6295,34 @@ _NODISCARD _CONSTEXPR20 bool is_heap(_RanIt _First, _RanIt _Last, _Pr _Pred) { return _Is_heap_until_unchecked(_UFirst, _ULast, _Pass_fn(_Pred)) == _ULast; } -template +_EXPORT_STD template _NODISCARD _CONSTEXPR20 _RanIt is_heap_until(_RanIt _First, _RanIt _Last) { // find extent of range that is a heap ordered by operator< return _STD is_heap_until(_First, _Last, less<>{}); } -template +_EXPORT_STD template _NODISCARD _CONSTEXPR20 bool is_heap(_RanIt _First, _RanIt _Last) { // test if range is a heap ordered by operator< return _STD is_heap(_First, _Last, less<>{}); } #if _HAS_CXX17 -template = 0> +_EXPORT_STD template = 0> _NODISCARD _RanIt is_heap_until(_ExPo&& _Exec, _RanIt _First, _RanIt _Last, _Pr _Pred) noexcept; // terminates -template = 0> +_EXPORT_STD template = 0> _NODISCARD bool is_heap(_ExPo&& _Exec, _RanIt _First, _RanIt _Last, _Pr _Pred) noexcept /* terminates */ { // test if range is a heap return _STD is_heap_until(_STD forward<_ExPo>(_Exec), _First, _Last, _Pass_fn(_Pred)) == _Last; } -template = 0> +_EXPORT_STD template = 0> _NODISCARD _RanIt is_heap_until(_ExPo&& _Exec, _RanIt _First, _RanIt _Last) noexcept /* terminates */ { // find extent of range that is a heap ordered by operator< return _STD is_heap_until(_STD forward<_ExPo>(_Exec), _First, _Last, less{}); } -template = 0> +_EXPORT_STD template = 0> _NODISCARD bool is_heap(_ExPo&& _Exec, _RanIt _First, _RanIt _Last) noexcept /* terminates */ { // test if range is a heap ordered by operator< return _STD is_heap(_STD forward<_ExPo>(_Exec), _First, _Last, less{}); @@ -6375,7 +6380,7 @@ namespace ranges { } }; - inline constexpr _Is_heap_fn is_heap{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Is_heap_fn is_heap{_Not_quite_object::_Construct_tag{}}; class _Is_heap_until_fn : private _Not_quite_object { public: @@ -6402,7 +6407,7 @@ namespace ranges { } }; - inline constexpr _Is_heap_until_fn is_heap_until{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Is_heap_until_fn is_heap_until{_Not_quite_object::_Construct_tag{}}; } // namespace ranges #endif // __cpp_lib_concepts #endif // _HAS_CXX17 @@ -6415,7 +6420,7 @@ _CONSTEXPR20 void _Sort_heap_unchecked(_RanIt _First, _RanIt _Last, _Pr _Pred) { } } -template +_EXPORT_STD template _CONSTEXPR20 void sort_heap(_RanIt _First, _RanIt _Last, _Pr _Pred) { // order heap by repeatedly popping _Adl_verify_range(_First, _Last); const auto _UFirst = _Get_unwrapped(_First); @@ -6429,7 +6434,7 @@ _CONSTEXPR20 void sort_heap(_RanIt _First, _RanIt _Last, _Pr _Pred) { // order h _Sort_heap_unchecked(_UFirst, _ULast, _Pass_fn(_Pred)); } -template +_EXPORT_STD template _CONSTEXPR20 void sort_heap(_RanIt _First, _RanIt _Last) { // order heap by repeatedly popping _STD sort_heap(_First, _Last, less<>{}); } @@ -6474,7 +6479,7 @@ namespace ranges { } }; - inline constexpr _Sort_heap_fn sort_heap{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Sort_heap_fn sort_heap{_Not_quite_object::_Construct_tag{}}; template _NODISCARD constexpr _It _Lower_bound_unchecked( @@ -6529,7 +6534,7 @@ namespace ranges { } }; - inline constexpr _Lower_bound_fn lower_bound{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Lower_bound_fn lower_bound{_Not_quite_object::_Construct_tag{}}; template _NODISCARD constexpr _It _Upper_bound_unchecked( @@ -6582,11 +6587,11 @@ namespace ranges { } }; - inline constexpr _Upper_bound_fn upper_bound{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Upper_bound_fn upper_bound{_Not_quite_object::_Construct_tag{}}; } // namespace ranges #endif // __cpp_lib_concepts -template +_EXPORT_STD template _NODISCARD _CONSTEXPR20 pair<_FwdIt, _FwdIt> equal_range(_FwdIt _First, _FwdIt _Last, const _Ty& _Val, _Pr _Pred) { // find range equivalent to _Val _Adl_verify_range(_First, _Last); @@ -6623,7 +6628,7 @@ _NODISCARD _CONSTEXPR20 pair<_FwdIt, _FwdIt> equal_range(_FwdIt _First, _FwdIt _ return {_First, _Last}; } -template +_EXPORT_STD template _NODISCARD _CONSTEXPR20 pair<_FwdIt, _FwdIt> equal_range(_FwdIt _First, _FwdIt _Last, const _Ty& _Val) { // find range equivalent to _Val return _STD equal_range(_First, _Last, _Val, less<>{}); @@ -6688,11 +6693,11 @@ namespace ranges { } }; - inline constexpr _Equal_range_fn equal_range{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Equal_range_fn equal_range{_Not_quite_object::_Construct_tag{}}; } // namespace ranges #endif // __cpp_lib_concepts -template +_EXPORT_STD template _NODISCARD _CONSTEXPR20 bool binary_search(_FwdIt _First, _FwdIt _Last, const _Ty& _Val, _Pr _Pred) { // test if _Val equivalent to some element _Adl_verify_range(_First, _Last); @@ -6702,7 +6707,7 @@ _NODISCARD _CONSTEXPR20 bool binary_search(_FwdIt _First, _FwdIt _Last, const _T return _UFirst != _ULast && !_Pred(_Val, *_UFirst); } -template +_EXPORT_STD template _NODISCARD _CONSTEXPR20 bool binary_search(_FwdIt _First, _FwdIt _Last, const _Ty& _Val) { // test if _Val equivalent to some element return _STD binary_search(_First, _Last, _Val, less<>{}); @@ -6737,7 +6742,7 @@ namespace ranges { } }; - inline constexpr _Binary_search_fn binary_search{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Binary_search_fn binary_search{_Not_quite_object::_Construct_tag{}}; } // namespace ranges #endif // __cpp_lib_concepts @@ -6760,7 +6765,7 @@ _NODISCARD constexpr auto _Idl_dist_add(_Diff1 _Lhs, _Diff2 _Rhs) { return _Lhs + _Rhs; } -template +_EXPORT_STD template _CONSTEXPR20 _OutIt merge(_InIt1 _First1, _InIt1 _Last1, _InIt2 _First2, _InIt2 _Last2, _OutIt _Dest, _Pr _Pred) { // copy merging ranges _Adl_verify_range(_First1, _Last1); @@ -6801,14 +6806,15 @@ _CONSTEXPR20 _OutIt merge(_InIt1 _First1, _InIt1 _Last1, _InIt2 _First2, _InIt2 return _Dest; } -template +_EXPORT_STD template _CONSTEXPR20 _OutIt merge(_InIt1 _First1, _InIt1 _Last1, _InIt2 _First2, _InIt2 _Last2, _OutIt _Dest) { // copy merging ranges return _STD merge(_First1, _Last1, _First2, _Last2, _Dest, less<>{}); } #if _HAS_CXX17 -template = 0> +_EXPORT_STD template = 0> _FwdIt3 merge(_ExPo&&, _FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _First2, _FwdIt2 _Last2, _FwdIt3 _Dest, _Pr _Pred) noexcept /* terminates */ { // copy merging ranges @@ -6819,7 +6825,8 @@ _FwdIt3 merge(_ExPo&&, _FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _First2, _FwdIt2 return _STD merge(_First1, _Last1, _First2, _Last2, _Dest, _Pass_fn(_Pred)); } -template = 0> +_EXPORT_STD template = 0> _FwdIt3 merge(_ExPo&&, _FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _First2, _FwdIt2 _Last2, _FwdIt3 _Dest) noexcept /* terminates */ { // copy merging ranges @@ -6832,7 +6839,7 @@ _FwdIt3 merge(_ExPo&&, _FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _First2, _FwdIt2 #ifdef __cpp_lib_concepts namespace ranges { - template + _EXPORT_STD template using merge_result = in_in_out_result<_In1, _In2, _Out>; class _Merge_fn : private _Not_quite_object { @@ -6905,7 +6912,7 @@ namespace ranges { } }; - inline constexpr _Merge_fn merge{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Merge_fn merge{_Not_quite_object::_Construct_tag{}}; } // namespace ranges #endif // __cpp_lib_concepts #endif // _HAS_CXX17 @@ -7100,7 +7107,7 @@ void _Buffered_inplace_merge_unchecked(_BidIt _First, _BidIt _Mid, _BidIt _Last, _Buffered_inplace_merge_unchecked_impl(_First, _Mid, _Last, _Count1, _Count2, _Temp_ptr, _Capacity, _Pred); } -template +_EXPORT_STD template void inplace_merge(_BidIt _First, _BidIt _Mid, _BidIt _Last, _Pr _Pred) { // merge [_First, _Mid) with [_Mid, _Last) _Adl_verify_range(_First, _Mid); @@ -7151,21 +7158,21 @@ void inplace_merge(_BidIt _First, _BidIt _Mid, _BidIt _Last, _Pr _Pred) { _UFirst, _UMid, _ULast, _Count1, _Count2, _Temp_buf._Data, _Temp_buf._Capacity, _Pass_fn(_Pred)); } -template +_EXPORT_STD template void inplace_merge(_BidIt _First, _BidIt _Mid, _BidIt _Last) { // merge [_First, _Mid) with [_Mid, _Last) _STD inplace_merge(_First, _Mid, _Last, less<>{}); } #if _HAS_CXX17 -template = 0> +_EXPORT_STD template = 0> void inplace_merge(_ExPo&&, _BidIt _First, _BidIt _Mid, _BidIt _Last, _Pr _Pred) noexcept /* terminates */ { // merge [_First, _Mid) with [_Mid, _Last) // not parallelized at present, parallelism expected to be feasible in a future release _STD inplace_merge(_First, _Mid, _Last, _Pass_fn(_Pred)); } -template = 0> +_EXPORT_STD template = 0> void inplace_merge(_ExPo&&, _BidIt _First, _BidIt _Mid, _BidIt _Last) noexcept /* terminates */ { // merge [_First, _Mid) with [_Mid, _Last) // not parallelized at present, parallelism expected to be feasible in a future release @@ -7497,7 +7504,7 @@ namespace ranges { } }; - inline constexpr _Inplace_merge_fn inplace_merge{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Inplace_merge_fn inplace_merge{_Not_quite_object::_Construct_tag{}}; } // namespace ranges #endif // __cpp_lib_concepts @@ -7658,7 +7665,7 @@ _CONSTEXPR20 void _Sort_unchecked(_RanIt _First, _RanIt _Last, _Iter_diff_t<_Ran } } -template +_EXPORT_STD template _CONSTEXPR20 void sort(const _RanIt _First, const _RanIt _Last, _Pr _Pred) { // order [_First, _Last) _Adl_verify_range(_First, _Last); const auto _UFirst = _Get_unwrapped(_First); @@ -7666,16 +7673,16 @@ _CONSTEXPR20 void sort(const _RanIt _First, const _RanIt _Last, _Pr _Pred) { // _Sort_unchecked(_UFirst, _ULast, _ULast - _UFirst, _Pass_fn(_Pred)); } -template +_EXPORT_STD template _CONSTEXPR20 void sort(const _RanIt _First, const _RanIt _Last) { // order [_First, _Last) _STD sort(_First, _Last, less<>{}); } #if _HAS_CXX17 -template = 0> +_EXPORT_STD template = 0> void sort(_ExPo&& _Exec, _RanIt _First, _RanIt _Last, _Pr _Pred) noexcept; // terminates -template = 0> +_EXPORT_STD template = 0> void sort(_ExPo&& _Exec, const _RanIt _First, const _RanIt _Last) noexcept /* terminates */ { // order [_First, _Last) _STD sort(_STD forward<_ExPo>(_Exec), _First, _Last, less{}); @@ -7897,7 +7904,7 @@ namespace ranges { } }; - inline constexpr _Sort_fn sort{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Sort_fn sort{_Not_quite_object::_Construct_tag{}}; } // namespace ranges #endif // __cpp_lib_concepts @@ -8060,7 +8067,7 @@ void _Stable_sort_unchecked(const _BidIt _First, const _BidIt _Last, const _Iter } } -template +_EXPORT_STD template void stable_sort(const _BidIt _First, const _BidIt _Last, _Pr _Pred) { // sort preserving order of equivalents _Adl_verify_range(_First, _Last); @@ -8077,17 +8084,17 @@ void stable_sort(const _BidIt _First, const _BidIt _Last, _Pr _Pred) { } #if _HAS_CXX17 -template = 0> +_EXPORT_STD template = 0> void stable_sort(_ExPo&& _Exec, const _BidIt _First, const _BidIt _Last, _Pr _Pred) noexcept; // terminates #endif // _HAS_CXX17 -template +_EXPORT_STD template void stable_sort(const _BidIt _First, const _BidIt _Last) { // sort preserving order of equivalents _STD stable_sort(_First, _Last, less<>{}); } #if _HAS_CXX17 -template = 0> +_EXPORT_STD template = 0> void stable_sort(_ExPo&& _Exec, _BidIt _First, _BidIt _Last) noexcept /* terminates */ { // sort preserving order of equivalents _STD stable_sort(_STD forward<_ExPo>(_Exec), _First, _Last, less{}); @@ -8347,11 +8354,11 @@ namespace ranges { } }; - inline constexpr _Stable_sort_fn stable_sort{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Stable_sort_fn stable_sort{_Not_quite_object::_Construct_tag{}}; } // namespace ranges #endif // __cpp_lib_concepts -template +_EXPORT_STD template _CONSTEXPR20 void partial_sort(_RanIt _First, _RanIt _Mid, _RanIt _Last, _Pr _Pred) { // order [_First, _Last) up to _Mid _Adl_verify_range(_First, _Mid); @@ -8375,21 +8382,21 @@ _CONSTEXPR20 void partial_sort(_RanIt _First, _RanIt _Mid, _RanIt _Last, _Pr _Pr _Sort_heap_unchecked(_UFirst, _UMid, _Pass_fn(_Pred)); } -template +_EXPORT_STD template _CONSTEXPR20 void partial_sort(_RanIt _First, _RanIt _Mid, _RanIt _Last) { // order [_First, _Last) up to _Mid _STD partial_sort(_First, _Mid, _Last, less<>{}); } #if _HAS_CXX17 -template = 0> +_EXPORT_STD template = 0> void partial_sort(_ExPo&&, _RanIt _First, _RanIt _Mid, _RanIt _Last, _Pr _Pred) noexcept /* terminates */ { // order [_First, _Last) up to _Mid // parallelism suspected to be infeasible return _STD partial_sort(_First, _Mid, _Last, _Pass_fn(_Pred)); } -template = 0> +_EXPORT_STD template = 0> void partial_sort(_ExPo&&, _RanIt _First, _RanIt _Mid, _RanIt _Last) noexcept /* terminates */ { // order [_First, _Last) up to _Mid // parallelism suspected to be infeasible @@ -8466,12 +8473,12 @@ namespace ranges { } }; - inline constexpr _Partial_sort_fn partial_sort{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Partial_sort_fn partial_sort{_Not_quite_object::_Construct_tag{}}; } // namespace ranges #endif // __cpp_lib_concepts #endif // _HAS_CXX17 -template +_EXPORT_STD template _CONSTEXPR20 _RanIt partial_sort_copy(_InIt _First1, _InIt _Last1, _RanIt _First2, _RanIt _Last2, _Pr _Pred) { // copy [_First1, _Last1) into [_First2, _Last2) _Adl_verify_range(_First1, _Last1); @@ -8503,14 +8510,14 @@ _CONSTEXPR20 _RanIt partial_sort_copy(_InIt _First1, _InIt _Last1, _RanIt _First return _First2; } -template +_EXPORT_STD template _CONSTEXPR20 _RanIt partial_sort_copy(_InIt _First1, _InIt _Last1, _RanIt _First2, _RanIt _Last2) { // copy [_First1, _Last1) into [_First2, _Last2) return _STD partial_sort_copy(_First1, _Last1, _First2, _Last2, less<>{}); } #if _HAS_CXX17 -template = 0> +_EXPORT_STD template = 0> _RanIt partial_sort_copy(_ExPo&&, _FwdIt _First1, _FwdIt _Last1, _RanIt _First2, _RanIt _Last2, _Pr _Pred) noexcept /* terminates */ { // copy [_First1, _Last1) into [_First2, _Last2) @@ -8520,7 +8527,7 @@ _RanIt partial_sort_copy(_ExPo&&, _FwdIt _First1, _FwdIt _Last1, _RanIt _First2, return _STD partial_sort_copy(_First1, _Last1, _First2, _Last2, _Pass_fn(_Pred)); } -template = 0> +_EXPORT_STD template = 0> _RanIt partial_sort_copy(_ExPo&&, _FwdIt _First1, _FwdIt _Last1, _RanIt _First2, _RanIt _Last2) noexcept /* terminates */ { // copy [_First1, _Last1) into [_First2, _Last2) @@ -8532,7 +8539,7 @@ _RanIt partial_sort_copy(_ExPo&&, _FwdIt _First1, _FwdIt _Last1, _RanIt _First2, #ifdef __cpp_lib_concepts namespace ranges { - template + _EXPORT_STD template using partial_sort_copy_result = in_out_result<_In, _Out>; class _Partial_sort_copy_fn : private _Not_quite_object { @@ -8620,12 +8627,12 @@ namespace ranges { } }; - inline constexpr _Partial_sort_copy_fn partial_sort_copy{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Partial_sort_copy_fn partial_sort_copy{_Not_quite_object::_Construct_tag{}}; } // namespace ranges #endif // __cpp_lib_concepts #endif // _HAS_CXX17 -template +_EXPORT_STD template _CONSTEXPR20 void nth_element(_RanIt _First, _RanIt _Nth, _RanIt _Last, _Pr _Pred) { // order Nth element _Adl_verify_range(_First, _Nth); @@ -8652,20 +8659,20 @@ _CONSTEXPR20 void nth_element(_RanIt _First, _RanIt _Nth, _RanIt _Last, _Pr _Pre _Insertion_sort_unchecked(_UFirst, _ULast, _Pass_fn(_Pred)); // sort any remainder } -template +_EXPORT_STD template _CONSTEXPR20 void nth_element(_RanIt _First, _RanIt _Nth, _RanIt _Last) { // order Nth element _STD nth_element(_First, _Nth, _Last, less<>{}); } #if _HAS_CXX17 -template = 0> +_EXPORT_STD template = 0> void nth_element(_ExPo&&, _RanIt _First, _RanIt _Nth, _RanIt _Last, _Pr _Pred) noexcept /* terminates */ { // order Nth element // not parallelized at present, parallelism expected to be feasible in a future release _STD nth_element(_First, _Nth, _Last, _Pass_fn(_Pred)); } -template = 0> +_EXPORT_STD template = 0> void nth_element(_ExPo&&, _RanIt _First, _RanIt _Nth, _RanIt _Last) noexcept /* terminates */ { // order Nth element // not parallelized at present, parallelism expected to be feasible in a future release @@ -8742,12 +8749,12 @@ namespace ranges { } }; - inline constexpr _Nth_element_fn nth_element{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Nth_element_fn nth_element{_Not_quite_object::_Construct_tag{}}; } // namespace ranges #endif // __cpp_lib_concepts #endif // _HAS_CXX17 -template +_EXPORT_STD template _NODISCARD _CONSTEXPR20 bool includes(_InIt1 _First1, _InIt1 _Last1, _InIt2 _First2, _InIt2 _Last2, _Pr _Pred) { // test if every element in sorted [_First2, _Last2) is in sorted [_First1, _Last1) _Adl_verify_range(_First1, _Last1); @@ -8771,14 +8778,14 @@ _NODISCARD _CONSTEXPR20 bool includes(_InIt1 _First1, _InIt1 _Last1, _InIt2 _Fir return _UFirst2 == _ULast2; } -template +_EXPORT_STD template _NODISCARD _CONSTEXPR20 bool includes(_InIt1 _First1, _InIt1 _Last1, _InIt2 _First2, _InIt2 _Last2) { // test if every element in sorted [_First2, _Last2) is in sorted [_First1, _Last1) return _STD includes(_First1, _Last1, _First2, _Last2, less<>{}); } #if _HAS_CXX17 -template = 0> +_EXPORT_STD template = 0> _NODISCARD bool includes(_ExPo&&, _FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _First2, _FwdIt2 _Last2, _Pr _Pred) noexcept /* terminates */ { // test if every element in sorted [_First2, _Last2) is in sorted [_First1, _Last1) @@ -8788,7 +8795,7 @@ _NODISCARD bool includes(_ExPo&&, _FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _Firs return _STD includes(_First1, _Last1, _First2, _Last2, _Pass_fn(_Pred)); } -template = 0> +_EXPORT_STD template = 0> _NODISCARD bool includes(_ExPo&&, _FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _First2, _FwdIt2 _Last2) noexcept /* terminates */ { // test if every element in sorted [_First2, _Last2) is in sorted [_First1, _Last1) @@ -8866,12 +8873,12 @@ namespace ranges { } }; - inline constexpr _Includes_fn includes{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Includes_fn includes{_Not_quite_object::_Construct_tag{}}; } // namespace ranges #endif // __cpp_lib_concepts #endif // _HAS_CXX17 -template +_EXPORT_STD template _CONSTEXPR20 _OutIt set_union(_InIt1 _First1, _InIt1 _Last1, _InIt2 _First2, _InIt2 _Last2, _OutIt _Dest, _Pr _Pred) { // OR sets [_First1, _Last1) and [_First2, _Last2) _Adl_verify_range(_First1, _Last1); @@ -8902,14 +8909,15 @@ _CONSTEXPR20 _OutIt set_union(_InIt1 _First1, _InIt1 _Last1, _InIt2 _First2, _In return _Dest; } -template +_EXPORT_STD template _CONSTEXPR20 _OutIt set_union(_InIt1 _First1, _InIt1 _Last1, _InIt2 _First2, _InIt2 _Last2, _OutIt _Dest) { // OR sets [_First1, _Last1) and [_First2, _Last2) return _STD set_union(_First1, _Last1, _First2, _Last2, _Dest, less<>{}); } #if _HAS_CXX17 -template = 0> +_EXPORT_STD template = 0> _FwdIt3 set_union(_ExPo&&, _FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _First2, _FwdIt2 _Last2, _FwdIt3 _Dest, _Pr _Pred) noexcept /* terminates */ { // OR sets [_First1, _Last1) and [_First2, _Last2) @@ -8920,7 +8928,8 @@ _FwdIt3 set_union(_ExPo&&, _FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _First2, _Fw return _STD set_union(_First1, _Last1, _First2, _Last2, _Dest, _Pass_fn(_Pred)); } -template = 0> +_EXPORT_STD template = 0> _FwdIt3 set_union(_ExPo&&, _FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _First2, _FwdIt2 _Last2, _FwdIt3 _Dest) noexcept /* terminates */ { // OR sets [_First1, _Last1) and [_First2, _Last2) @@ -8933,7 +8942,7 @@ _FwdIt3 set_union(_ExPo&&, _FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _First2, _Fw #ifdef __cpp_lib_concepts namespace ranges { - template + _EXPORT_STD template using set_union_result = in_in_out_result<_In1, _In2, _Out>; class _Set_union_fn : private _Not_quite_object { @@ -9003,12 +9012,12 @@ namespace ranges { } }; - inline constexpr _Set_union_fn set_union{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Set_union_fn set_union{_Not_quite_object::_Construct_tag{}}; } // namespace ranges #endif // __cpp_lib_concepts #endif // _HAS_CXX17 -template +_EXPORT_STD template _CONSTEXPR20 _OutIt set_intersection( _InIt1 _First1, _InIt1 _Last1, _InIt2 _First2, _InIt2 _Last2, _OutIt _Dest, _Pr _Pred) { // AND sets [_First1, _Last1) and [_First2, _Last2) @@ -9038,18 +9047,20 @@ _CONSTEXPR20 _OutIt set_intersection( return _Dest; } -template +_EXPORT_STD template _CONSTEXPR20 _OutIt set_intersection(_InIt1 _First1, _InIt1 _Last1, _InIt2 _First2, _InIt2 _Last2, _OutIt _Dest) { // AND sets [_First1, _Last1) and [_First2, _Last2) return _STD set_intersection(_First1, _Last1, _First2, _Last2, _Dest, less<>{}); } #if _HAS_CXX17 -template = 0> +_EXPORT_STD template = 0> _FwdIt3 set_intersection(_ExPo&&, _FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _First2, _FwdIt2 _Last2, _FwdIt3 _Dest, _Pr _Pred) noexcept; // terminates -template = 0> +_EXPORT_STD template = 0> _FwdIt3 set_intersection(_ExPo&& _Exec, _FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _First2, _FwdIt2 _Last2, _FwdIt3 _Dest) noexcept /* terminates */ { // AND sets [_First1, _Last1) and [_First2, _Last2) @@ -9058,7 +9069,7 @@ _FwdIt3 set_intersection(_ExPo&& _Exec, _FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 #ifdef __cpp_lib_concepts namespace ranges { - template + _EXPORT_STD template using set_intersection_result = in_in_out_result<_In1, _In2, _Out>; class _Set_intersection_fn : private _Not_quite_object { @@ -9134,12 +9145,12 @@ namespace ranges { } }; - inline constexpr _Set_intersection_fn set_intersection{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Set_intersection_fn set_intersection{_Not_quite_object::_Construct_tag{}}; } // namespace ranges #endif // __cpp_lib_concepts #endif // _HAS_CXX17 -template +_EXPORT_STD template _CONSTEXPR20 _OutIt set_difference( _InIt1 _First1, _InIt1 _Last1, _InIt2 _First2, _InIt2 _Last2, _OutIt _Dest, _Pr _Pred) { // take set [_First2, _Last2) from [_First1, _Last1) @@ -9170,18 +9181,20 @@ _CONSTEXPR20 _OutIt set_difference( return _Dest; } -template +_EXPORT_STD template _CONSTEXPR20 _OutIt set_difference(_InIt1 _First1, _InIt1 _Last1, _InIt2 _First2, _InIt2 _Last2, _OutIt _Dest) { // take set [_First2, _Last2) from [_First1, _Last1) return _STD set_difference(_First1, _Last1, _First2, _Last2, _Dest, less<>{}); } #if _HAS_CXX17 -template = 0> +_EXPORT_STD template = 0> _FwdIt3 set_difference(_ExPo&&, _FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _First2, _FwdIt2 _Last2, _FwdIt3 _Dest, _Pr _Pred) noexcept; // terminates -template = 0> +_EXPORT_STD template = 0> _FwdIt3 set_difference(_ExPo&& _Exec, _FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _First2, _FwdIt2 _Last2, _FwdIt3 _Dest) noexcept /* terminates */ { // take set [_First2, _Last2) from [_First1, _Last1) @@ -9190,7 +9203,7 @@ _FwdIt3 set_difference(_ExPo&& _Exec, _FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _ #ifdef __cpp_lib_concepts namespace ranges { - template + _EXPORT_STD template using set_difference_result = in_out_result<_In, _Out>; class _Set_difference_fn : private _Not_quite_object { @@ -9262,12 +9275,12 @@ namespace ranges { } }; - inline constexpr _Set_difference_fn set_difference{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Set_difference_fn set_difference{_Not_quite_object::_Construct_tag{}}; } // namespace ranges #endif // __cpp_lib_concepts #endif // _HAS_CXX17 -template +_EXPORT_STD template _CONSTEXPR20 _OutIt set_symmetric_difference( _InIt1 _First1, _InIt1 _Last1, _InIt2 _First2, _InIt2 _Last2, _OutIt _Dest, _Pr _Pred) { // XOR sets [_First1, _Last1) and [_First2, _Last2) @@ -9300,7 +9313,7 @@ _CONSTEXPR20 _OutIt set_symmetric_difference( return _Dest; } -template +_EXPORT_STD template _CONSTEXPR20 _OutIt set_symmetric_difference( _InIt1 _First1, _InIt1 _Last1, _InIt2 _First2, _InIt2 _Last2, _OutIt _Dest) { // XOR sets [_First1, _Last1) and [_First2, _Last2) @@ -9308,7 +9321,8 @@ _CONSTEXPR20 _OutIt set_symmetric_difference( } #if _HAS_CXX17 -template = 0> +_EXPORT_STD template = 0> _FwdIt3 set_symmetric_difference(_ExPo&&, _FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _First2, _FwdIt2 _Last2, _FwdIt3 _Dest, _Pr _Pred) noexcept /* terminates */ { // XOR sets [_First1, _Last1) and [_First2, _Last2) @@ -9319,7 +9333,8 @@ _FwdIt3 set_symmetric_difference(_ExPo&&, _FwdIt1 _First1, _FwdIt1 _Last1, _FwdI return _STD set_symmetric_difference(_First1, _Last1, _First2, _Last2, _Dest, _Pass_fn(_Pred)); } -template = 0> +_EXPORT_STD template = 0> _FwdIt3 set_symmetric_difference(_ExPo&&, _FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _First2, _FwdIt2 _Last2, _FwdIt3 _Dest) noexcept /* terminates */ { // XOR sets [_First1, _Last1) and [_First2, _Last2) @@ -9332,7 +9347,7 @@ _FwdIt3 set_symmetric_difference(_ExPo&&, _FwdIt1 _First1, _FwdIt1 _Last1, _FwdI #ifdef __cpp_lib_concepts namespace ranges { - template + _EXPORT_STD template using set_symmetric_difference_result = in_in_out_result<_In1, _In2, _Out>; class _Set_symmetric_difference_fn : private _Not_quite_object { @@ -9412,7 +9427,8 @@ namespace ranges { } }; - inline constexpr _Set_symmetric_difference_fn set_symmetric_difference{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Set_symmetric_difference_fn set_symmetric_difference{ + _Not_quite_object::_Construct_tag{}}; } // namespace ranges #endif // __cpp_lib_concepts #endif // _HAS_CXX17 @@ -9456,27 +9472,27 @@ constexpr _FwdIt _Max_element_unchecked(_FwdIt _First, _FwdIt _Last, _Pr _Pred) return _Found; } -template +_EXPORT_STD template _NODISCARD constexpr _FwdIt max_element(_FwdIt _First, _FwdIt _Last, _Pr _Pred) { // find largest element _Adl_verify_range(_First, _Last); _Seek_wrapped(_First, _Max_element_unchecked(_Get_unwrapped(_First), _Get_unwrapped(_Last), _Pass_fn(_Pred))); return _First; } -template +_EXPORT_STD template _NODISCARD constexpr _FwdIt max_element(_FwdIt _First, _FwdIt _Last) { // find largest element return _STD max_element(_First, _Last, less<>{}); } #if _HAS_CXX17 -template = 0> +_EXPORT_STD template = 0> _NODISCARD _FwdIt max_element(_ExPo&&, _FwdIt _First, _FwdIt _Last, _Pr _Pred) noexcept /* terminates */ { // find largest element // not parallelized at present, parallelism expected to be feasible in a future release return _STD max_element(_First, _Last, _Pass_fn(_Pred)); } -template = 0> +_EXPORT_STD template = 0> _NODISCARD _FwdIt max_element(_ExPo&&, _FwdIt _First, _FwdIt _Last) noexcept /* terminates */ { // find largest element // not parallelized at present, parallelism expected to be feasible in a future release @@ -9544,7 +9560,7 @@ namespace ranges { } }; - inline constexpr _Max_element_fn max_element{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Max_element_fn max_element{_Not_quite_object::_Construct_tag{}}; } // namespace ranges #endif // __cpp_lib_concepts #endif // _HAS_CXX17 @@ -9577,27 +9593,27 @@ constexpr _FwdIt _Min_element_unchecked(_FwdIt _First, _FwdIt _Last, _Pr _Pred) return _Found; } -template +_EXPORT_STD template _NODISCARD constexpr _FwdIt min_element(_FwdIt _First, _FwdIt _Last, _Pr _Pred) { // find smallest element _Adl_verify_range(_First, _Last); _Seek_wrapped(_First, _Min_element_unchecked(_Get_unwrapped(_First), _Get_unwrapped(_Last), _Pass_fn(_Pred))); return _First; } -template +_EXPORT_STD template _NODISCARD constexpr _FwdIt min_element(_FwdIt _First, _FwdIt _Last) { // find smallest element return _STD min_element(_First, _Last, less<>{}); } #if _HAS_CXX17 -template = 0> +_EXPORT_STD template = 0> _NODISCARD _FwdIt min_element(_ExPo&&, _FwdIt _First, _FwdIt _Last, _Pr _Pred) noexcept /* terminates */ { // find smallest element // not parallelized at present, parallelism expected to be feasible in a future release return _STD min_element(_First, _Last, _Pass_fn(_Pred)); } -template = 0> +_EXPORT_STD template = 0> _NODISCARD _FwdIt min_element(_ExPo&&, _FwdIt _First, _FwdIt _Last) noexcept /* terminates */ { // find smallest element // not parallelized at present, parallelism expected to be feasible in a future release @@ -9665,7 +9681,7 @@ namespace ranges { } }; - inline constexpr _Min_element_fn min_element{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Min_element_fn min_element{_Not_quite_object::_Construct_tag{}}; } // namespace ranges #endif // __cpp_lib_concepts #endif // _HAS_CXX17 @@ -9724,7 +9740,7 @@ constexpr pair<_FwdIt, _FwdIt> _Minmax_element_unchecked(_FwdIt _First, _FwdIt _ return _Found; } -template +_EXPORT_STD template _NODISCARD constexpr pair<_FwdIt, _FwdIt> minmax_element(_FwdIt _First, _FwdIt _Last, _Pr _Pred) { // find smallest and largest elements _Adl_verify_range(_First, _Last); @@ -9734,14 +9750,14 @@ _NODISCARD constexpr pair<_FwdIt, _FwdIt> minmax_element(_FwdIt _First, _FwdIt _ return {_First, _Last}; } -template +_EXPORT_STD template _NODISCARD constexpr pair<_FwdIt, _FwdIt> minmax_element(_FwdIt _First, _FwdIt _Last) { // find smallest and largest elements return _STD minmax_element(_First, _Last, less<>{}); } #if _HAS_CXX17 -template = 0> +_EXPORT_STD template = 0> _NODISCARD pair<_FwdIt, _FwdIt> minmax_element(_ExPo&&, _FwdIt _First, _FwdIt _Last, _Pr _Pred) noexcept /* terminates */ { // find smallest and largest elements @@ -9749,7 +9765,7 @@ _NODISCARD pair<_FwdIt, _FwdIt> minmax_element(_ExPo&&, _FwdIt _First, _FwdIt _L return _STD minmax_element(_First, _Last, _Pass_fn(_Pred)); } -template = 0> +_EXPORT_STD template = 0> _NODISCARD pair<_FwdIt, _FwdIt> minmax_element(_ExPo&&, _FwdIt _First, _FwdIt _Last) noexcept /* terminates */ { // find smallest and largest elements // not parallelized at present, parallelism expected to be feasible in a future release @@ -9758,7 +9774,7 @@ _NODISCARD pair<_FwdIt, _FwdIt> minmax_element(_ExPo&&, _FwdIt _First, _FwdIt _L #ifdef __cpp_lib_concepts namespace ranges { - template + _EXPORT_STD template using minmax_element_result = min_max_result<_Ty>; template @@ -9856,19 +9872,19 @@ namespace ranges { } }; - inline constexpr _Minmax_element_fn minmax_element{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Minmax_element_fn minmax_element{_Not_quite_object::_Construct_tag{}}; } // namespace ranges #endif // __cpp_lib_concepts #endif // _HAS_CXX17 -template +_EXPORT_STD template _NODISCARD constexpr _Ty(max)(initializer_list<_Ty> _Ilist, _Pr _Pred) { // return leftmost/largest const _Ty* _Res = _Max_element_unchecked(_Ilist.begin(), _Ilist.end(), _Pass_fn(_Pred)); return *_Res; } -template +_EXPORT_STD template _NODISCARD constexpr _Ty(max)(initializer_list<_Ty> _Ilist) { // return leftmost/largest return (_STD max)(_Ilist, less<>{}); @@ -9933,18 +9949,18 @@ namespace ranges { // clang-format on }; - inline constexpr _Max_fn max{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Max_fn max{_Not_quite_object::_Construct_tag{}}; } // namespace ranges #endif // __cpp_lib_concepts -template +_EXPORT_STD template _NODISCARD constexpr _Ty(min)(initializer_list<_Ty> _Ilist, _Pr _Pred) { // return leftmost/smallest const _Ty* _Res = _Min_element_unchecked(_Ilist.begin(), _Ilist.end(), _Pass_fn(_Pred)); return *_Res; } -template +_EXPORT_STD template _NODISCARD constexpr _Ty(min)(initializer_list<_Ty> _Ilist) { // return leftmost/smallest return (_STD min)(_Ilist, less<>{}); @@ -10003,11 +10019,11 @@ namespace ranges { // clang-format on }; - inline constexpr _Min_fn min{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Min_fn min{_Not_quite_object::_Construct_tag{}}; } // namespace ranges #endif // __cpp_lib_concepts -template +_EXPORT_STD template _NODISCARD constexpr pair minmax(const _Ty& _Left, const _Ty& _Right, _Pr _Pred) noexcept( noexcept(_DEBUG_LT_PRED(_Pred, _Right, _Left))) /* strengthened */ { // return pair(leftmost/smaller, rightmost/larger) of _Left and _Right @@ -10018,14 +10034,14 @@ _NODISCARD constexpr pair minmax(const _Ty& _Left, const return {_Left, _Right}; } -template +_EXPORT_STD template _NODISCARD constexpr pair<_Ty, _Ty> minmax(initializer_list<_Ty> _Ilist, _Pr _Pred) { // return {leftmost/smallest, rightmost/largest} pair _Res = _Minmax_element_unchecked(_Ilist.begin(), _Ilist.end(), _Pass_fn(_Pred)); return pair<_Ty, _Ty>(*_Res.first, *_Res.second); } -template +_EXPORT_STD template _NODISCARD constexpr pair minmax(const _Ty& _Left, const _Ty& _Right) noexcept( noexcept(_Right < _Left)) /* strengthened */ { // return pair(leftmost/smaller, rightmost/larger) of _Left and _Right @@ -10037,7 +10053,7 @@ _NODISCARD constexpr pair minmax(const _Ty& _Left, const return {_Left, _Right}; } -template +_EXPORT_STD template _NODISCARD constexpr pair<_Ty, _Ty> minmax(initializer_list<_Ty> _Ilist) { // return {leftmost/smallest, rightmost/largest} return _STD minmax(_Ilist, less<>{}); @@ -10045,7 +10061,7 @@ _NODISCARD constexpr pair<_Ty, _Ty> minmax(initializer_list<_Ty> _Ilist) { #ifdef __cpp_lib_concepts namespace ranges { - template + _EXPORT_STD template using minmax_result = min_max_result<_Ty>; class _Minmax_fn : private _Not_quite_object { @@ -10135,11 +10151,11 @@ namespace ranges { } }; - inline constexpr _Minmax_fn minmax{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Minmax_fn minmax{_Not_quite_object::_Construct_tag{}}; } // namespace ranges #endif // __cpp_lib_concepts -template +_EXPORT_STD template _CONSTEXPR20 bool next_permutation(_BidIt _First, _BidIt _Last, _Pr _Pred) { // permute and test for pure ascending _Adl_verify_range(_First, _Last); @@ -10170,7 +10186,7 @@ _CONSTEXPR20 bool next_permutation(_BidIt _First, _BidIt _Last, _Pr _Pred) { } } -template +_EXPORT_STD template _CONSTEXPR20 bool next_permutation(_BidIt _First, _BidIt _Last) { // permute and test for pure ascending return _STD next_permutation(_First, _Last, less<>{}); @@ -10178,7 +10194,7 @@ _CONSTEXPR20 bool next_permutation(_BidIt _First, _BidIt _Last) { #ifdef __cpp_lib_concepts namespace ranges { - template + _EXPORT_STD template using next_permutation_result = in_found_result<_In>; class _Next_permutation_fn : private _Not_quite_object { @@ -10239,11 +10255,11 @@ namespace ranges { } }; - inline constexpr _Next_permutation_fn next_permutation{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Next_permutation_fn next_permutation{_Not_quite_object::_Construct_tag{}}; } // namespace ranges #endif // __cpp_lib_concepts -template +_EXPORT_STD template _CONSTEXPR20 bool prev_permutation(_BidIt _First, _BidIt _Last, _Pr _Pred) { // reverse permute and test for pure descending _Adl_verify_range(_First, _Last); @@ -10274,7 +10290,7 @@ _CONSTEXPR20 bool prev_permutation(_BidIt _First, _BidIt _Last, _Pr _Pred) { } } -template +_EXPORT_STD template _CONSTEXPR20 bool prev_permutation(_BidIt _First, _BidIt _Last) { // reverse permute and test for pure descending return _STD prev_permutation(_First, _Last, less<>{}); @@ -10282,7 +10298,7 @@ _CONSTEXPR20 bool prev_permutation(_BidIt _First, _BidIt _Last) { #ifdef __cpp_lib_concepts namespace ranges { - template + _EXPORT_STD template using prev_permutation_result = in_found_result<_In>; class _Prev_permutation_fn : private _Not_quite_object { @@ -10343,11 +10359,11 @@ namespace ranges { } }; - inline constexpr _Prev_permutation_fn prev_permutation{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Prev_permutation_fn prev_permutation{_Not_quite_object::_Construct_tag{}}; } // namespace ranges #endif // __cpp_lib_concepts -template +_EXPORT_STD template _NODISCARD _CONSTEXPR20 _FwdIt is_sorted_until(const _FwdIt _First, _FwdIt _Last, _Pr _Pred) { // find extent of range that is ordered by predicate _Adl_verify_range(_First, _Last); @@ -10366,7 +10382,7 @@ _NODISCARD _CONSTEXPR20 _FwdIt is_sorted_until(const _FwdIt _First, _FwdIt _Last return _Last; } -template +_EXPORT_STD template _NODISCARD _CONSTEXPR20 bool is_sorted(_FwdIt _First, _FwdIt _Last, _Pr _Pred) { // test if range is ordered by predicate _Adl_verify_range(_First, _Last); @@ -10375,34 +10391,34 @@ _NODISCARD _CONSTEXPR20 bool is_sorted(_FwdIt _First, _FwdIt _Last, _Pr _Pred) { return _STD is_sorted_until(_UFirst, _ULast, _Pass_fn(_Pred)) == _ULast; } -template +_EXPORT_STD template _NODISCARD _CONSTEXPR20 _FwdIt is_sorted_until(_FwdIt _First, _FwdIt _Last) { // find extent of range that is ordered by operator< return _STD is_sorted_until(_First, _Last, less<>{}); } -template +_EXPORT_STD template _NODISCARD _CONSTEXPR20 bool is_sorted(_FwdIt _First, _FwdIt _Last) { // test if range is ordered by operator< return _STD is_sorted(_First, _Last, less<>{}); } #if _HAS_CXX17 -template = 0> +_EXPORT_STD template = 0> _NODISCARD _FwdIt is_sorted_until(_ExPo&&, _FwdIt _First, _FwdIt _Last, _Pr _Pred) noexcept; // terminates -template = 0> +_EXPORT_STD template = 0> _NODISCARD bool is_sorted(_ExPo&& _Exec, _FwdIt _First, _FwdIt _Last, _Pr _Pred) noexcept /* terminates */ { // test if range is ordered by predicate return _STD is_sorted_until(_STD forward<_ExPo>(_Exec), _First, _Last, _Pass_fn(_Pred)) == _Last; } -template = 0> +_EXPORT_STD template = 0> _NODISCARD _FwdIt is_sorted_until(_ExPo&& _Exec, _FwdIt _First, _FwdIt _Last) noexcept /* terminates */ { // find extent of range that is ordered by operator< return _STD is_sorted_until(_STD forward<_ExPo>(_Exec), _First, _Last, less{}); } -template = 0> +_EXPORT_STD template = 0> _NODISCARD bool is_sorted(_ExPo&& _Exec, _FwdIt _First, _FwdIt _Last) noexcept /* terminates */ { // test if range is ordered by operator< return _STD is_sorted(_STD forward<_ExPo>(_Exec), _First, _Last, less{}); @@ -10433,7 +10449,7 @@ namespace ranges { } }; - inline constexpr _Is_sorted_fn is_sorted{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Is_sorted_fn is_sorted{_Not_quite_object::_Construct_tag{}}; class _Is_sorted_until_fn : private _Not_quite_object { public: @@ -10460,11 +10476,11 @@ namespace ranges { } }; - inline constexpr _Is_sorted_until_fn is_sorted_until{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Is_sorted_until_fn is_sorted_until{_Not_quite_object::_Construct_tag{}}; } // namespace ranges #endif // __cpp_lib_concepts -template +_EXPORT_STD template _NODISCARD constexpr const _Ty& clamp(const _Ty& _Val, const _Ty& _Min_val, const _Ty& _Max_val, _Pr _Pred) { // returns _Val constrained to [_Min_val, _Max_val] #if _ITERATOR_DEBUG_LEVEL == 2 @@ -10492,7 +10508,7 @@ _NODISCARD constexpr const _Ty& clamp(const _Ty& _Val, const _Ty& _Min_val, cons } } -template +_EXPORT_STD template _NODISCARD constexpr const _Ty& clamp(const _Ty& _Val, const _Ty& _Min_val, const _Ty& _Max_val) { // returns _Val constrained to [_Min_val, _Max_val] return _STD clamp(_Val, _Min_val, _Max_val, less{}); @@ -10526,7 +10542,7 @@ namespace ranges { } }; - inline constexpr _Clamp_fn clamp{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Clamp_fn clamp{_Not_quite_object::_Construct_tag{}}; class _Lexicographical_compare_fn : private _Not_quite_object { public: @@ -10604,7 +10620,8 @@ namespace ranges { } }; - inline constexpr _Lexicographical_compare_fn lexicographical_compare{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Lexicographical_compare_fn lexicographical_compare{ + _Not_quite_object::_Construct_tag{}}; } // namespace ranges #endif // __cpp_lib_concepts #endif // _HAS_CXX17 diff --git a/stl/inc/any b/stl/inc/any index 76f3746bbb..7bcf69f935 100644 --- a/stl/inc/any +++ b/stl/inc/any @@ -31,7 +31,7 @@ _STL_DISABLE_CLANG_WARNINGS _STD_BEGIN -class bad_any_cast : public bad_cast { // thrown by failed any_cast +_EXPORT_STD class bad_any_cast : public bad_cast { // thrown by failed any_cast public: _NODISCARD const char* __CLR_OR_THIS_CALL what() const noexcept override { return "Bad any_cast"; @@ -107,7 +107,7 @@ template inline constexpr _Any_small_RTTI _Any_small_RTTI_obj = { &_Any_small_RTTI::_Destroy_impl<_Ty>, &_Any_small_RTTI::_Copy_impl<_Ty>, &_Any_small_RTTI::_Move_impl<_Ty>}; -class any { // storage for any (CopyConstructible) type +_EXPORT_STD class any { // storage for any (CopyConstructible) type public: // Construction and destruction [any.cons] constexpr any() noexcept {} @@ -353,23 +353,23 @@ private: }; // Non-member functions [any.nonmembers] -inline void swap(any& _Left, any& _Right) noexcept { +_EXPORT_STD inline void swap(any& _Left, any& _Right) noexcept { _Left.swap(_Right); } -template , _Types...>, int> = 0> _NODISCARD any make_any(_Types&&... _Args) { // construct an any containing a _ValueType initialized with _Args... return any{in_place_type<_ValueType>, _STD forward<_Types>(_Args)...}; } -template , initializer_list<_Elem>&, _Types...>, int> = 0> _NODISCARD any make_any(initializer_list<_Elem> _Ilist, _Types&&... _Args) { // construct an any containing a _ValueType initialized with _Ilist and _Args... return any{in_place_type<_ValueType>, _Ilist, _STD forward<_Types>(_Args)...}; } -template +_EXPORT_STD template _NODISCARD const _ValueType* any_cast(const any* const _Any) noexcept { // retrieve a pointer to the _ValueType contained in _Any, or null static_assert(!is_void_v<_ValueType>, "std::any cannot contain void."); @@ -384,7 +384,7 @@ _NODISCARD const _ValueType* any_cast(const any* const _Any) noexcept { return _Any->_Cast<_Remove_cvref_t<_ValueType>>(); } } -template +_EXPORT_STD template _NODISCARD _ValueType* any_cast(any* const _Any) noexcept { // retrieve a pointer to the _ValueType contained in _Any, or null static_assert(!is_void_v<_ValueType>, "std::any cannot contain void."); @@ -400,7 +400,7 @@ _NODISCARD _ValueType* any_cast(any* const _Any) noexcept { } } -template +_EXPORT_STD template _NODISCARD remove_cv_t<_Ty> any_cast(const any& _Any) { static_assert(is_constructible_v, const _Remove_cvref_t<_Ty>&>, "any_cast(const any&) requires remove_cv_t to be constructible from " @@ -413,7 +413,7 @@ _NODISCARD remove_cv_t<_Ty> any_cast(const any& _Any) { return static_cast>(*_Ptr); } -template +_EXPORT_STD template _NODISCARD remove_cv_t<_Ty> any_cast(any& _Any) { static_assert(is_constructible_v, _Remove_cvref_t<_Ty>&>, "any_cast(any&) requires remove_cv_t to be constructible from remove_cv_t>&"); @@ -425,7 +425,7 @@ _NODISCARD remove_cv_t<_Ty> any_cast(any& _Any) { return static_cast>(*_Ptr); } -template +_EXPORT_STD template _NODISCARD remove_cv_t<_Ty> any_cast(any&& _Any) { static_assert(is_constructible_v, _Remove_cvref_t<_Ty>>, "any_cast(any&&) requires remove_cv_t to be constructible from remove_cv_t>"); diff --git a/stl/inc/array b/stl/inc/array index 2f46406147..4c384d1efc 100644 --- a/stl/inc/array +++ b/stl/inc/array @@ -403,7 +403,7 @@ struct pointer_traits<_Array_iterator<_Ty, _Size>> { }; #endif // _HAS_CXX20 -template +_EXPORT_STD template class array { // fixed size array of values public: using value_type = _Ty; @@ -762,12 +762,12 @@ public: _Elems[1]; }; -template ::value, int> = 0> +_EXPORT_STD template ::value, int> = 0> _CONSTEXPR20 void swap(array<_Ty, _Size>& _Left, array<_Ty, _Size>& _Right) noexcept(noexcept(_Left.swap(_Right))) { _Left.swap(_Right); } -template +_EXPORT_STD template _NODISCARD _CONSTEXPR20 bool operator==(const array<_Ty, _Size>& _Left, const array<_Ty, _Size>& _Right) { #ifdef __EDG__ // TRANSITION, VSO-1161663 return _STD equal(_Left.begin(), _Left.end(), _Right.begin()); @@ -784,7 +784,7 @@ _NODISCARD bool operator!=(const array<_Ty, _Size>& _Left, const array<_Ty, _Siz #endif // !_HAS_CXX20 #ifdef __cpp_lib_concepts -template +_EXPORT_STD template _NODISCARD constexpr _Synth_three_way_result<_Ty> operator<=>( const array<_Ty, _Size>& _Left, const array<_Ty, _Size>& _Right) { #ifdef __EDG__ // TRANSITION, VSO-1161663 @@ -835,7 +835,7 @@ _NODISCARD constexpr array, _Size> _To_array_rvalue_impl( return {{_STD move(_Array[_Idx])...}}; } -template +_EXPORT_STD template _NODISCARD constexpr array, _Size> to_array(_Ty (&_Array)[_Size]) { static_assert(!is_array_v<_Ty>, "N4830 [array.creation]/1: " "to_array does not accept multidimensional arrays."); @@ -844,7 +844,7 @@ _NODISCARD constexpr array, _Size> to_array(_Ty (&_Array)[_Size return _To_array_lvalue_impl(_Array, make_index_sequence<_Size>{}); } -template +_EXPORT_STD template _NODISCARD constexpr array, _Size> to_array(_Ty (&&_Array)[_Size]) { static_assert(!is_array_v<_Ty>, "N4830 [array.creation]/4: " "to_array does not accept multidimensional arrays."); @@ -854,25 +854,25 @@ _NODISCARD constexpr array, _Size> to_array(_Ty (&&_Array)[_Siz } #endif // _HAS_CXX20 -template +_EXPORT_STD template _NODISCARD constexpr _Ty& get(array<_Ty, _Size>& _Arr) noexcept { static_assert(_Idx < _Size, "array index out of bounds"); return _Arr._Elems[_Idx]; } -template +_EXPORT_STD template _NODISCARD constexpr const _Ty& get(const array<_Ty, _Size>& _Arr) noexcept { static_assert(_Idx < _Size, "array index out of bounds"); return _Arr._Elems[_Idx]; } -template +_EXPORT_STD template _NODISCARD constexpr _Ty&& get(array<_Ty, _Size>&& _Arr) noexcept { static_assert(_Idx < _Size, "array index out of bounds"); return _STD move(_Arr._Elems[_Idx]); } -template +_EXPORT_STD template _NODISCARD constexpr const _Ty&& get(const array<_Ty, _Size>&& _Arr) noexcept { static_assert(_Idx < _Size, "array index out of bounds"); return _STD move(_Arr._Elems[_Idx]); diff --git a/stl/inc/atomic b/stl/inc/atomic index 15b040d415..b58fe10ae1 100644 --- a/stl/inc/atomic +++ b/stl/inc/atomic @@ -274,17 +274,17 @@ inline constexpr bool _Might_have_non_value_bits = !has_unique_object_representations_v<_Ty> && !is_floating_point_v<_Ty>; #endif // _CMPXCHG_MASK_OUT_PADDING_BITS -extern "C" inline void atomic_thread_fence(const memory_order _Order) noexcept { +_EXPORT_STD extern "C" inline void atomic_thread_fence(const memory_order _Order) noexcept { ::_Atomic_thread_fence(static_cast(_Order)); } -extern "C" inline void atomic_signal_fence(const memory_order _Order) noexcept { +_EXPORT_STD extern "C" inline void atomic_signal_fence(const memory_order _Order) noexcept { if (_Order != memory_order_relaxed) { _Compiler_barrier(); } } -template +_EXPORT_STD template _Ty kill_dependency(_Ty _Arg) noexcept { // "magic" template that kills dependency ordering when called return _Arg; } @@ -2084,7 +2084,7 @@ template using _Choose_atomic_base_t = _Choose_atomic_base2_t<_TVal, _Ty>; #endif // _HAS_CXX20 -template +_EXPORT_STD template struct atomic : _Choose_atomic_base_t<_Ty> { // atomic value private: using _Base = _Choose_atomic_base_t<_Ty>; @@ -2263,7 +2263,7 @@ atomic(_Ty) -> atomic<_Ty>; #endif // _HAS_CXX17 #if _HAS_CXX20 -template +_EXPORT_STD template struct atomic_ref : _Choose_atomic_base_t<_Ty, _Ty&> { // atomic reference private: using _Base = _Choose_atomic_base_t<_Ty, _Ty&>; @@ -2372,382 +2372,382 @@ private: }; #endif // _HAS_CXX20 -template +_EXPORT_STD template _NODISCARD bool atomic_is_lock_free(const volatile atomic<_Ty>* _Mem) noexcept { return _Mem->is_lock_free(); } -template +_EXPORT_STD template _NODISCARD bool atomic_is_lock_free(const atomic<_Ty>* _Mem) noexcept { return _Mem->is_lock_free(); } -template +_EXPORT_STD template void atomic_store(volatile atomic<_Ty>* const _Mem, const _Identity_t<_Ty> _Value) noexcept { static_assert(_Deprecate_non_lock_free_volatile<_Ty>, "Never fails"); _Mem->store(_Value); } -template +_EXPORT_STD template void atomic_store(atomic<_Ty>* const _Mem, const _Identity_t<_Ty> _Value) noexcept { _Mem->store(_Value); } -template +_EXPORT_STD template void atomic_store_explicit( volatile atomic<_Ty>* const _Mem, const _Identity_t<_Ty> _Value, const memory_order _Order) noexcept { static_assert(_Deprecate_non_lock_free_volatile<_Ty>, "Never fails"); _Mem->store(_Value, _Order); } -template +_EXPORT_STD template void atomic_store_explicit(atomic<_Ty>* const _Mem, const _Identity_t<_Ty> _Value, const memory_order _Order) noexcept { _Mem->store(_Value, _Order); } -template +_EXPORT_STD template _CXX20_DEPRECATE_ATOMIC_INIT void atomic_init( volatile atomic<_Ty>* const _Mem, const typename atomic<_Ty>::value_type _Value) noexcept { static_assert(_Deprecate_non_lock_free_volatile<_Ty>, "Never fails"); _STD atomic_store_explicit(_Mem, _Value, memory_order_relaxed); } -template +_EXPORT_STD template _CXX20_DEPRECATE_ATOMIC_INIT void atomic_init( atomic<_Ty>* const _Mem, const typename atomic<_Ty>::value_type _Value) noexcept { _STD atomic_store_explicit(_Mem, _Value, memory_order_relaxed); } -template +_EXPORT_STD template _NODISCARD _Ty atomic_load(const volatile atomic<_Ty>* const _Mem) noexcept { static_assert(_Deprecate_non_lock_free_volatile<_Ty>, "Never fails"); return _Mem->load(); } -template +_EXPORT_STD template _NODISCARD _Ty atomic_load(const atomic<_Ty>* const _Mem) noexcept { return _Mem->load(); } -template +_EXPORT_STD template _NODISCARD _Ty atomic_load_explicit(const volatile atomic<_Ty>* const _Mem, const memory_order _Order) noexcept { static_assert(_Deprecate_non_lock_free_volatile<_Ty>, "Never fails"); return _Mem->load(_Order); } -template +_EXPORT_STD template _NODISCARD _Ty atomic_load_explicit(const atomic<_Ty>* const _Mem, const memory_order _Order) noexcept { return _Mem->load(_Order); } -template +_EXPORT_STD template _Ty atomic_exchange(volatile atomic<_Ty>* const _Mem, const _Identity_t<_Ty> _Value) noexcept { static_assert(_Deprecate_non_lock_free_volatile<_Ty>, "Never fails"); return _Mem->exchange(_Value); } -template +_EXPORT_STD template _Ty atomic_exchange(atomic<_Ty>* const _Mem, const _Identity_t<_Ty> _Value) noexcept { return _Mem->exchange(_Value); } -template +_EXPORT_STD template _Ty atomic_exchange_explicit( volatile atomic<_Ty>* const _Mem, const _Identity_t<_Ty> _Value, const memory_order _Order) noexcept { static_assert(_Deprecate_non_lock_free_volatile<_Ty>, "Never fails"); return _Mem->exchange(_Value, _Order); } -template +_EXPORT_STD template _Ty atomic_exchange_explicit( atomic<_Ty>* const _Mem, const _Identity_t<_Ty> _Value, const memory_order _Order) noexcept { return _Mem->exchange(_Value, _Order); } -template +_EXPORT_STD template bool atomic_compare_exchange_strong( volatile atomic<_Ty>* const _Mem, _Identity_t<_Ty>* const _Expected, const _Identity_t<_Ty> _Desired) noexcept { static_assert(_Deprecate_non_lock_free_volatile<_Ty>, "Never fails"); return _Mem->compare_exchange_strong(*_Expected, _Desired); } -template +_EXPORT_STD template bool atomic_compare_exchange_strong( atomic<_Ty>* const _Mem, _Identity_t<_Ty>* const _Expected, const _Identity_t<_Ty> _Desired) noexcept { return _Mem->compare_exchange_strong(*_Expected, _Desired); } -template +_EXPORT_STD template bool atomic_compare_exchange_strong_explicit(volatile atomic<_Ty>* const _Mem, _Identity_t<_Ty>* const _Expected, const _Identity_t<_Ty> _Desired, const memory_order _Success, const memory_order _Failure) noexcept { static_assert(_Deprecate_non_lock_free_volatile<_Ty>, "Never fails"); return _Mem->compare_exchange_strong(*_Expected, _Desired, _Combine_cas_memory_orders(_Success, _Failure)); } -template +_EXPORT_STD template bool atomic_compare_exchange_strong_explicit(atomic<_Ty>* const _Mem, _Identity_t<_Ty>* const _Expected, const _Identity_t<_Ty> _Desired, const memory_order _Success, const memory_order _Failure) noexcept { return _Mem->compare_exchange_strong(*_Expected, _Desired, _Combine_cas_memory_orders(_Success, _Failure)); } -template +_EXPORT_STD template bool atomic_compare_exchange_weak( volatile atomic<_Ty>* const _Mem, _Identity_t<_Ty>* const _Expected, const _Identity_t<_Ty> _Desired) noexcept { static_assert(_Deprecate_non_lock_free_volatile<_Ty>, "Never fails"); return _Mem->compare_exchange_strong(*_Expected, _Desired); } -template +_EXPORT_STD template bool atomic_compare_exchange_weak( atomic<_Ty>* const _Mem, _Identity_t<_Ty>* const _Expected, const _Identity_t<_Ty> _Desired) noexcept { return _Mem->compare_exchange_strong(*_Expected, _Desired); } -template +_EXPORT_STD template bool atomic_compare_exchange_weak_explicit(volatile atomic<_Ty>* const _Mem, _Identity_t<_Ty>* const _Expected, const _Identity_t<_Ty> _Desired, const memory_order _Success, const memory_order _Failure) noexcept { static_assert(_Deprecate_non_lock_free_volatile<_Ty>, "Never fails"); return _Mem->compare_exchange_strong(*_Expected, _Desired, _Combine_cas_memory_orders(_Success, _Failure)); } -template +_EXPORT_STD template bool atomic_compare_exchange_weak_explicit(atomic<_Ty>* const _Mem, _Identity_t<_Ty>* const _Expected, const _Identity_t<_Ty> _Desired, const memory_order _Success, const memory_order _Failure) noexcept { return _Mem->compare_exchange_strong(*_Expected, _Desired, _Combine_cas_memory_orders(_Success, _Failure)); } -template +_EXPORT_STD template _Ty atomic_fetch_add(volatile atomic<_Ty>* _Mem, const typename atomic<_Ty>::difference_type _Value) noexcept { static_assert(_Deprecate_non_lock_free_volatile<_Ty>, "Never fails"); return _Mem->fetch_add(_Value); } -template +_EXPORT_STD template _Ty atomic_fetch_add(atomic<_Ty>* _Mem, const typename atomic<_Ty>::difference_type _Value) noexcept { return _Mem->fetch_add(_Value); } -template +_EXPORT_STD template _Ty atomic_fetch_add_explicit(volatile atomic<_Ty>* _Mem, const typename atomic<_Ty>::difference_type _Value, const memory_order _Order) noexcept { static_assert(_Deprecate_non_lock_free_volatile<_Ty>, "Never fails"); return _Mem->fetch_add(_Value, _Order); } -template +_EXPORT_STD template _Ty atomic_fetch_add_explicit( atomic<_Ty>* _Mem, const typename atomic<_Ty>::difference_type _Value, const memory_order _Order) noexcept { return _Mem->fetch_add(_Value, _Order); } -template +_EXPORT_STD template _Ty atomic_fetch_sub(volatile atomic<_Ty>* _Mem, const typename atomic<_Ty>::difference_type _Value) noexcept { static_assert(_Deprecate_non_lock_free_volatile<_Ty>, "Never fails"); return _Mem->fetch_sub(_Value); } -template +_EXPORT_STD template _Ty atomic_fetch_sub(atomic<_Ty>* _Mem, const typename atomic<_Ty>::difference_type _Value) noexcept { return _Mem->fetch_sub(_Value); } -template +_EXPORT_STD template _Ty atomic_fetch_sub_explicit(volatile atomic<_Ty>* _Mem, const typename atomic<_Ty>::difference_type _Value, const memory_order _Order) noexcept { static_assert(_Deprecate_non_lock_free_volatile<_Ty>, "Never fails"); return _Mem->fetch_sub(_Value, _Order); } -template +_EXPORT_STD template _Ty atomic_fetch_sub_explicit( atomic<_Ty>* _Mem, const typename atomic<_Ty>::difference_type _Value, const memory_order _Order) noexcept { return _Mem->fetch_sub(_Value, _Order); } -template +_EXPORT_STD template _Ty atomic_fetch_and(volatile atomic<_Ty>* _Mem, const typename atomic<_Ty>::value_type _Value) noexcept { static_assert(_Deprecate_non_lock_free_volatile<_Ty>, "Never fails"); return _Mem->fetch_and(_Value); } -template +_EXPORT_STD template _Ty atomic_fetch_and(atomic<_Ty>* _Mem, const typename atomic<_Ty>::value_type _Value) noexcept { return _Mem->fetch_and(_Value); } -template +_EXPORT_STD template _Ty atomic_fetch_and_explicit( volatile atomic<_Ty>* _Mem, const typename atomic<_Ty>::value_type _Value, const memory_order _Order) noexcept { static_assert(_Deprecate_non_lock_free_volatile<_Ty>, "Never fails"); return _Mem->fetch_and(_Value, _Order); } -template +_EXPORT_STD template _Ty atomic_fetch_and_explicit( atomic<_Ty>* _Mem, const typename atomic<_Ty>::value_type _Value, const memory_order _Order) noexcept { return _Mem->fetch_and(_Value, _Order); } -template +_EXPORT_STD template _Ty atomic_fetch_or(volatile atomic<_Ty>* _Mem, const typename atomic<_Ty>::value_type _Value) noexcept { static_assert(_Deprecate_non_lock_free_volatile<_Ty>, "Never fails"); return _Mem->fetch_or(_Value); } -template +_EXPORT_STD template _Ty atomic_fetch_or(atomic<_Ty>* _Mem, const typename atomic<_Ty>::value_type _Value) noexcept { return _Mem->fetch_or(_Value); } -template +_EXPORT_STD template _Ty atomic_fetch_or_explicit( volatile atomic<_Ty>* _Mem, const typename atomic<_Ty>::value_type _Value, const memory_order _Order) noexcept { static_assert(_Deprecate_non_lock_free_volatile<_Ty>, "Never fails"); return _Mem->fetch_or(_Value, _Order); } -template +_EXPORT_STD template _Ty atomic_fetch_or_explicit( atomic<_Ty>* _Mem, const typename atomic<_Ty>::value_type _Value, const memory_order _Order) noexcept { return _Mem->fetch_or(_Value, _Order); } -template +_EXPORT_STD template _Ty atomic_fetch_xor(volatile atomic<_Ty>* _Mem, const typename atomic<_Ty>::value_type _Value) noexcept { static_assert(_Deprecate_non_lock_free_volatile<_Ty>, "Never fails"); return _Mem->fetch_xor(_Value); } -template +_EXPORT_STD template _Ty atomic_fetch_xor(atomic<_Ty>* _Mem, const typename atomic<_Ty>::value_type _Value) noexcept { return _Mem->fetch_xor(_Value); } -template +_EXPORT_STD template _Ty atomic_fetch_xor_explicit( volatile atomic<_Ty>* _Mem, const typename atomic<_Ty>::value_type _Value, const memory_order _Order) noexcept { static_assert(_Deprecate_non_lock_free_volatile<_Ty>, "Never fails"); return _Mem->fetch_xor(_Value, _Order); } -template +_EXPORT_STD template _Ty atomic_fetch_xor_explicit( atomic<_Ty>* _Mem, const typename atomic<_Ty>::value_type _Value, const memory_order _Order) noexcept { return _Mem->fetch_xor(_Value, _Order); } #if _HAS_CXX20 -template +_EXPORT_STD template void atomic_wait(const volatile atomic<_Ty>* const _Mem, const typename atomic<_Ty>::value_type _Expected) noexcept /* strengthened */ { _Mem->wait(_Expected); } -template +_EXPORT_STD template void atomic_wait(const atomic<_Ty>* const _Mem, const typename atomic<_Ty>::value_type _Expected) noexcept /* strengthened */ { _Mem->wait(_Expected); } -template +_EXPORT_STD template void atomic_wait_explicit(const volatile atomic<_Ty>* const _Mem, const typename atomic<_Ty>::value_type _Expected, const memory_order _Order) noexcept /* strengthened */ { _Mem->wait(_Expected, _Order); } -template +_EXPORT_STD template void atomic_wait_explicit(const atomic<_Ty>* const _Mem, const typename atomic<_Ty>::value_type _Expected, const memory_order _Order) noexcept /* strengthened */ { _Mem->wait(_Expected, _Order); } -template +_EXPORT_STD template void atomic_notify_one(volatile atomic<_Ty>* const _Mem) noexcept /* strengthened */ { _Mem->notify_one(); } -template +_EXPORT_STD template void atomic_notify_one(atomic<_Ty>* const _Mem) noexcept /* strengthened */ { _Mem->notify_one(); } -template +_EXPORT_STD template void atomic_notify_all(volatile atomic<_Ty>* const _Mem) noexcept /* strengthened */ { _Mem->notify_all(); } -template +_EXPORT_STD template void atomic_notify_all(atomic<_Ty>* const _Mem) noexcept /* strengthened */ { _Mem->notify_all(); } #endif // _HAS_CXX20 -using atomic_bool = atomic; +_EXPORT_STD using atomic_bool = atomic; -using atomic_char = atomic; -using atomic_schar = atomic; -using atomic_uchar = atomic; -using atomic_short = atomic; -using atomic_ushort = atomic; -using atomic_int = atomic; -using atomic_uint = atomic; -using atomic_long = atomic; -using atomic_ulong = atomic; -using atomic_llong = atomic; -using atomic_ullong = atomic; +_EXPORT_STD using atomic_char = atomic; +_EXPORT_STD using atomic_schar = atomic; +_EXPORT_STD using atomic_uchar = atomic; +_EXPORT_STD using atomic_short = atomic; +_EXPORT_STD using atomic_ushort = atomic; +_EXPORT_STD using atomic_int = atomic; +_EXPORT_STD using atomic_uint = atomic; +_EXPORT_STD using atomic_long = atomic; +_EXPORT_STD using atomic_ulong = atomic; +_EXPORT_STD using atomic_llong = atomic; +_EXPORT_STD using atomic_ullong = atomic; #ifdef __cpp_lib_char8_t -using atomic_char8_t = atomic; +_EXPORT_STD using atomic_char8_t = atomic; #endif // __cpp_lib_char8_t -using atomic_char16_t = atomic; -using atomic_char32_t = atomic; -using atomic_wchar_t = atomic; - -using atomic_int8_t = atomic; -using atomic_uint8_t = atomic; -using atomic_int16_t = atomic; -using atomic_uint16_t = atomic; -using atomic_int32_t = atomic; -using atomic_uint32_t = atomic; -using atomic_int64_t = atomic; -using atomic_uint64_t = atomic; - -using atomic_int_least8_t = atomic; -using atomic_uint_least8_t = atomic; -using atomic_int_least16_t = atomic; -using atomic_uint_least16_t = atomic; -using atomic_int_least32_t = atomic; -using atomic_uint_least32_t = atomic; -using atomic_int_least64_t = atomic; -using atomic_uint_least64_t = atomic; - -using atomic_int_fast8_t = atomic; -using atomic_uint_fast8_t = atomic; -using atomic_int_fast16_t = atomic; -using atomic_uint_fast16_t = atomic; -using atomic_int_fast32_t = atomic; -using atomic_uint_fast32_t = atomic; -using atomic_int_fast64_t = atomic; -using atomic_uint_fast64_t = atomic; - -using atomic_intptr_t = atomic; -using atomic_uintptr_t = atomic; -using atomic_size_t = atomic; -using atomic_ptrdiff_t = atomic; -using atomic_intmax_t = atomic; -using atomic_uintmax_t = atomic; +_EXPORT_STD using atomic_char16_t = atomic; +_EXPORT_STD using atomic_char32_t = atomic; +_EXPORT_STD using atomic_wchar_t = atomic; + +_EXPORT_STD using atomic_int8_t = atomic; +_EXPORT_STD using atomic_uint8_t = atomic; +_EXPORT_STD using atomic_int16_t = atomic; +_EXPORT_STD using atomic_uint16_t = atomic; +_EXPORT_STD using atomic_int32_t = atomic; +_EXPORT_STD using atomic_uint32_t = atomic; +_EXPORT_STD using atomic_int64_t = atomic; +_EXPORT_STD using atomic_uint64_t = atomic; + +_EXPORT_STD using atomic_int_least8_t = atomic; +_EXPORT_STD using atomic_uint_least8_t = atomic; +_EXPORT_STD using atomic_int_least16_t = atomic; +_EXPORT_STD using atomic_uint_least16_t = atomic; +_EXPORT_STD using atomic_int_least32_t = atomic; +_EXPORT_STD using atomic_uint_least32_t = atomic; +_EXPORT_STD using atomic_int_least64_t = atomic; +_EXPORT_STD using atomic_uint_least64_t = atomic; + +_EXPORT_STD using atomic_int_fast8_t = atomic; +_EXPORT_STD using atomic_uint_fast8_t = atomic; +_EXPORT_STD using atomic_int_fast16_t = atomic; +_EXPORT_STD using atomic_uint_fast16_t = atomic; +_EXPORT_STD using atomic_int_fast32_t = atomic; +_EXPORT_STD using atomic_uint_fast32_t = atomic; +_EXPORT_STD using atomic_int_fast64_t = atomic; +_EXPORT_STD using atomic_uint_fast64_t = atomic; + +_EXPORT_STD using atomic_intptr_t = atomic; +_EXPORT_STD using atomic_uintptr_t = atomic; +_EXPORT_STD using atomic_size_t = atomic; +_EXPORT_STD using atomic_ptrdiff_t = atomic; +_EXPORT_STD using atomic_intmax_t = atomic; +_EXPORT_STD using atomic_uintmax_t = atomic; #if _HAS_CXX20 // Though there are CMPXCHG8B and CMPXCHG16B, // the largest atomics with a full set of efficient operations are pointer-sized. -using atomic_signed_lock_free = atomic_intptr_t; -using atomic_unsigned_lock_free = atomic_uintptr_t; +_EXPORT_STD using atomic_signed_lock_free = atomic_intptr_t; +_EXPORT_STD using atomic_unsigned_lock_free = atomic_uintptr_t; #endif // _HAS_CXX20 #define ATOMIC_FLAG_INIT \ {} -struct atomic_flag { // flag with test-and-set semantics +_EXPORT_STD struct atomic_flag { // flag with test-and-set semantics #if _HAS_CXX20 _NODISCARD bool test(const memory_order _Order = memory_order_seq_cst) const noexcept { return _Storage.load(_Order) != 0; @@ -2811,88 +2811,92 @@ struct atomic_flag { // flag with test-and-set semantics #if _HAS_CXX20 -_NODISCARD inline bool atomic_flag_test(const volatile atomic_flag* const _Flag) noexcept { +_EXPORT_STD _NODISCARD inline bool atomic_flag_test(const volatile atomic_flag* const _Flag) noexcept { return _Flag->test(); } -_NODISCARD inline bool atomic_flag_test(const atomic_flag* const _Flag) noexcept { +_EXPORT_STD _NODISCARD inline bool atomic_flag_test(const atomic_flag* const _Flag) noexcept { return _Flag->test(); } -_NODISCARD inline bool atomic_flag_test_explicit( +_EXPORT_STD _NODISCARD inline bool atomic_flag_test_explicit( const volatile atomic_flag* const _Flag, const memory_order _Order) noexcept { return _Flag->test(_Order); } -_NODISCARD inline bool atomic_flag_test_explicit(const atomic_flag* const _Flag, const memory_order _Order) noexcept { +_EXPORT_STD _NODISCARD inline bool atomic_flag_test_explicit( + const atomic_flag* const _Flag, const memory_order _Order) noexcept { return _Flag->test(_Order); } #endif // _HAS_CXX20 -inline bool atomic_flag_test_and_set(atomic_flag* const _Flag) noexcept { +_EXPORT_STD inline bool atomic_flag_test_and_set(atomic_flag* const _Flag) noexcept { return _Flag->test_and_set(); } -inline bool atomic_flag_test_and_set(volatile atomic_flag* const _Flag) noexcept { +_EXPORT_STD inline bool atomic_flag_test_and_set(volatile atomic_flag* const _Flag) noexcept { return _Flag->test_and_set(); } -inline bool atomic_flag_test_and_set_explicit(atomic_flag* const _Flag, const memory_order _Order) noexcept { +_EXPORT_STD inline bool atomic_flag_test_and_set_explicit( + atomic_flag* const _Flag, const memory_order _Order) noexcept { return _Flag->test_and_set(_Order); } -inline bool atomic_flag_test_and_set_explicit(volatile atomic_flag* const _Flag, const memory_order _Order) noexcept { +_EXPORT_STD inline bool atomic_flag_test_and_set_explicit( + volatile atomic_flag* const _Flag, const memory_order _Order) noexcept { return _Flag->test_and_set(_Order); } -inline void atomic_flag_clear(atomic_flag* const _Flag) noexcept { +_EXPORT_STD inline void atomic_flag_clear(atomic_flag* const _Flag) noexcept { _Flag->clear(); } -inline void atomic_flag_clear(volatile atomic_flag* const _Flag) noexcept { +_EXPORT_STD inline void atomic_flag_clear(volatile atomic_flag* const _Flag) noexcept { _Flag->clear(); } -inline void atomic_flag_clear_explicit(atomic_flag* const _Flag, const memory_order _Order) noexcept { +_EXPORT_STD inline void atomic_flag_clear_explicit(atomic_flag* const _Flag, const memory_order _Order) noexcept { _Flag->clear(_Order); } -inline void atomic_flag_clear_explicit(volatile atomic_flag* const _Flag, const memory_order _Order) noexcept { +_EXPORT_STD inline void atomic_flag_clear_explicit( + volatile atomic_flag* const _Flag, const memory_order _Order) noexcept { _Flag->clear(_Order); } #if _HAS_CXX20 -inline void atomic_flag_wait(const volatile atomic_flag* const _Flag, const bool _Expected) noexcept { +_EXPORT_STD inline void atomic_flag_wait(const volatile atomic_flag* const _Flag, const bool _Expected) noexcept { return _Flag->wait(_Expected); } -inline void atomic_flag_wait(const atomic_flag* const _Flag, const bool _Expected) noexcept { +_EXPORT_STD inline void atomic_flag_wait(const atomic_flag* const _Flag, const bool _Expected) noexcept { return _Flag->wait(_Expected); } -inline void atomic_flag_wait_explicit( +_EXPORT_STD inline void atomic_flag_wait_explicit( const volatile atomic_flag* const _Flag, const bool _Expected, const memory_order _Order) noexcept { return _Flag->wait(_Expected, _Order); } -inline void atomic_flag_wait_explicit( +_EXPORT_STD inline void atomic_flag_wait_explicit( const atomic_flag* const _Flag, const bool _Expected, const memory_order _Order) noexcept { return _Flag->wait(_Expected, _Order); } -inline void atomic_flag_notify_one(volatile atomic_flag* const _Flag) noexcept { +_EXPORT_STD inline void atomic_flag_notify_one(volatile atomic_flag* const _Flag) noexcept { return _Flag->notify_one(); } -inline void atomic_flag_notify_one(atomic_flag* const _Flag) noexcept { +_EXPORT_STD inline void atomic_flag_notify_one(atomic_flag* const _Flag) noexcept { return _Flag->notify_one(); } -inline void atomic_flag_notify_all(volatile atomic_flag* const _Flag) noexcept { +_EXPORT_STD inline void atomic_flag_notify_all(volatile atomic_flag* const _Flag) noexcept { return _Flag->notify_all(); } -inline void atomic_flag_notify_all(atomic_flag* const _Flag) noexcept { +_EXPORT_STD inline void atomic_flag_notify_all(atomic_flag* const _Flag) noexcept { return _Flag->notify_all(); } diff --git a/stl/inc/barrier b/stl/inc/barrier index c7332d508c..850c90f4fc 100644 --- a/stl/inc/barrier +++ b/stl/inc/barrier @@ -35,7 +35,7 @@ struct _No_completion_function { void operator()() noexcept {} }; -template +_EXPORT_STD template class barrier; inline constexpr ptrdiff_t _Barrier_arrival_token_mask = 1; @@ -66,7 +66,7 @@ private: ptrdiff_t _Value; }; -template +_EXPORT_STD template class barrier { public: static_assert( diff --git a/stl/inc/bit b/stl/inc/bit index 391c0cdcdf..06af8550f3 100644 --- a/stl/inc/bit +++ b/stl/inc/bit @@ -26,7 +26,7 @@ _STL_DISABLE_CLANG_WARNINGS _STD_BEGIN -template , is_trivially_copyable<_To>, is_trivially_copyable<_From>>, int> = 0> @@ -34,17 +34,17 @@ _NODISCARD constexpr _To bit_cast(const _From& _Val) noexcept { return __builtin_bit_cast(_To, _Val); } -template , int> = 0> +_EXPORT_STD template , int> = 0> _NODISCARD constexpr int countl_zero(_Ty _Val) noexcept; -template , int> = 0> +_EXPORT_STD template , int> = 0> _NODISCARD constexpr bool has_single_bit(const _Ty _Val) noexcept { return _Val != 0 && (_Val & (_Val - 1)) == 0; } inline void _Precondition_violation_in_bit_ceil() noexcept {} -template , int> = 0> +_EXPORT_STD template , int> = 0> _NODISCARD constexpr _Ty bit_ceil(const _Ty _Val) noexcept /* strengthened */ { if (_Val <= 1u) { return _Ty{1}; @@ -72,7 +72,7 @@ _NODISCARD constexpr _Ty bit_ceil(const _Ty _Val) noexcept /* strengthened */ { return static_cast<_Ty>(_Ty{1} << _Num); } -template , int> = 0> +_EXPORT_STD template , int> = 0> _NODISCARD constexpr _Ty bit_floor(const _Ty _Val) noexcept { if (_Val == 0) { return 0; @@ -81,15 +81,15 @@ _NODISCARD constexpr _Ty bit_floor(const _Ty _Val) noexcept { return static_cast<_Ty>(_Ty{1} << (numeric_limits<_Ty>::digits - 1 - _STD countl_zero(_Val))); } -template , int> = 0> +_EXPORT_STD template , int> = 0> _NODISCARD constexpr int bit_width(const _Ty _Val) noexcept { return numeric_limits<_Ty>::digits - _STD countl_zero(_Val); } -template , int> = 0> +_EXPORT_STD template , int> = 0> _NODISCARD constexpr _Ty rotr(_Ty _Val, int _Rotation) noexcept; -template , int> = 0> +_EXPORT_STD template , int> = 0> _NODISCARD constexpr _Ty rotl(const _Ty _Val, const int _Rotation) noexcept { constexpr auto _Digits = numeric_limits<_Ty>::digits; @@ -117,7 +117,7 @@ _NODISCARD constexpr _Ty rotl(const _Ty _Val, const int _Rotation) noexcept { } } -template , int> _Enabled> +_EXPORT_STD template , int> _Enabled> _NODISCARD constexpr _Ty rotr(const _Ty _Val, const int _Rotation) noexcept { constexpr auto _Digits = numeric_limits<_Ty>::digits; @@ -289,7 +289,7 @@ _NODISCARD constexpr unsigned long long _Byteswap_uint64(const unsigned long lon } #endif // _HAS_CXX23 -template , int> _Enabled> +_EXPORT_STD template , int> _Enabled> _NODISCARD constexpr int countl_zero(const _Ty _Val) noexcept { #if defined(_M_IX86) || (defined(_M_X64) && !defined(_M_ARM64EC)) if (!_STD is_constant_evaluated()) { @@ -304,28 +304,28 @@ _NODISCARD constexpr int countl_zero(const _Ty _Val) noexcept { return _Countl_zero_fallback(_Val); } -template , int> = 0> +_EXPORT_STD template , int> = 0> _NODISCARD constexpr int countl_one(const _Ty _Val) noexcept { return _STD countl_zero(static_cast<_Ty>(~_Val)); } -template , int> = 0> +_EXPORT_STD template , int> = 0> _NODISCARD constexpr int countr_zero(const _Ty _Val) noexcept { return _Countr_zero(_Val); } -template , int> _Enabled = 0> +_EXPORT_STD template , int> _Enabled = 0> _NODISCARD constexpr int countr_one(const _Ty _Val) noexcept { return _Countr_zero(static_cast<_Ty>(~_Val)); } -template , int> = 0> +_EXPORT_STD template , int> = 0> _NODISCARD constexpr int popcount(const _Ty _Val) noexcept { return _Popcount(_Val); } #if _HAS_CXX23 -template , int> = 0> +_EXPORT_STD template , int> = 0> _NODISCARD constexpr _Ty byteswap(const _Ty _Val) noexcept { if constexpr (sizeof(_Ty) == 1) { return _Val; @@ -341,7 +341,7 @@ _NODISCARD constexpr _Ty byteswap(const _Ty _Val) noexcept { } #endif // _HAS_CXX23 -enum class endian { little = 0, big = 1, native = little }; +_EXPORT_STD enum class endian { little = 0, big = 1, native = little }; _STD_END #pragma pop_macro("new") diff --git a/stl/inc/bitset b/stl/inc/bitset index 041d17b923..de019cf1aa 100644 --- a/stl/inc/bitset +++ b/stl/inc/bitset @@ -20,7 +20,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new _STD_BEGIN -template +_EXPORT_STD template class bitset { // store fixed-length sequence of Boolean elements public: #pragma warning(push) @@ -492,28 +492,28 @@ private: _Ty _Array[_Words + 1]; }; -template +_EXPORT_STD template _NODISCARD _CONSTEXPR23 bitset<_Bits> operator&(const bitset<_Bits>& _Left, const bitset<_Bits>& _Right) noexcept { bitset<_Bits> _Ans = _Left; _Ans &= _Right; return _Ans; } -template +_EXPORT_STD template _NODISCARD _CONSTEXPR23 bitset<_Bits> operator|(const bitset<_Bits>& _Left, const bitset<_Bits>& _Right) noexcept { bitset<_Bits> _Ans = _Left; _Ans |= _Right; return _Ans; } -template +_EXPORT_STD template _NODISCARD _CONSTEXPR23 bitset<_Bits> operator^(const bitset<_Bits>& _Left, const bitset<_Bits>& _Right) noexcept { bitset<_Bits> _Ans = _Left; _Ans ^= _Right; return _Ans; } -template +_EXPORT_STD template basic_ostream<_Elem, _Tr>& operator<<(basic_ostream<_Elem, _Tr>& _Ostr, const bitset<_Bits>& _Right) { using _Ctype = typename basic_ostream<_Elem, _Tr>::_Ctype; const _Ctype& _Ctype_fac = _STD use_facet<_Ctype>(_Ostr.getloc()); @@ -523,7 +523,7 @@ basic_ostream<_Elem, _Tr>& operator<<(basic_ostream<_Elem, _Tr>& _Ostr, const bi return _Ostr << _Right.template to_string<_Elem, _Tr, allocator<_Elem>>(_Elem0, _Elem1); } -template +_EXPORT_STD template basic_istream<_Elem, _Tr>& operator>>(basic_istream<_Elem, _Tr>& _Istr, bitset<_Bits>& _Right) { using _Istr_t = basic_istream<_Elem, _Tr>; using _Ctype = typename _Istr_t::_Ctype; diff --git a/stl/inc/cctype b/stl/inc/cctype index 597de07b05..de39757181 100644 --- a/stl/inc/cctype +++ b/stl/inc/cctype @@ -19,21 +19,21 @@ _STL_DISABLE_CLANG_WARNINGS #undef new _STD_BEGIN -using _CSTD isalnum; -using _CSTD isalpha; -using _CSTD iscntrl; -using _CSTD isdigit; -using _CSTD isgraph; -using _CSTD islower; -using _CSTD isprint; -using _CSTD ispunct; -using _CSTD isspace; -using _CSTD isupper; -using _CSTD isxdigit; -using _CSTD tolower; -using _CSTD toupper; - -using _CSTD isblank; +_EXPORT_STD using _CSTD isalnum; +_EXPORT_STD using _CSTD isalpha; +_EXPORT_STD using _CSTD iscntrl; +_EXPORT_STD using _CSTD isdigit; +_EXPORT_STD using _CSTD isgraph; +_EXPORT_STD using _CSTD islower; +_EXPORT_STD using _CSTD isprint; +_EXPORT_STD using _CSTD ispunct; +_EXPORT_STD using _CSTD isspace; +_EXPORT_STD using _CSTD isupper; +_EXPORT_STD using _CSTD isxdigit; +_EXPORT_STD using _CSTD tolower; +_EXPORT_STD using _CSTD toupper; + +_EXPORT_STD using _CSTD isblank; _STD_END #pragma pop_macro("new") diff --git a/stl/inc/cfenv b/stl/inc/cfenv index c78b983724..bad2bf0264 100644 --- a/stl/inc/cfenv +++ b/stl/inc/cfenv @@ -19,24 +19,24 @@ _STL_DISABLE_CLANG_WARNINGS #undef new _STD_BEGIN -using _CSTD fegetround; -using _CSTD fesetround; +_EXPORT_STD using _CSTD fegetround; +_EXPORT_STD using _CSTD fesetround; #if !defined(_M_CEE) || defined(_CRTBLD) -using _CSTD feclearexcept; -using _CSTD fegetenv; -using _CSTD fegetexceptflag; -using _CSTD feholdexcept; -using _CSTD fenv_t; -using _CSTD fesetenv; -using _CSTD fesetexceptflag; -using _CSTD fetestexcept; -using _CSTD fexcept_t; +_EXPORT_STD using _CSTD feclearexcept; +_EXPORT_STD using _CSTD fegetenv; +_EXPORT_STD using _CSTD fegetexceptflag; +_EXPORT_STD using _CSTD feholdexcept; +_EXPORT_STD using _CSTD fenv_t; +_EXPORT_STD using _CSTD fesetenv; +_EXPORT_STD using _CSTD fesetexceptflag; +_EXPORT_STD using _CSTD fetestexcept; +_EXPORT_STD using _CSTD fexcept_t; #endif // !defined(_M_CEE) || defined(_CRTBLD) #if !defined(_M_CEE) && !defined(_CRTBLD) -using _CSTD feraiseexcept; -using _CSTD feupdateenv; +_EXPORT_STD using _CSTD feraiseexcept; +_EXPORT_STD using _CSTD feupdateenv; #endif // !defined(_M_CEE) && !defined(_CRTBLD) _STD_END diff --git a/stl/inc/charconv b/stl/inc/charconv index 85a83419be..b65b9eb911 100644 --- a/stl/inc/charconv +++ b/stl/inc/charconv @@ -157,55 +157,55 @@ _NODISCARD _CONSTEXPR23 to_chars_result _Integer_to_chars( return {_First + _Digits_written, errc{}}; } -_CONSTEXPR23 to_chars_result to_chars( +_EXPORT_STD _CONSTEXPR23 to_chars_result to_chars( char* const _First, char* const _Last, const char _Value, const int _Base = 10) noexcept /* strengthened */ { return _Integer_to_chars(_First, _Last, _Value, _Base); } -_CONSTEXPR23 to_chars_result to_chars( +_EXPORT_STD _CONSTEXPR23 to_chars_result to_chars( char* const _First, char* const _Last, const signed char _Value, const int _Base = 10) noexcept /* strengthened */ { return _Integer_to_chars(_First, _Last, _Value, _Base); } -_CONSTEXPR23 to_chars_result to_chars(char* const _First, char* const _Last, const unsigned char _Value, +_EXPORT_STD _CONSTEXPR23 to_chars_result to_chars(char* const _First, char* const _Last, const unsigned char _Value, const int _Base = 10) noexcept /* strengthened */ { return _Integer_to_chars(_First, _Last, _Value, _Base); } -_CONSTEXPR23 to_chars_result to_chars( +_EXPORT_STD _CONSTEXPR23 to_chars_result to_chars( char* const _First, char* const _Last, const short _Value, const int _Base = 10) noexcept /* strengthened */ { return _Integer_to_chars(_First, _Last, _Value, _Base); } -_CONSTEXPR23 to_chars_result to_chars(char* const _First, char* const _Last, const unsigned short _Value, +_EXPORT_STD _CONSTEXPR23 to_chars_result to_chars(char* const _First, char* const _Last, const unsigned short _Value, const int _Base = 10) noexcept /* strengthened */ { return _Integer_to_chars(_First, _Last, _Value, _Base); } -_CONSTEXPR23 to_chars_result to_chars( +_EXPORT_STD _CONSTEXPR23 to_chars_result to_chars( char* const _First, char* const _Last, const int _Value, const int _Base = 10) noexcept /* strengthened */ { return _Integer_to_chars(_First, _Last, _Value, _Base); } -_CONSTEXPR23 to_chars_result to_chars(char* const _First, char* const _Last, const unsigned int _Value, +_EXPORT_STD _CONSTEXPR23 to_chars_result to_chars(char* const _First, char* const _Last, const unsigned int _Value, const int _Base = 10) noexcept /* strengthened */ { return _Integer_to_chars(_First, _Last, _Value, _Base); } -_CONSTEXPR23 to_chars_result to_chars( +_EXPORT_STD _CONSTEXPR23 to_chars_result to_chars( char* const _First, char* const _Last, const long _Value, const int _Base = 10) noexcept /* strengthened */ { return _Integer_to_chars(_First, _Last, _Value, _Base); } -_CONSTEXPR23 to_chars_result to_chars(char* const _First, char* const _Last, const unsigned long _Value, +_EXPORT_STD _CONSTEXPR23 to_chars_result to_chars(char* const _First, char* const _Last, const unsigned long _Value, const int _Base = 10) noexcept /* strengthened */ { return _Integer_to_chars(_First, _Last, _Value, _Base); } -_CONSTEXPR23 to_chars_result to_chars( +_EXPORT_STD _CONSTEXPR23 to_chars_result to_chars( char* const _First, char* const _Last, const long long _Value, const int _Base = 10) noexcept /* strengthened */ { return _Integer_to_chars(_First, _Last, _Value, _Base); } -_CONSTEXPR23 to_chars_result to_chars(char* const _First, char* const _Last, const unsigned long long _Value, - const int _Base = 10) noexcept /* strengthened */ { +_EXPORT_STD _CONSTEXPR23 to_chars_result to_chars(char* const _First, char* const _Last, + const unsigned long long _Value, const int _Base = 10) noexcept /* strengthened */ { return _Integer_to_chars(_First, _Last, _Value, _Base); } -to_chars_result to_chars(char* _First, char* _Last, bool _Value, int _Base = 10) = delete; +_EXPORT_STD to_chars_result to_chars(char* _First, char* _Last, bool _Value, int _Base = 10) = delete; -struct from_chars_result { +_EXPORT_STD struct from_chars_result { const char* ptr; errc ec; #if _HAS_CXX20 @@ -309,48 +309,48 @@ _NODISCARD _CONSTEXPR23 from_chars_result _Integer_from_chars( return {_Next, errc{}}; } -_CONSTEXPR23 from_chars_result from_chars( +_EXPORT_STD _CONSTEXPR23 from_chars_result from_chars( const char* const _First, const char* const _Last, char& _Value, const int _Base = 10) noexcept /* strengthened */ { return _Integer_from_chars(_First, _Last, _Value, _Base); } -_CONSTEXPR23 from_chars_result from_chars(const char* const _First, const char* const _Last, signed char& _Value, - const int _Base = 10) noexcept /* strengthened */ { +_EXPORT_STD _CONSTEXPR23 from_chars_result from_chars(const char* const _First, const char* const _Last, + signed char& _Value, const int _Base = 10) noexcept /* strengthened */ { return _Integer_from_chars(_First, _Last, _Value, _Base); } -_CONSTEXPR23 from_chars_result from_chars(const char* const _First, const char* const _Last, unsigned char& _Value, - const int _Base = 10) noexcept /* strengthened */ { +_EXPORT_STD _CONSTEXPR23 from_chars_result from_chars(const char* const _First, const char* const _Last, + unsigned char& _Value, const int _Base = 10) noexcept /* strengthened */ { return _Integer_from_chars(_First, _Last, _Value, _Base); } -_CONSTEXPR23 from_chars_result from_chars(const char* const _First, const char* const _Last, short& _Value, +_EXPORT_STD _CONSTEXPR23 from_chars_result from_chars(const char* const _First, const char* const _Last, short& _Value, const int _Base = 10) noexcept /* strengthened */ { return _Integer_from_chars(_First, _Last, _Value, _Base); } -_CONSTEXPR23 from_chars_result from_chars(const char* const _First, const char* const _Last, unsigned short& _Value, - const int _Base = 10) noexcept /* strengthened */ { +_EXPORT_STD _CONSTEXPR23 from_chars_result from_chars(const char* const _First, const char* const _Last, + unsigned short& _Value, const int _Base = 10) noexcept /* strengthened */ { return _Integer_from_chars(_First, _Last, _Value, _Base); } -_CONSTEXPR23 from_chars_result from_chars( +_EXPORT_STD _CONSTEXPR23 from_chars_result from_chars( const char* const _First, const char* const _Last, int& _Value, const int _Base = 10) noexcept /* strengthened */ { return _Integer_from_chars(_First, _Last, _Value, _Base); } -_CONSTEXPR23 from_chars_result from_chars(const char* const _First, const char* const _Last, unsigned int& _Value, - const int _Base = 10) noexcept /* strengthened */ { +_EXPORT_STD _CONSTEXPR23 from_chars_result from_chars(const char* const _First, const char* const _Last, + unsigned int& _Value, const int _Base = 10) noexcept /* strengthened */ { return _Integer_from_chars(_First, _Last, _Value, _Base); } -_CONSTEXPR23 from_chars_result from_chars( +_EXPORT_STD _CONSTEXPR23 from_chars_result from_chars( const char* const _First, const char* const _Last, long& _Value, const int _Base = 10) noexcept /* strengthened */ { return _Integer_from_chars(_First, _Last, _Value, _Base); } -_CONSTEXPR23 from_chars_result from_chars(const char* const _First, const char* const _Last, unsigned long& _Value, - const int _Base = 10) noexcept /* strengthened */ { +_EXPORT_STD _CONSTEXPR23 from_chars_result from_chars(const char* const _First, const char* const _Last, + unsigned long& _Value, const int _Base = 10) noexcept /* strengthened */ { return _Integer_from_chars(_First, _Last, _Value, _Base); } -_CONSTEXPR23 from_chars_result from_chars(const char* const _First, const char* const _Last, long long& _Value, - const int _Base = 10) noexcept /* strengthened */ { +_EXPORT_STD _CONSTEXPR23 from_chars_result from_chars(const char* const _First, const char* const _Last, + long long& _Value, const int _Base = 10) noexcept /* strengthened */ { return _Integer_from_chars(_First, _Last, _Value, _Base); } -_CONSTEXPR23 from_chars_result from_chars(const char* const _First, const char* const _Last, unsigned long long& _Value, - const int _Base = 10) noexcept /* strengthened */ { +_EXPORT_STD _CONSTEXPR23 from_chars_result from_chars(const char* const _First, const char* const _Last, + unsigned long long& _Value, const int _Base = 10) noexcept /* strengthened */ { return _Integer_from_chars(_First, _Last, _Value, _Base); } @@ -1901,15 +1901,15 @@ _NODISCARD from_chars_result _Floating_from_chars( } } -inline from_chars_result from_chars(const char* const _First, const char* const _Last, float& _Value, +_EXPORT_STD inline from_chars_result from_chars(const char* const _First, const char* const _Last, float& _Value, const chars_format _Fmt = chars_format::general) noexcept /* strengthened */ { return _Floating_from_chars(_First, _Last, _Value, _Fmt); } -inline from_chars_result from_chars(const char* const _First, const char* const _Last, double& _Value, +_EXPORT_STD inline from_chars_result from_chars(const char* const _First, const char* const _Last, double& _Value, const chars_format _Fmt = chars_format::general) noexcept /* strengthened */ { return _Floating_from_chars(_First, _Last, _Value, _Fmt); } -inline from_chars_result from_chars(const char* const _First, const char* const _Last, long double& _Value, +_EXPORT_STD inline from_chars_result from_chars(const char* const _First, const char* const _Last, long double& _Value, const chars_format _Fmt = chars_format::general) noexcept /* strengthened */ { double _Dbl; // intentionally default-init const from_chars_result _Result = _Floating_from_chars(_First, _Last, _Dbl, _Fmt); @@ -2517,40 +2517,41 @@ _NODISCARD to_chars_result _Floating_to_chars( } } -inline to_chars_result to_chars(char* const _First, char* const _Last, const float _Value) noexcept /* strengthened */ { +_EXPORT_STD inline to_chars_result to_chars(char* const _First, char* const _Last, const float _Value) noexcept +/* strengthened */ { return _Floating_to_chars<_Floating_to_chars_overload::_Plain>(_First, _Last, _Value, chars_format{}, 0); } -inline to_chars_result to_chars(char* const _First, char* const _Last, const double _Value) noexcept +_EXPORT_STD inline to_chars_result to_chars(char* const _First, char* const _Last, const double _Value) noexcept /* strengthened */ { return _Floating_to_chars<_Floating_to_chars_overload::_Plain>(_First, _Last, _Value, chars_format{}, 0); } -inline to_chars_result to_chars(char* const _First, char* const _Last, const long double _Value) noexcept +_EXPORT_STD inline to_chars_result to_chars(char* const _First, char* const _Last, const long double _Value) noexcept /* strengthened */ { return _Floating_to_chars<_Floating_to_chars_overload::_Plain>( _First, _Last, static_cast(_Value), chars_format{}, 0); } -inline to_chars_result to_chars( +_EXPORT_STD inline to_chars_result to_chars( char* const _First, char* const _Last, const float _Value, const chars_format _Fmt) noexcept /* strengthened */ { return _Floating_to_chars<_Floating_to_chars_overload::_Format_only>(_First, _Last, _Value, _Fmt, 0); } -inline to_chars_result to_chars( +_EXPORT_STD inline to_chars_result to_chars( char* const _First, char* const _Last, const double _Value, const chars_format _Fmt) noexcept /* strengthened */ { return _Floating_to_chars<_Floating_to_chars_overload::_Format_only>(_First, _Last, _Value, _Fmt, 0); } -inline to_chars_result to_chars(char* const _First, char* const _Last, const long double _Value, +_EXPORT_STD inline to_chars_result to_chars(char* const _First, char* const _Last, const long double _Value, const chars_format _Fmt) noexcept /* strengthened */ { return _Floating_to_chars<_Floating_to_chars_overload::_Format_only>( _First, _Last, static_cast(_Value), _Fmt, 0); } -inline to_chars_result to_chars(char* const _First, char* const _Last, const float _Value, const chars_format _Fmt, - const int _Precision) noexcept /* strengthened */ { +_EXPORT_STD inline to_chars_result to_chars(char* const _First, char* const _Last, const float _Value, + const chars_format _Fmt, const int _Precision) noexcept /* strengthened */ { return _Floating_to_chars<_Floating_to_chars_overload::_Format_precision>(_First, _Last, _Value, _Fmt, _Precision); } -inline to_chars_result to_chars(char* const _First, char* const _Last, const double _Value, const chars_format _Fmt, - const int _Precision) noexcept /* strengthened */ { +_EXPORT_STD inline to_chars_result to_chars(char* const _First, char* const _Last, const double _Value, + const chars_format _Fmt, const int _Precision) noexcept /* strengthened */ { return _Floating_to_chars<_Floating_to_chars_overload::_Format_precision>(_First, _Last, _Value, _Fmt, _Precision); } -inline to_chars_result to_chars(char* const _First, char* const _Last, const long double _Value, +_EXPORT_STD inline to_chars_result to_chars(char* const _First, char* const _Last, const long double _Value, const chars_format _Fmt, const int _Precision) noexcept /* strengthened */ { return _Floating_to_chars<_Floating_to_chars_overload::_Format_precision>( _First, _Last, static_cast(_Value), _Fmt, _Precision); diff --git a/stl/inc/chrono b/stl/inc/chrono index 8607c41f40..cfe8898968 100644 --- a/stl/inc/chrono +++ b/stl/inc/chrono @@ -170,7 +170,7 @@ namespace chrono { } } - template + _EXPORT_STD template basic_ostream<_CharT, _Traits>& operator<<( basic_ostream<_CharT, _Traits>& _Os, const duration<_Rep, _Period>& _Dur) { basic_ostringstream<_CharT, _Traits> _Sstr; @@ -183,19 +183,17 @@ namespace chrono { return _Os << _Sstr.str(); } - struct local_t {}; + _EXPORT_STD struct local_t {}; - template - using local_time = time_point; - using local_seconds = local_time; - using local_days = local_time; + _EXPORT_STD template + using local_time = time_point; + _EXPORT_STD using local_seconds = local_time; + _EXPORT_STD using local_days = local_time; - struct last_spec { - explicit last_spec() = default; - }; - inline constexpr last_spec last{}; + _EXPORT_STD struct last_spec { explicit last_spec() = default; }; + _EXPORT_STD inline constexpr last_spec last{}; - class day { + _EXPORT_STD class day { public: day() = default; constexpr explicit day(unsigned int _Val) noexcept : _Day{static_cast(_Val)} {} @@ -235,28 +233,28 @@ namespace chrono { unsigned char _Day; }; - _NODISCARD constexpr bool operator==(const day& _Left, const day& _Right) noexcept { + _EXPORT_STD _NODISCARD constexpr bool operator==(const day& _Left, const day& _Right) noexcept { return static_cast(_Left) == static_cast(_Right); } - _NODISCARD constexpr strong_ordering operator<=>(const day& _Left, const day& _Right) noexcept { + _EXPORT_STD _NODISCARD constexpr strong_ordering operator<=>(const day& _Left, const day& _Right) noexcept { return static_cast(_Left) <=> static_cast(_Right); } - _NODISCARD constexpr day operator+(const day& _Left, const days& _Right) noexcept { + _EXPORT_STD _NODISCARD constexpr day operator+(const day& _Left, const days& _Right) noexcept { return day{static_cast(_Left) + _Right.count()}; } - _NODISCARD constexpr day operator+(const days& _Left, const day& _Right) noexcept { + _EXPORT_STD _NODISCARD constexpr day operator+(const days& _Left, const day& _Right) noexcept { return _Right + _Left; } - _NODISCARD constexpr day operator-(const day& _Left, const days& _Right) noexcept { + _EXPORT_STD _NODISCARD constexpr day operator-(const day& _Left, const days& _Right) noexcept { return day{static_cast(_Left) - _Right.count()}; } - _NODISCARD constexpr days operator-(const day& _Left, const day& _Right) noexcept { + _EXPORT_STD _NODISCARD constexpr days operator-(const day& _Left, const day& _Right) noexcept { return days{ static_cast(static_cast(_Left)) - static_cast(static_cast(_Right))}; } - class month { + _EXPORT_STD class month { public: month() = default; constexpr explicit month(unsigned int _Val) noexcept : _Month{static_cast(_Val)} {} @@ -294,25 +292,25 @@ namespace chrono { unsigned char _Month; }; - _NODISCARD constexpr bool operator==(const month& _Left, const month& _Right) noexcept { + _EXPORT_STD _NODISCARD constexpr bool operator==(const month& _Left, const month& _Right) noexcept { return static_cast(_Left) == static_cast(_Right); } - _NODISCARD constexpr strong_ordering operator<=>(const month& _Left, const month& _Right) noexcept { + _EXPORT_STD _NODISCARD constexpr strong_ordering operator<=>(const month& _Left, const month& _Right) noexcept { return static_cast(_Left) <=> static_cast(_Right); } - _NODISCARD constexpr month operator+(const month& _Left, const months& _Right) noexcept { + _EXPORT_STD _NODISCARD constexpr month operator+(const month& _Left, const months& _Right) noexcept { const auto _Mo = static_cast(static_cast(_Left)) + (_Right.count() - 1); const auto _Div = (_Mo >= 0 ? _Mo : _Mo - 11) / 12; return month{static_cast(_Mo - _Div * 12 + 1)}; } - _NODISCARD constexpr month operator+(const months& _Left, const month& _Right) noexcept { + _EXPORT_STD _NODISCARD constexpr month operator+(const months& _Left, const month& _Right) noexcept { return _Right + _Left; } - _NODISCARD constexpr month operator-(const month& _Left, const months& _Right) noexcept { + _EXPORT_STD _NODISCARD constexpr month operator-(const month& _Left, const months& _Right) noexcept { return _Left + -_Right; } - _NODISCARD constexpr months operator-(const month& _Left, const month& _Right) noexcept { + _EXPORT_STD _NODISCARD constexpr months operator-(const month& _Left, const month& _Right) noexcept { const auto _Mo = static_cast(_Left) - static_cast(_Right); return months{_Mo <= 11 ? _Mo : _Mo + 12}; } @@ -326,7 +324,7 @@ namespace chrono { return *this; } - class year { + _EXPORT_STD class year { public: year() = default; constexpr explicit year(int _Val) noexcept : _Year{static_cast(_Val)} {} @@ -395,30 +393,30 @@ namespace chrono { static constexpr int _Year_max = 32767; }; - _NODISCARD constexpr bool operator==(const year& _Left, const year& _Right) noexcept { + _EXPORT_STD _NODISCARD constexpr bool operator==(const year& _Left, const year& _Right) noexcept { return static_cast(_Left) == static_cast(_Right); } - _NODISCARD constexpr strong_ordering operator<=>(const year& _Left, const year& _Right) noexcept { + _EXPORT_STD _NODISCARD constexpr strong_ordering operator<=>(const year& _Left, const year& _Right) noexcept { return static_cast(_Left) <=> static_cast(_Right); } - _NODISCARD constexpr year operator+(const year& _Left, const years& _Right) noexcept { + _EXPORT_STD _NODISCARD constexpr year operator+(const year& _Left, const years& _Right) noexcept { return year{static_cast(_Left) + _Right.count()}; } - _NODISCARD constexpr year operator+(const years& _Left, const year& _Right) noexcept { + _EXPORT_STD _NODISCARD constexpr year operator+(const years& _Left, const year& _Right) noexcept { return _Right + _Left; } - _NODISCARD constexpr year operator-(const year& _Left, const years& _Right) noexcept { + _EXPORT_STD _NODISCARD constexpr year operator-(const year& _Left, const years& _Right) noexcept { return _Left + -_Right; } - _NODISCARD constexpr years operator-(const year& _Left, const year& _Right) noexcept { + _EXPORT_STD _NODISCARD constexpr years operator-(const year& _Left, const year& _Right) noexcept { return years{static_cast(_Left) - static_cast(_Right)}; } - class weekday_indexed; - class weekday_last; + _EXPORT_STD class weekday_indexed; + _EXPORT_STD class weekday_last; - class weekday { + _EXPORT_STD class weekday { public: weekday() = default; constexpr explicit weekday(unsigned int _Val) noexcept @@ -471,22 +469,22 @@ namespace chrono { } }; - _NODISCARD constexpr bool operator==(const weekday& _Left, const weekday& _Right) noexcept { + _EXPORT_STD _NODISCARD constexpr bool operator==(const weekday& _Left, const weekday& _Right) noexcept { return _Left.c_encoding() == _Right.c_encoding(); } - _NODISCARD constexpr weekday operator+(const weekday& _Left, const days& _Right) noexcept { + _EXPORT_STD _NODISCARD constexpr weekday operator+(const weekday& _Left, const days& _Right) noexcept { const auto _Wd = static_cast(_Left.c_encoding()) + _Right.count(); const auto _Div = (_Wd >= 0 ? _Wd : _Wd - 6) / 7; return weekday{static_cast(_Wd - _Div * 7)}; } - _NODISCARD constexpr weekday operator+(const days& _Left, const weekday& _Right) noexcept { + _EXPORT_STD _NODISCARD constexpr weekday operator+(const days& _Left, const weekday& _Right) noexcept { return _Right + _Left; } - _NODISCARD constexpr weekday operator-(const weekday& _Left, const days& _Right) noexcept { + _EXPORT_STD _NODISCARD constexpr weekday operator-(const weekday& _Left, const days& _Right) noexcept { return _Left + -_Right; } - _NODISCARD constexpr days operator-(const weekday& _Left, const weekday& _Right) noexcept { + _EXPORT_STD _NODISCARD constexpr days operator-(const weekday& _Left, const weekday& _Right) noexcept { const auto _Wd = _Left.c_encoding() - _Right.c_encoding(); const auto _Wk = _Wd <= 6 ? _Wd : _Wd + 7; return days{_Wk}; @@ -501,7 +499,7 @@ namespace chrono { return *this; } - class weekday_indexed { + _EXPORT_STD class weekday_indexed { public: weekday_indexed() = default; constexpr weekday_indexed(const weekday& _Wd, unsigned int _Idx) noexcept @@ -522,11 +520,12 @@ namespace chrono { unsigned char _Index; }; - _NODISCARD constexpr bool operator==(const weekday_indexed& _Left, const weekday_indexed& _Right) noexcept { + _EXPORT_STD _NODISCARD constexpr bool operator==( + const weekday_indexed& _Left, const weekday_indexed& _Right) noexcept { return _Left.weekday() == _Right.weekday() && _Left.index() == _Right.index(); } - class weekday_last { + _EXPORT_STD class weekday_last { public: constexpr explicit weekday_last(const weekday& _Wd) noexcept : _Weekday{_Wd} {} @@ -541,7 +540,7 @@ namespace chrono { _CHRONO weekday _Weekday; }; - _NODISCARD constexpr bool operator==(const weekday_last& _Left, const weekday_last& _Right) noexcept { + _EXPORT_STD _NODISCARD constexpr bool operator==(const weekday_last& _Left, const weekday_last& _Right) noexcept { return _Left.weekday() == _Right.weekday(); } @@ -552,7 +551,7 @@ namespace chrono { return weekday_last{*this}; } - class month_day { + _EXPORT_STD class month_day { public: month_day() = default; constexpr month_day(const month& _Month_, const day& _Day_) noexcept : _Month{_Month_}, _Day{_Day_} {} @@ -585,10 +584,11 @@ namespace chrono { _CHRONO day _Day; }; - _NODISCARD constexpr bool operator==(const month_day& _Left, const month_day& _Right) noexcept { + _EXPORT_STD _NODISCARD constexpr bool operator==(const month_day& _Left, const month_day& _Right) noexcept { return _Left.month() == _Right.month() && _Left.day() == _Right.day(); } - _NODISCARD constexpr strong_ordering operator<=>(const month_day& _Left, const month_day& _Right) noexcept { + _EXPORT_STD _NODISCARD constexpr strong_ordering operator<=>( + const month_day& _Left, const month_day& _Right) noexcept { const auto _Comp = _Left.month() <=> _Right.month(); if (_Comp != 0) { return _Comp; @@ -597,7 +597,7 @@ namespace chrono { return _Left.day() <=> _Right.day(); } - class month_day_last { + _EXPORT_STD class month_day_last { public: constexpr explicit month_day_last(const month& _Month_) noexcept : _Month{_Month_} {} @@ -612,15 +612,16 @@ namespace chrono { _CHRONO month _Month; }; - _NODISCARD constexpr bool operator==(const month_day_last& _Left, const month_day_last& _Right) noexcept { + _EXPORT_STD _NODISCARD constexpr bool operator==( + const month_day_last& _Left, const month_day_last& _Right) noexcept { return _Left.month() == _Right.month(); } - _NODISCARD constexpr strong_ordering operator<=>( + _EXPORT_STD _NODISCARD constexpr strong_ordering operator<=>( const month_day_last& _Left, const month_day_last& _Right) noexcept { return _Left.month() <=> _Right.month(); } - class month_weekday { + _EXPORT_STD class month_weekday { public: constexpr month_weekday(const month& _Month_, const weekday_indexed& _Wdi) noexcept : _Month{_Month_}, _Weekday_index{_Wdi} {} @@ -641,11 +642,11 @@ namespace chrono { _CHRONO weekday_indexed _Weekday_index; }; - _NODISCARD constexpr bool operator==(const month_weekday& _Left, const month_weekday& _Right) noexcept { + _EXPORT_STD _NODISCARD constexpr bool operator==(const month_weekday& _Left, const month_weekday& _Right) noexcept { return _Left.month() == _Right.month() && _Left.weekday_indexed() == _Right.weekday_indexed(); } - class month_weekday_last { + _EXPORT_STD class month_weekday_last { public: constexpr month_weekday_last(const month& _Month_, const weekday_last& _Wdl) noexcept : _Month{_Month_}, _Weekday_last{_Wdl} {} @@ -665,11 +666,12 @@ namespace chrono { _CHRONO weekday_last _Weekday_last; }; - _NODISCARD constexpr bool operator==(const month_weekday_last& _Left, const month_weekday_last& _Right) noexcept { + _EXPORT_STD _NODISCARD constexpr bool operator==( + const month_weekday_last& _Left, const month_weekday_last& _Right) noexcept { return _Left.month() == _Right.month() && _Left.weekday_last() == _Right.weekday_last(); } - class year_month { + _EXPORT_STD class year_month { public: year_month() = default; constexpr year_month(const year& _Year_, const month& _Month_) noexcept : _Year{_Year_}, _Month{_Month_} {} @@ -697,10 +699,11 @@ namespace chrono { _CHRONO month _Month; }; - _NODISCARD constexpr bool operator==(const year_month& _Left, const year_month& _Right) noexcept { + _EXPORT_STD _NODISCARD constexpr bool operator==(const year_month& _Left, const year_month& _Right) noexcept { return _Left.year() == _Right.year() && _Left.month() == _Right.month(); } - _NODISCARD constexpr strong_ordering operator<=>(const year_month& _Left, const year_month& _Right) noexcept { + _EXPORT_STD _NODISCARD constexpr strong_ordering operator<=>( + const year_month& _Left, const year_month& _Right) noexcept { const auto _Comp = _Left.year() <=> _Right.year(); if (_Comp != 0) { return _Comp; @@ -709,37 +712,37 @@ namespace chrono { return _Left.month() <=> _Right.month(); } - template + _EXPORT_STD template _NODISCARD constexpr year_month operator+(const year_month& _Left, const months& _Right) noexcept { const auto _Mo = static_cast(static_cast(_Left.month())) + (_Right.count() - 1); const auto _Div = (_Mo >= 0 ? _Mo : _Mo - 11) / 12; return year_month{_Left.year() + years{_Div}, month{static_cast(_Mo - _Div * 12 + 1)}}; } - template + _EXPORT_STD template _NODISCARD constexpr year_month operator+(const months& _Left, const year_month& _Right) noexcept { return _Right + _Left; } - template + _EXPORT_STD template _NODISCARD constexpr year_month operator-(const year_month& _Left, const months& _Right) noexcept { return _Left + -_Right; } - _NODISCARD constexpr months operator-(const year_month& _Left, const year_month& _Right) noexcept { + _EXPORT_STD _NODISCARD constexpr months operator-(const year_month& _Left, const year_month& _Right) noexcept { return _Left.year() - _Right.year() + months{static_cast(static_cast(_Left.month())) - static_cast(static_cast(_Right.month()))}; } - _NODISCARD constexpr year_month operator+(const year_month& _Left, const years& _Right) noexcept { + _EXPORT_STD _NODISCARD constexpr year_month operator+(const year_month& _Left, const years& _Right) noexcept { return {year{_Left.year() + _Right}, _Left.month()}; } - _NODISCARD constexpr year_month operator+(const years& _Left, const year_month& _Right) noexcept { + _EXPORT_STD _NODISCARD constexpr year_month operator+(const years& _Left, const year_month& _Right) noexcept { return _Right + _Left; } - _NODISCARD constexpr year_month operator-(const year_month& _Left, const years& _Right) noexcept { + _EXPORT_STD _NODISCARD constexpr year_month operator-(const year_month& _Left, const years& _Right) noexcept { return _Left + -_Right; } @@ -774,9 +777,9 @@ namespace chrono { return _Last_day_table[(static_cast(_Month) - 1) & 0xF]; } - class year_month_day_last; + _EXPORT_STD class year_month_day_last; - class year_month_day { + _EXPORT_STD class year_month_day { public: year_month_day() = default; constexpr year_month_day(const year& _Year_, const month& _Month_, const day& _Day_) noexcept @@ -988,10 +991,11 @@ namespace chrono { } }; - _NODISCARD constexpr bool operator==(const year_month_day& _Left, const year_month_day& _Right) noexcept { + _EXPORT_STD _NODISCARD constexpr bool operator==( + const year_month_day& _Left, const year_month_day& _Right) noexcept { return _Left.year() == _Right.year() && _Left.month() == _Right.month() && _Left.day() == _Right.day(); } - _NODISCARD constexpr strong_ordering operator<=>( + _EXPORT_STD _NODISCARD constexpr strong_ordering operator<=>( const year_month_day& _Left, const year_month_day& _Right) noexcept { auto _Comp = _Left.year() <=> _Right.year(); if (_Comp != 0) { @@ -1006,31 +1010,34 @@ namespace chrono { return _Left.day() <=> _Right.day(); } - template + _EXPORT_STD template _NODISCARD constexpr year_month_day operator+(const year_month_day& _Left, const months& _Right) noexcept { const auto _Ym = year_month{_Left.year(), _Left.month()} + _Right; return {_Ym.year(), _Ym.month(), _Left.day()}; } - template + _EXPORT_STD template _NODISCARD constexpr year_month_day operator+(const months& _Left, const year_month_day& _Right) noexcept { return _Right + _Left; } - template + _EXPORT_STD template _NODISCARD constexpr year_month_day operator-(const year_month_day& _Left, const months& _Right) noexcept { return _Left + -_Right; } - _NODISCARD constexpr year_month_day operator+(const year_month_day& _Left, const years& _Right) noexcept { + _EXPORT_STD _NODISCARD constexpr year_month_day operator+( + const year_month_day& _Left, const years& _Right) noexcept { return {_Left.year() + _Right, _Left.month(), _Left.day()}; } - _NODISCARD constexpr year_month_day operator+(const years& _Left, const year_month_day& _Right) noexcept { + _EXPORT_STD _NODISCARD constexpr year_month_day operator+( + const years& _Left, const year_month_day& _Right) noexcept { return _Right + _Left; } - _NODISCARD constexpr year_month_day operator-(const year_month_day& _Left, const years& _Right) noexcept { + _EXPORT_STD _NODISCARD constexpr year_month_day operator-( + const year_month_day& _Left, const years& _Right) noexcept { return _Left + -_Right; } @@ -1053,7 +1060,7 @@ namespace chrono { return *this; } - class year_month_day_last { + _EXPORT_STD class year_month_day_last { public: constexpr year_month_day_last(const year& _Year_, const month_day_last& _Mdl) noexcept : _Year{_Year_}, _Month_day_last{_Mdl} {} @@ -1093,10 +1100,11 @@ namespace chrono { _CHRONO month_day_last _Month_day_last; }; - _NODISCARD constexpr bool operator==(const year_month_day_last& _Left, const year_month_day_last& _Right) noexcept { + _EXPORT_STD _NODISCARD constexpr bool operator==( + const year_month_day_last& _Left, const year_month_day_last& _Right) noexcept { return _Left.year() == _Right.year() && _Left.month_day_last() == _Right.month_day_last(); } - _NODISCARD constexpr strong_ordering operator<=>( + _EXPORT_STD _NODISCARD constexpr strong_ordering operator<=>( const year_month_day_last& _Left, const year_month_day_last& _Right) noexcept { const auto _Comp = _Left.year() <=> _Right.year(); if (_Comp != 0) { @@ -1106,31 +1114,34 @@ namespace chrono { return _Left.month_day_last() <=> _Right.month_day_last(); } - template + _EXPORT_STD template _NODISCARD constexpr year_month_day_last operator+( const year_month_day_last& _Left, const months& _Right) noexcept { const auto _Ym = year_month{_Left.year(), _Left.month()} + _Right; return {_Ym.year(), month_day_last{_Ym.month()}}; } - template + _EXPORT_STD template _NODISCARD constexpr year_month_day_last operator+( const months& _Left, const year_month_day_last& _Right) noexcept { return _Right + _Left; } - template + _EXPORT_STD template _NODISCARD constexpr year_month_day_last operator-( const year_month_day_last& _Left, const months& _Right) noexcept { return _Left + -_Right; } - _NODISCARD constexpr year_month_day_last operator+(const year_month_day_last& _Left, const years& _Right) noexcept { + _EXPORT_STD _NODISCARD constexpr year_month_day_last operator+( + const year_month_day_last& _Left, const years& _Right) noexcept { return {_Left.year() + _Right, _Left.month_day_last()}; } - _NODISCARD constexpr year_month_day_last operator+(const years& _Left, const year_month_day_last& _Right) noexcept { + _EXPORT_STD _NODISCARD constexpr year_month_day_last operator+( + const years& _Left, const year_month_day_last& _Right) noexcept { return _Right + _Left; } - _NODISCARD constexpr year_month_day_last operator-(const year_month_day_last& _Left, const years& _Right) noexcept { + _EXPORT_STD _NODISCARD constexpr year_month_day_last operator-( + const year_month_day_last& _Left, const years& _Right) noexcept { return _Left + -_Right; } @@ -1156,7 +1167,7 @@ namespace chrono { constexpr year_month_day::year_month_day(const year_month_day_last& _Ymdl) noexcept : _Year{_Ymdl.year()}, _Month{_Ymdl.month()}, _Day{_Ymdl.day()} {} - class year_month_weekday { + _EXPORT_STD class year_month_weekday { public: year_month_weekday() = default; constexpr year_month_weekday(const year& _Year_, const month& _Month_, const weekday_indexed& _Wdi) noexcept @@ -1228,34 +1239,38 @@ namespace chrono { } }; - _NODISCARD constexpr bool operator==(const year_month_weekday& _Left, const year_month_weekday& _Right) noexcept { + _EXPORT_STD _NODISCARD constexpr bool operator==( + const year_month_weekday& _Left, const year_month_weekday& _Right) noexcept { return _Left.year() == _Right.year() && _Left.month() == _Right.month() && _Left.weekday_indexed() == _Right.weekday_indexed(); } - template + _EXPORT_STD template _NODISCARD constexpr year_month_weekday operator+(const year_month_weekday& _Left, const months& _Right) noexcept { const auto _Ym = year_month{_Left.year(), _Left.month()} + _Right; return {_Ym.year(), _Ym.month(), _Left.weekday_indexed()}; } - template + _EXPORT_STD template _NODISCARD constexpr year_month_weekday operator+(const months& _Left, const year_month_weekday& _Right) noexcept { return _Right + _Left; } - template + _EXPORT_STD template _NODISCARD constexpr year_month_weekday operator-(const year_month_weekday& _Left, const months& _Right) noexcept { return _Left + -_Right; } - _NODISCARD constexpr year_month_weekday operator+(const year_month_weekday& _Left, const years& _Right) noexcept { + _EXPORT_STD _NODISCARD constexpr year_month_weekday operator+( + const year_month_weekday& _Left, const years& _Right) noexcept { return year_month_weekday{_Left.year() + _Right, _Left.month(), _Left.weekday_indexed()}; } - _NODISCARD constexpr year_month_weekday operator+(const years& _Left, const year_month_weekday& _Right) noexcept { + _EXPORT_STD _NODISCARD constexpr year_month_weekday operator+( + const years& _Left, const year_month_weekday& _Right) noexcept { return _Right + _Left; } - _NODISCARD constexpr year_month_weekday operator-(const year_month_weekday& _Left, const years& _Right) noexcept { + _EXPORT_STD _NODISCARD constexpr year_month_weekday operator-( + const year_month_weekday& _Left, const years& _Right) noexcept { return _Left + -_Right; } @@ -1278,7 +1293,7 @@ namespace chrono { return *this; } - class year_month_weekday_last { + _EXPORT_STD class year_month_weekday_last { public: constexpr year_month_weekday_last(const year& _Year_, const month& _Month_, const weekday_last& _Wdl) noexcept : _Year{_Year_}, _Month{_Month_}, _Weekday_last{_Wdl} {} @@ -1322,40 +1337,40 @@ namespace chrono { _CHRONO weekday_last _Weekday_last; }; - _NODISCARD constexpr bool operator==( + _EXPORT_STD _NODISCARD constexpr bool operator==( const year_month_weekday_last& _Left, const year_month_weekday_last& _Right) noexcept { return _Left.year() == _Right.year() && _Left.month() == _Right.month() && _Left.weekday_last() == _Right.weekday_last(); } - template + _EXPORT_STD template _NODISCARD constexpr year_month_weekday_last operator+( const year_month_weekday_last& _Left, const months& _Right) noexcept { const auto _Ym = year_month{_Left.year(), _Left.month()} + _Right; return {_Ym.year(), _Ym.month(), _Left.weekday_last()}; } - template + _EXPORT_STD template _NODISCARD constexpr year_month_weekday_last operator+( const months& _Left, const year_month_weekday_last& _Right) noexcept { return _Right + _Left; } - template + _EXPORT_STD template _NODISCARD constexpr year_month_weekday_last operator-( const year_month_weekday_last& _Left, const months& _Right) noexcept { return _Left + -_Right; } - _NODISCARD constexpr year_month_weekday_last operator+( + _EXPORT_STD _NODISCARD constexpr year_month_weekday_last operator+( const year_month_weekday_last& _Left, const years& _Right) noexcept { return {_Left.year() + _Right, _Left.month(), _Left.weekday_last()}; } - _NODISCARD constexpr year_month_weekday_last operator+( + _EXPORT_STD _NODISCARD constexpr year_month_weekday_last operator+( const years& _Left, const year_month_weekday_last& _Right) noexcept { return _Right + _Left; } - _NODISCARD constexpr year_month_weekday_last operator-( + _EXPORT_STD _NODISCARD constexpr year_month_weekday_last operator-( const year_month_weekday_last& _Left, const years& _Right) noexcept { return _Left + -_Right; } @@ -1380,150 +1395,162 @@ namespace chrono { } // Civil calendar conventional syntax operators - _NODISCARD constexpr year_month operator/(const year& _Year, const month& _Month) noexcept { + _EXPORT_STD _NODISCARD constexpr year_month operator/(const year& _Year, const month& _Month) noexcept { return {_Year, _Month}; } - _NODISCARD constexpr year_month operator/(const year& _Year, int _Month) noexcept { + _EXPORT_STD _NODISCARD constexpr year_month operator/(const year& _Year, int _Month) noexcept { return _Year / month{static_cast(_Month)}; } - _NODISCARD constexpr month_day operator/(const month& _Month, const day& _Day) noexcept { + _EXPORT_STD _NODISCARD constexpr month_day operator/(const month& _Month, const day& _Day) noexcept { return {_Month, _Day}; } - _NODISCARD constexpr month_day operator/(const month& _Month, int _Day) noexcept { + _EXPORT_STD _NODISCARD constexpr month_day operator/(const month& _Month, int _Day) noexcept { return _Month / day{static_cast(_Day)}; } - _NODISCARD constexpr month_day operator/(int _Month, const day& _Day) noexcept { + _EXPORT_STD _NODISCARD constexpr month_day operator/(int _Month, const day& _Day) noexcept { return month{static_cast(_Month)} / _Day; } - _NODISCARD constexpr month_day operator/(const day& _Day, const month& _Month) noexcept { + _EXPORT_STD _NODISCARD constexpr month_day operator/(const day& _Day, const month& _Month) noexcept { return _Month / _Day; } - _NODISCARD constexpr month_day operator/(const day& _Day, int _Month) noexcept { + _EXPORT_STD _NODISCARD constexpr month_day operator/(const day& _Day, int _Month) noexcept { return month{static_cast(_Month)} / _Day; } - _NODISCARD constexpr month_day_last operator/(const month& _Month, last_spec) noexcept { + _EXPORT_STD _NODISCARD constexpr month_day_last operator/(const month& _Month, last_spec) noexcept { return month_day_last{_Month}; } - _NODISCARD constexpr month_day_last operator/(int _Month, last_spec) noexcept { + _EXPORT_STD _NODISCARD constexpr month_day_last operator/(int _Month, last_spec) noexcept { return month{static_cast(_Month)} / last; } - _NODISCARD constexpr month_day_last operator/(last_spec, const month& _Month) noexcept { + _EXPORT_STD _NODISCARD constexpr month_day_last operator/(last_spec, const month& _Month) noexcept { return _Month / last; } - _NODISCARD constexpr month_day_last operator/(last_spec, int _Month) noexcept { + _EXPORT_STD _NODISCARD constexpr month_day_last operator/(last_spec, int _Month) noexcept { return month{static_cast(_Month)} / last; } - _NODISCARD constexpr month_weekday operator/(const month& _Month, const weekday_indexed& _Wdi) noexcept { + _EXPORT_STD _NODISCARD constexpr month_weekday operator/( + const month& _Month, const weekday_indexed& _Wdi) noexcept { return {_Month, _Wdi}; } - _NODISCARD constexpr month_weekday operator/(int _Month, const weekday_indexed& _Wdi) noexcept { + _EXPORT_STD _NODISCARD constexpr month_weekday operator/(int _Month, const weekday_indexed& _Wdi) noexcept { return month{static_cast(_Month)} / _Wdi; } - _NODISCARD constexpr month_weekday operator/(const weekday_indexed& _Wdi, const month& _Month) noexcept { + _EXPORT_STD _NODISCARD constexpr month_weekday operator/( + const weekday_indexed& _Wdi, const month& _Month) noexcept { return _Month / _Wdi; } - _NODISCARD constexpr month_weekday operator/(const weekday_indexed& _Wdi, int _Month) noexcept { + _EXPORT_STD _NODISCARD constexpr month_weekday operator/(const weekday_indexed& _Wdi, int _Month) noexcept { return month{static_cast(_Month)} / _Wdi; } - _NODISCARD constexpr month_weekday_last operator/(const month& _Month, const weekday_last& _Wdl) noexcept { + _EXPORT_STD _NODISCARD constexpr month_weekday_last operator/( + const month& _Month, const weekday_last& _Wdl) noexcept { return {_Month, _Wdl}; } - _NODISCARD constexpr month_weekday_last operator/(int _Month, const weekday_last& _Wdl) noexcept { + _EXPORT_STD _NODISCARD constexpr month_weekday_last operator/(int _Month, const weekday_last& _Wdl) noexcept { return month{static_cast(_Month)} / _Wdl; } - _NODISCARD constexpr month_weekday_last operator/(const weekday_last& _Wdl, const month& _Month) noexcept { + _EXPORT_STD _NODISCARD constexpr month_weekday_last operator/( + const weekday_last& _Wdl, const month& _Month) noexcept { return _Month / _Wdl; } - _NODISCARD constexpr month_weekday_last operator/(const weekday_last& _Wdl, int _Month) noexcept { + _EXPORT_STD _NODISCARD constexpr month_weekday_last operator/(const weekday_last& _Wdl, int _Month) noexcept { return month{static_cast(_Month)} / _Wdl; } - _NODISCARD constexpr year_month_day operator/(const year_month& _Ym, const day& _Day) noexcept { + _EXPORT_STD _NODISCARD constexpr year_month_day operator/(const year_month& _Ym, const day& _Day) noexcept { return {_Ym.year(), _Ym.month(), _Day}; } - _NODISCARD constexpr year_month_day operator/(const year_month& _Ym, int _Day) noexcept { + _EXPORT_STD _NODISCARD constexpr year_month_day operator/(const year_month& _Ym, int _Day) noexcept { return _Ym / day{static_cast(_Day)}; } - _NODISCARD constexpr year_month_day operator/(const year& _Year, const month_day& _Md) noexcept { + _EXPORT_STD _NODISCARD constexpr year_month_day operator/(const year& _Year, const month_day& _Md) noexcept { return _Year / _Md.month() / _Md.day(); } - _NODISCARD constexpr year_month_day operator/(int _Year, const month_day& _Md) noexcept { + _EXPORT_STD _NODISCARD constexpr year_month_day operator/(int _Year, const month_day& _Md) noexcept { return year{_Year} / _Md.month() / _Md.day(); } - _NODISCARD constexpr year_month_day operator/(const month_day& _Md, const year& _Year) noexcept { + _EXPORT_STD _NODISCARD constexpr year_month_day operator/(const month_day& _Md, const year& _Year) noexcept { return _Year / _Md.month() / _Md.day(); } - _NODISCARD constexpr year_month_day operator/(const month_day& _Md, int _Year) noexcept { + _EXPORT_STD _NODISCARD constexpr year_month_day operator/(const month_day& _Md, int _Year) noexcept { return year{_Year} / _Md.month() / _Md.day(); } - _NODISCARD constexpr year_month_day_last operator/(const year_month& _Ym, last_spec) noexcept { + _EXPORT_STD _NODISCARD constexpr year_month_day_last operator/(const year_month& _Ym, last_spec) noexcept { return {_Ym.year(), month_day_last{_Ym.month()}}; } - _NODISCARD constexpr year_month_day_last operator/(const year& _Year, const month_day_last& _Mdl) noexcept { + _EXPORT_STD _NODISCARD constexpr year_month_day_last operator/( + const year& _Year, const month_day_last& _Mdl) noexcept { return {_Year, _Mdl}; } - _NODISCARD constexpr year_month_day_last operator/(int _Year, const month_day_last& _Mdl) noexcept { + _EXPORT_STD _NODISCARD constexpr year_month_day_last operator/(int _Year, const month_day_last& _Mdl) noexcept { return year{_Year} / _Mdl; } - _NODISCARD constexpr year_month_day_last operator/(const month_day_last& _Mdl, const year& _Year) noexcept { + _EXPORT_STD _NODISCARD constexpr year_month_day_last operator/( + const month_day_last& _Mdl, const year& _Year) noexcept { return _Year / _Mdl; } - _NODISCARD constexpr year_month_day_last operator/(const month_day_last& _Mdl, int _Year) noexcept { + _EXPORT_STD _NODISCARD constexpr year_month_day_last operator/(const month_day_last& _Mdl, int _Year) noexcept { return year{_Year} / _Mdl; } - _NODISCARD constexpr year_month_weekday operator/(const year_month& _Ym, const weekday_indexed& _Wdi) noexcept { + _EXPORT_STD _NODISCARD constexpr year_month_weekday operator/( + const year_month& _Ym, const weekday_indexed& _Wdi) noexcept { return year_month_weekday{_Ym.year(), _Ym.month(), _Wdi}; } - _NODISCARD constexpr year_month_weekday operator/(const year& _Year, const month_weekday& _Mwd) noexcept { + _EXPORT_STD _NODISCARD constexpr year_month_weekday operator/( + const year& _Year, const month_weekday& _Mwd) noexcept { return year_month_weekday{_Year, _Mwd.month(), _Mwd.weekday_indexed()}; } - _NODISCARD constexpr year_month_weekday operator/(int _Year, const month_weekday& _Mwd) noexcept { + _EXPORT_STD _NODISCARD constexpr year_month_weekday operator/(int _Year, const month_weekday& _Mwd) noexcept { return year{_Year} / _Mwd; } - _NODISCARD constexpr year_month_weekday operator/(const month_weekday& _Mwd, const year& _Year) noexcept { + _EXPORT_STD _NODISCARD constexpr year_month_weekday operator/( + const month_weekday& _Mwd, const year& _Year) noexcept { return _Year / _Mwd; } - _NODISCARD constexpr year_month_weekday operator/(const month_weekday& _Mwd, int _Year) noexcept { + _EXPORT_STD _NODISCARD constexpr year_month_weekday operator/(const month_weekday& _Mwd, int _Year) noexcept { return year{_Year} / _Mwd; } - _NODISCARD constexpr year_month_weekday_last operator/(const year_month& _Ym, const weekday_last& _Wdl) noexcept { + _EXPORT_STD _NODISCARD constexpr year_month_weekday_last operator/( + const year_month& _Ym, const weekday_last& _Wdl) noexcept { return {_Ym.year(), _Ym.month(), _Wdl}; } - _NODISCARD constexpr year_month_weekday_last operator/( + _EXPORT_STD _NODISCARD constexpr year_month_weekday_last operator/( const year& _Year, const month_weekday_last& _Mwdl) noexcept { return {_Year, _Mwdl.month(), _Mwdl.weekday_last()}; } - _NODISCARD constexpr year_month_weekday_last operator/(int _Year, const month_weekday_last& _Mwdl) noexcept { + _EXPORT_STD _NODISCARD constexpr year_month_weekday_last operator/( + int _Year, const month_weekday_last& _Mwdl) noexcept { return year{_Year} / _Mwdl; } - _NODISCARD constexpr year_month_weekday_last operator/( + _EXPORT_STD _NODISCARD constexpr year_month_weekday_last operator/( const month_weekday_last& _Mwdl, const year& _Year) noexcept { return _Year / _Mwdl; } - _NODISCARD constexpr year_month_weekday_last operator/(const month_weekday_last& _Mwdl, int _Year) noexcept { + _EXPORT_STD _NODISCARD constexpr year_month_weekday_last operator/( + const month_weekday_last& _Mwdl, int _Year) noexcept { return year{_Year} / _Mwdl; } // Calendrical constants - inline constexpr weekday Sunday{0}; - inline constexpr weekday Monday{1}; - inline constexpr weekday Tuesday{2}; - inline constexpr weekday Wednesday{3}; - inline constexpr weekday Thursday{4}; - inline constexpr weekday Friday{5}; - inline constexpr weekday Saturday{6}; - - inline constexpr month January{1}; - inline constexpr month February{2}; - inline constexpr month March{3}; - inline constexpr month April{4}; - inline constexpr month May{5}; - inline constexpr month June{6}; - inline constexpr month July{7}; - inline constexpr month August{8}; - inline constexpr month September{9}; - inline constexpr month October{10}; - inline constexpr month November{11}; - inline constexpr month December{12}; + _EXPORT_STD inline constexpr weekday Sunday{0}; + _EXPORT_STD inline constexpr weekday Monday{1}; + _EXPORT_STD inline constexpr weekday Tuesday{2}; + _EXPORT_STD inline constexpr weekday Wednesday{3}; + _EXPORT_STD inline constexpr weekday Thursday{4}; + _EXPORT_STD inline constexpr weekday Friday{5}; + _EXPORT_STD inline constexpr weekday Saturday{6}; + + _EXPORT_STD inline constexpr month January{1}; + _EXPORT_STD inline constexpr month February{2}; + _EXPORT_STD inline constexpr month March{3}; + _EXPORT_STD inline constexpr month April{4}; + _EXPORT_STD inline constexpr month May{5}; + _EXPORT_STD inline constexpr month June{6}; + _EXPORT_STD inline constexpr month July{7}; + _EXPORT_STD inline constexpr month August{8}; + _EXPORT_STD inline constexpr month September{9}; + _EXPORT_STD inline constexpr month October{10}; + _EXPORT_STD inline constexpr month November{11}; + _EXPORT_STD inline constexpr month December{12}; _NODISCARD constexpr intmax_t _Pow10(const unsigned int _Exp) { intmax_t _Result = 1; @@ -1558,7 +1585,7 @@ namespace chrono { } } - template + _EXPORT_STD template class hh_mm_ss { public: static_assert(_Is_duration_v<_Duration>, @@ -1627,14 +1654,14 @@ namespace chrono { precision _Sub_secs; }; - _NODISCARD constexpr bool is_am(const hours& _Hours) noexcept { + _EXPORT_STD _NODISCARD constexpr bool is_am(const hours& _Hours) noexcept { return _Hours >= hours{0} && _Hours <= hours{11}; } - _NODISCARD constexpr bool is_pm(const hours& _Hours) noexcept { + _EXPORT_STD _NODISCARD constexpr bool is_pm(const hours& _Hours) noexcept { return _Hours >= hours{12} && _Hours <= hours{23}; } - _NODISCARD constexpr hours make12(const hours& _Hours) noexcept { + _EXPORT_STD _NODISCARD constexpr hours make12(const hours& _Hours) noexcept { const auto _H_count{_Hours.count()}; auto _Ret{_H_count == 0 ? 12 : _H_count}; if (_Ret > 12) { @@ -1643,7 +1670,7 @@ namespace chrono { return hours{_Ret}; } - _NODISCARD constexpr hours make24(const hours& _Hours, bool _Is_pm) noexcept { + _EXPORT_STD _NODISCARD constexpr hours make24(const hours& _Hours, bool _Is_pm) noexcept { const auto _H_count{_Hours.count()}; auto _Ret{_H_count == 12 ? 0 : _H_count}; if (_Is_pm) { @@ -1655,7 +1682,7 @@ namespace chrono { // [time.zone.info] - struct sys_info { + _EXPORT_STD struct sys_info { sys_seconds begin; sys_seconds end; seconds offset; @@ -1663,7 +1690,7 @@ namespace chrono { string abbrev; }; - struct local_info { + _EXPORT_STD struct local_info { static constexpr int unique = 0; static constexpr int nonexistent = 1; static constexpr int ambiguous = 2; @@ -1673,7 +1700,7 @@ namespace chrono { sys_info second; }; - class nonexistent_local_time : public runtime_error { + _EXPORT_STD class nonexistent_local_time : public runtime_error { public: template nonexistent_local_time(const local_time<_Duration>& _Tp, const local_info& _Info) @@ -1696,7 +1723,7 @@ namespace chrono { _THROW((nonexistent_local_time{_Tp, _Info})); } - class ambiguous_local_time : public runtime_error { + _EXPORT_STD class ambiguous_local_time : public runtime_error { public: template ambiguous_local_time(const local_time<_Duration>& _Tp, const local_info& _Info) @@ -1721,9 +1748,9 @@ namespace chrono { // [time.zone.timezone] - enum class choose { earliest, latest }; + _EXPORT_STD enum class choose { earliest, latest }; - class time_zone { + _EXPORT_STD class time_zone { public: explicit time_zone(string_view _Name_) : _Name(_Name_) {} @@ -1874,19 +1901,20 @@ namespace chrono { string _Name; }; - _NODISCARD inline bool operator==(const time_zone& _Left, const time_zone& _Right) noexcept { + _EXPORT_STD _NODISCARD inline bool operator==(const time_zone& _Left, const time_zone& _Right) noexcept { return _Left.name() == _Right.name(); } #ifdef __cpp_lib_concepts - _NODISCARD inline strong_ordering operator<=>(const time_zone& _Left, const time_zone& _Right) noexcept { + _EXPORT_STD _NODISCARD inline strong_ordering operator<=>( + const time_zone& _Left, const time_zone& _Right) noexcept { return _Left.name() <=> _Right.name(); } #endif // __cpp_lib_concepts // [time.zone.leap] - class leap_second { + _EXPORT_STD class leap_second { public: leap_second(const leap_second&) = default; leap_second& operator=(const leap_second&) = default; @@ -1919,67 +1947,68 @@ namespace chrono { seconds _Elapsed_offset; }; - _NODISCARD constexpr bool operator==(const leap_second& _Left, const leap_second& _Right) noexcept { + _EXPORT_STD _NODISCARD constexpr bool operator==(const leap_second& _Left, const leap_second& _Right) noexcept { return _Left.date() == _Right.date(); } - template + _EXPORT_STD template _NODISCARD constexpr bool operator==(const leap_second& _Left, const sys_time<_Duration>& _Right) noexcept { return _Left.date() == _Right; } - template + _EXPORT_STD template _NODISCARD constexpr bool operator<(const leap_second& _Left, const sys_time<_Duration>& _Right) noexcept { return _Left.date() < _Right; } - template + _EXPORT_STD template _NODISCARD constexpr bool operator<(const sys_time<_Duration>& _Left, const leap_second& _Right) noexcept { return _Left < _Right.date(); } - template + _EXPORT_STD template _NODISCARD constexpr bool operator>(const leap_second& _Left, const sys_time<_Duration>& _Right) noexcept { return _Right < _Left.date(); } - template + _EXPORT_STD template _NODISCARD constexpr bool operator>(const sys_time<_Duration>& _Left, const leap_second& _Right) noexcept { return _Right.date() < _Left; } - template + _EXPORT_STD template _NODISCARD constexpr bool operator<=(const leap_second& _Left, const sys_time<_Duration>& _Right) noexcept { return !(_Right < _Left.date()); } - template + _EXPORT_STD template _NODISCARD constexpr bool operator<=(const sys_time<_Duration>& _Left, const leap_second& _Right) noexcept { return !(_Right.date() < _Left); } - template + _EXPORT_STD template _NODISCARD constexpr bool operator>=(const leap_second& _Left, const sys_time<_Duration>& _Right) noexcept { return !(_Left.date() < _Right); } - template + _EXPORT_STD template _NODISCARD constexpr bool operator>=(const sys_time<_Duration>& _Left, const leap_second& _Right) noexcept { return !(_Left < _Right.date()); } #ifdef __cpp_lib_concepts // clang-format off - template + _EXPORT_STD template requires three_way_comparable_with> _NODISCARD constexpr auto operator<=>( const leap_second& _Left, const sys_time<_Duration>& _Right) noexcept { // clang-format on return _Left.date() <=> _Right; } - _NODISCARD constexpr strong_ordering operator<=>(const leap_second& _Left, const leap_second& _Right) noexcept { + _EXPORT_STD _NODISCARD constexpr strong_ordering operator<=>( + const leap_second& _Left, const leap_second& _Right) noexcept { return _Left.date() <=> _Right.date(); } #endif // __cpp_lib_concepts // [time.zone.link] - class time_zone_link { + _EXPORT_STD class time_zone_link { public: explicit time_zone_link(string_view _Name_, string_view _Target_) : _Name(_Name_), _Target(_Target_) {} @@ -1999,12 +2028,13 @@ namespace chrono { string _Target; }; - _NODISCARD inline bool operator==(const time_zone_link& _Left, const time_zone_link& _Right) noexcept { + _EXPORT_STD _NODISCARD inline bool operator==(const time_zone_link& _Left, const time_zone_link& _Right) noexcept { return _Left.name() == _Right.name(); } #ifdef __cpp_lib_concepts - _NODISCARD inline strong_ordering operator<=>(const time_zone_link& _Left, const time_zone_link& _Right) noexcept { + _EXPORT_STD _NODISCARD inline strong_ordering operator<=>( + const time_zone_link& _Left, const time_zone_link& _Right) noexcept { return _Left.name() <=> _Right.name(); } #endif // __cpp_lib_concepts @@ -2031,7 +2061,7 @@ namespace chrono { return _Result == _Vec.end() ? nullptr : &*_Result; } - struct tzdb { + _EXPORT_STD struct tzdb { string version; vector zones; vector links; @@ -2164,7 +2194,7 @@ namespace chrono { return _STD move(_Icu_version) + "." + _STD to_string(_Num_leap_seconds); } - class tzdb_list { + _EXPORT_STD class tzdb_list { private: using _ListType = forward_list>; @@ -2273,7 +2303,7 @@ namespace chrono { inline atomic _Global_tzdb_list; - _NODISCARD inline tzdb_list& get_tzdb_list() { + _EXPORT_STD _NODISCARD inline tzdb_list& get_tzdb_list() { auto _Tzdb_ptr = _Global_tzdb_list.load(); if (_Tzdb_ptr != nullptr) { return *_Tzdb_ptr; @@ -2306,19 +2336,19 @@ namespace chrono { return *_Tzdb_ptr; } - _NODISCARD inline const tzdb& get_tzdb() { + _EXPORT_STD _NODISCARD inline const tzdb& get_tzdb() { return _CHRONO get_tzdb_list().front(); } - _NODISCARD inline const time_zone* locate_zone(string_view _Tz_name) { + _EXPORT_STD _NODISCARD inline const time_zone* locate_zone(string_view _Tz_name) { return _CHRONO get_tzdb().locate_zone(_Tz_name); } - _NODISCARD inline const time_zone* current_zone() { + _EXPORT_STD _NODISCARD inline const time_zone* current_zone() { return _CHRONO get_tzdb().current_zone(); } - inline const tzdb& reload_tzdb() { + _EXPORT_STD inline const tzdb& reload_tzdb() { _TRY_BEGIN return _CHRONO get_tzdb_list()._Reload(); _CATCH(const runtime_error&) @@ -2330,7 +2360,7 @@ namespace chrono { _CATCH_END } - _NODISCARD inline string remote_version() { + _EXPORT_STD _NODISCARD inline string remote_version() { const auto& _Tzdb = _CHRONO get_tzdb(); const auto& _Version = _Tzdb.version; const auto [_Leap_sec, _Ignored] = _Tzdb_generate_leap_seconds(_Tzdb.leap_seconds.size()); @@ -2339,7 +2369,7 @@ namespace chrono { // [time.zone.zonedtraits] - template + _EXPORT_STD template struct zoned_traits {}; template <> @@ -2355,7 +2385,7 @@ namespace chrono { // [time.zone.zonedtime] - template + _EXPORT_STD template class zoned_time { private: static_assert(_Is_duration_v<_Duration>, @@ -2522,9 +2552,9 @@ namespace chrono { zoned_time(_TimeZonePtrOrName&&, zoned_time<_Duration, _TimeZonePtr2>, choose = choose::earliest) -> zoned_time, _Time_zone_representation<_TimeZonePtrOrName>>; - using zoned_seconds = zoned_time; + _EXPORT_STD using zoned_seconds = zoned_time; - template + _EXPORT_STD template _NODISCARD bool operator==( const zoned_time<_Duration1, _TimeZonePtr>& _Left, const zoned_time<_Duration2, _TimeZonePtr>& _Right) { return _Left.get_time_zone() == _Right.get_time_zone() && _Left.get_sys_time() == _Right.get_sys_time(); @@ -2532,17 +2562,17 @@ namespace chrono { // [time.clock.utc] - class utc_clock; - template - using utc_time = time_point; - using utc_seconds = utc_time; + _EXPORT_STD class utc_clock; + _EXPORT_STD template + using utc_time = time_point; + _EXPORT_STD using utc_seconds = utc_time; - struct leap_second_info { + _EXPORT_STD struct leap_second_info { bool is_leap_second; seconds elapsed; }; - template + _EXPORT_STD template _NODISCARD leap_second_info get_leap_second_info(const utc_time<_Duration>& _Time) { const utc_seconds _Time_floor = _CHRONO floor(_Time); const auto& _Tzdb = _CHRONO get_tzdb(); @@ -2615,7 +2645,7 @@ namespace chrono { } } - class utc_clock { + _EXPORT_STD class utc_clock { public: using rep = system_clock::rep; using period = system_clock::period; @@ -2659,13 +2689,13 @@ namespace chrono { // [time.clock.tai] - class tai_clock; + _EXPORT_STD class tai_clock; - template - using tai_time = time_point; - using tai_seconds = tai_time; + _EXPORT_STD template + using tai_time = time_point; + _EXPORT_STD using tai_seconds = tai_time; - class tai_clock { + _EXPORT_STD class tai_clock { public: using rep = system_clock::rep; using period = system_clock::period; @@ -2694,13 +2724,13 @@ namespace chrono { // [time.clock.gps] - class gps_clock; + _EXPORT_STD class gps_clock; - template - using gps_time = time_point; - using gps_seconds = gps_time; + _EXPORT_STD template + using gps_time = time_point; + _EXPORT_STD using gps_seconds = gps_time; - class gps_clock { + _EXPORT_STD class gps_clock { public: using rep = system_clock::rep; using period = system_clock::period; @@ -2733,9 +2763,9 @@ namespace filesystem { } // namespace filesystem namespace chrono { - using file_clock = filesystem::_File_time_clock; + _EXPORT_STD using file_clock = filesystem::_File_time_clock; - template + _EXPORT_STD template using file_time = time_point; } // namespace chrono #endif // ^^^ _HAS_CXX20 @@ -2801,7 +2831,7 @@ namespace filesystem { namespace chrono { // [time.clock.conv] - template + _EXPORT_STD template struct clock_time_conversion {}; // [time.clock.cast.id] @@ -2988,7 +3018,7 @@ namespace chrono { template inline constexpr auto _Clock_cast_choice = _Choose_clock_cast<_DestClock, _SourceClock, _Duration>(); - template != _Clock_cast_strategy::_None, int> = 0> _NODISCARD auto clock_cast(const time_point<_SourceClock, _Duration>& _Time) { constexpr auto _Strat = _Clock_cast_choice<_DestClock, _SourceClock, _Duration>; @@ -4378,7 +4408,7 @@ namespace chrono { } }; - template > + _EXPORT_STD template > basic_istream<_CharT, _Traits>& from_stream(basic_istream<_CharT, _Traits>& _Istr, const _CharT* _Fmt, duration<_Rep, _Period>& _Duration, basic_string<_CharT, _Traits, _Alloc>* _Abbrev = nullptr, minutes* _Offset = nullptr) { @@ -4389,7 +4419,7 @@ namespace chrono { return _Istr; } - template > + _EXPORT_STD template > basic_istream<_CharT, _Traits>& from_stream(basic_istream<_CharT, _Traits>& _Istr, const _CharT* _Fmt, weekday& _Wd, basic_string<_CharT, _Traits, _Alloc>* _Abbrev = nullptr, minutes* _Offset = nullptr) { _Time_parse_fields _Time{_Istr, _Fmt, _Abbrev, _Offset}; @@ -4399,7 +4429,7 @@ namespace chrono { return _Istr; } - template > + _EXPORT_STD template > basic_istream<_CharT, _Traits>& from_stream(basic_istream<_CharT, _Traits>& _Istr, const _CharT* _Fmt, day& _Day, basic_string<_CharT, _Traits, _Alloc>* _Abbrev = nullptr, minutes* _Offset = nullptr) { _Time_parse_fields _Time{_Istr, _Fmt, _Abbrev, _Offset}; @@ -4409,7 +4439,7 @@ namespace chrono { return _Istr; } - template > + _EXPORT_STD template > basic_istream<_CharT, _Traits>& from_stream(basic_istream<_CharT, _Traits>& _Istr, const _CharT* _Fmt, month& _Month, basic_string<_CharT, _Traits, _Alloc>* _Abbrev = nullptr, minutes* _Offset = nullptr) { _Time_parse_fields _Time{_Istr, _Fmt, _Abbrev, _Offset}; @@ -4419,7 +4449,7 @@ namespace chrono { return _Istr; } - template > + _EXPORT_STD template > basic_istream<_CharT, _Traits>& from_stream(basic_istream<_CharT, _Traits>& _Istr, const _CharT* _Fmt, month_day& _Md, basic_string<_CharT, _Traits, _Alloc>* _Abbrev = nullptr, minutes* _Offset = nullptr) { _Time_parse_fields _Time{_Istr, _Fmt, _Abbrev, _Offset}; @@ -4429,7 +4459,7 @@ namespace chrono { return _Istr; } - template > + _EXPORT_STD template > basic_istream<_CharT, _Traits>& from_stream(basic_istream<_CharT, _Traits>& _Istr, const _CharT* _Fmt, year& _Year, basic_string<_CharT, _Traits, _Alloc>* _Abbrev = nullptr, minutes* _Offset = nullptr) { _Time_parse_fields _Time{_Istr, _Fmt, _Abbrev, _Offset}; @@ -4439,7 +4469,7 @@ namespace chrono { return _Istr; } - template > + _EXPORT_STD template > basic_istream<_CharT, _Traits>& from_stream(basic_istream<_CharT, _Traits>& _Istr, const _CharT* _Fmt, year_month& _Ym, basic_string<_CharT, _Traits, _Alloc>* _Abbrev = nullptr, minutes* _Offset = nullptr) { _Time_parse_fields _Time{_Istr, _Fmt, _Abbrev, _Offset}; @@ -4449,7 +4479,7 @@ namespace chrono { return _Istr; } - template > + _EXPORT_STD template > basic_istream<_CharT, _Traits>& from_stream(basic_istream<_CharT, _Traits>& _Istr, const _CharT* _Fmt, year_month_day& _Ymd, basic_string<_CharT, _Traits, _Alloc>* _Abbrev = nullptr, minutes* _Offset = nullptr) { _Time_parse_fields _Time{_Istr, _Fmt, _Abbrev, _Offset}; @@ -4459,7 +4489,7 @@ namespace chrono { return _Istr; } - template > + _EXPORT_STD template > basic_istream<_CharT, _Traits>& from_stream(basic_istream<_CharT, _Traits>& _Istr, const _CharT* _Fmt, utc_time<_Duration>& _Tp, basic_string<_CharT, _Traits, _Alloc>* _Abbrev = nullptr, minutes* _Offset = nullptr) { @@ -4474,7 +4504,7 @@ namespace chrono { return _Istr; } - template > + _EXPORT_STD template > basic_istream<_CharT, _Traits>& from_stream(basic_istream<_CharT, _Traits>& _Istr, const _CharT* _Fmt, sys_time<_Duration>& _Tp, basic_string<_CharT, _Traits, _Alloc>* _Abbrev = nullptr, minutes* _Offset = nullptr) { @@ -4489,7 +4519,7 @@ namespace chrono { return _Istr; } - template > + _EXPORT_STD template > basic_istream<_CharT, _Traits>& from_stream(basic_istream<_CharT, _Traits>& _Istr, const _CharT* _Fmt, tai_time<_Duration>& _Tp, basic_string<_CharT, _Traits, _Alloc>* _Abbrev = nullptr, minutes* _Offset = nullptr) { @@ -4504,7 +4534,7 @@ namespace chrono { return _Istr; } - template > + _EXPORT_STD template > basic_istream<_CharT, _Traits>& from_stream(basic_istream<_CharT, _Traits>& _Istr, const _CharT* _Fmt, gps_time<_Duration>& _Tp, basic_string<_CharT, _Traits, _Alloc>* _Abbrev = nullptr, chrono::minutes* _Offset = nullptr) { @@ -4519,7 +4549,7 @@ namespace chrono { return _Istr; } - template > + _EXPORT_STD template > basic_istream<_CharT, _Traits>& from_stream(basic_istream<_CharT, _Traits>& _Istr, const _CharT* _Fmt, file_time<_Duration>& _Tp, basic_string<_CharT, _Traits, _Alloc>* _Abbrev = nullptr, chrono::minutes* _Offset = nullptr) { @@ -4536,7 +4566,7 @@ namespace chrono { return _Istr; } - template > + _EXPORT_STD template > basic_istream<_CharT, _Traits>& from_stream(basic_istream<_CharT, _Traits>& _Istr, const _CharT* _Fmt, local_time<_Duration>& _Tp, basic_string<_CharT, _Traits, _Alloc>* _Abbrev = nullptr, minutes* _Offset = nullptr) { @@ -4599,50 +4629,50 @@ namespace chrono { _STD declval(), _STD declval<_Parsable&>(), _STD declval<_Rest>()...)), 0); // intentional ADL - template , _Parsable> = 0> + _EXPORT_STD template , _Parsable> = 0> _NODISCARD auto parse(const _CharT* _Fmt, _Parsable& _Tp) { return _Time_parse_iomanip_c_str<_CharT, char_traits<_CharT>, allocator<_CharT>, _Parsable>{_Fmt, _Tp}; } - template = 0> _NODISCARD auto parse(const basic_string<_CharT, _Traits, _Alloc>& _Fmt, _Parsable& _Tp) { return _Time_parse_iomanip{_Fmt, _Tp}; } - template *> = 0> _NODISCARD auto parse(const _CharT* _Fmt, _Parsable& _Tp, basic_string<_CharT, _Traits, _Alloc>& _Abbrev) { return _Time_parse_iomanip_c_str{_Fmt, _Tp, _STD addressof(_Abbrev)}; } - template *> = 0> _NODISCARD auto parse(const basic_string<_CharT, _Traits, _Alloc>& _Fmt, _Parsable& _Tp, basic_string<_CharT, _Traits, _Alloc>& _Abbrev) { return _Time_parse_iomanip{_Fmt, _Tp, _STD addressof(_Abbrev)}; } - template , _Parsable, basic_string<_CharT>*, minutes*> = 0> _NODISCARD auto parse(const _CharT* _Fmt, _Parsable& _Tp, minutes& _Offset) { return _Time_parse_iomanip_c_str{_Fmt, _Tp, static_cast*>(nullptr), &_Offset}; } - template *, minutes*> = 0> _NODISCARD auto parse(const basic_string<_CharT, _Traits, _Alloc>& _Fmt, _Parsable& _Tp, minutes& _Offset) { return _Time_parse_iomanip{_Fmt, _Tp, static_cast*>(nullptr), &_Offset}; } - template *, minutes*> = 0> _NODISCARD auto parse( const _CharT* _Fmt, _Parsable& _Tp, basic_string<_CharT, _Traits, _Alloc>& _Abbrev, minutes& _Offset) { return _Time_parse_iomanip_c_str{_Fmt, _Tp, _STD addressof(_Abbrev), &_Offset}; } - template *, minutes*> = 0> _NODISCARD auto parse(const basic_string<_CharT, _Traits, _Alloc>& _Fmt, _Parsable& _Tp, basic_string<_CharT, _Traits, _Alloc>& _Abbrev, minutes& _Offset) { @@ -4901,7 +4931,7 @@ namespace chrono { } }; - template + _EXPORT_STD template _NODISCARD _Local_time_format_t<_Duration> local_time_format(const local_time<_Duration> _Time, const string* const _Abbrev = nullptr, const seconds* const _Offset_sec = nullptr) { return {_Time, _Abbrev, _Offset_sec}; @@ -4967,7 +4997,7 @@ namespace chrono { _Write_seconds(_Os, _Hh_mm_ss_part_underflow_to_zero(_Val)); } - template + _EXPORT_STD /* TRANSITION, VSO-1582358 */ template _NODISCARD tm _Fill_tm(const _Ty& _Val) { unsigned int _Day = 0; unsigned int _Month = 0; @@ -5058,33 +5088,33 @@ namespace chrono { return _Time; } - template + _EXPORT_STD template basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& _Os, const day& _Val) { return _Os << (_Val.ok() ? _STD format(_STATICALLY_WIDEN(_CharT, "{:%d}"), _Val) : _STD format(_STATICALLY_WIDEN(_CharT, "{:%d} is not a valid day"), _Val)); } - template + _EXPORT_STD template basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& _Os, const month& _Val) { return _Os << (_Val.ok() ? _STD format(_Os.getloc(), _STATICALLY_WIDEN(_CharT, "{:L%b}"), _Val) : _STD format(_Os.getloc(), _STATICALLY_WIDEN(_CharT, "{} is not a valid month"), static_cast(_Val))); } - template + _EXPORT_STD template basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& _Os, const year& _Val) { return _Os << (_Val.ok() ? _STD format(_STATICALLY_WIDEN(_CharT, "{:%Y}"), _Val) : _STD format(_STATICALLY_WIDEN(_CharT, "{:%Y} is not a valid year"), _Val)); } - template + _EXPORT_STD template basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& _Os, const weekday& _Val) { return _Os << (_Val.ok() ? _STD format(_Os.getloc(), _STATICALLY_WIDEN(_CharT, "{:L%a}"), _Val) : _STD format(_Os.getloc(), _STATICALLY_WIDEN(_CharT, "{} is not a valid weekday"), _Val.c_encoding())); } - template + _EXPORT_STD template basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& _Os, const weekday_indexed& _Val) { const auto _Idx = _Val.index(); return _Os << (_Idx >= 1 && _Idx <= 5 @@ -5093,64 +5123,64 @@ namespace chrono { _Val.weekday(), _Idx)); } - template + _EXPORT_STD template basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& _Os, const weekday_last& _Val) { return _Os << _STD format(_Os.getloc(), _STATICALLY_WIDEN(_CharT, "{:L}[last]"), _Val.weekday()); } - template + _EXPORT_STD template basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& _Os, const month_day& _Val) { return _Os << _STD format(_Os.getloc(), _STATICALLY_WIDEN(_CharT, "{:L}/{}"), _Val.month(), _Val.day()); } - template + _EXPORT_STD template basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& _Os, const month_day_last& _Val) { return _Os << _STD format(_Os.getloc(), _STATICALLY_WIDEN(_CharT, "{:L}/last"), _Val.month()); } - template + _EXPORT_STD template basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& _Os, const month_weekday& _Val) { return _Os << _STD format( _Os.getloc(), _STATICALLY_WIDEN(_CharT, "{:L}/{:L}"), _Val.month(), _Val.weekday_indexed()); } - template + _EXPORT_STD template basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& _Os, const month_weekday_last& _Val) { return _Os << _STD format( _Os.getloc(), _STATICALLY_WIDEN(_CharT, "{:L}/{:L}"), _Val.month(), _Val.weekday_last()); } - template + _EXPORT_STD template basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& _Os, const year_month& _Val) { return _Os << _STD format(_Os.getloc(), _STATICALLY_WIDEN(_CharT, "{}/{:L}"), _Val.year(), _Val.month()); } - template + _EXPORT_STD template basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& _Os, const year_month_day& _Val) { return _Os << (_Val.ok() ? _STD format(_STATICALLY_WIDEN(_CharT, "{:%F}"), _Val) : _STD format(_STATICALLY_WIDEN(_CharT, "{:%F} is not a valid date"), _Val)); } - template + _EXPORT_STD template basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& _Os, const year_month_day_last& _Val) { return _Os << _STD format( _Os.getloc(), _STATICALLY_WIDEN(_CharT, "{}/{:L}"), _Val.year(), _Val.month_day_last()); } - template + _EXPORT_STD template basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& _Os, const year_month_weekday& _Val) { return _Os << _STD format(_Os.getloc(), _STATICALLY_WIDEN(_CharT, "{}/{:L}/{:L}"), _Val.year(), _Val.month(), _Val.weekday_indexed()); } - template + _EXPORT_STD template basic_ostream<_CharT, _Traits>& operator<<( basic_ostream<_CharT, _Traits>& _Os, const year_month_weekday_last& _Val) { return _Os << _STD format(_Os.getloc(), _STATICALLY_WIDEN(_CharT, "{}/{:L}/{:L}"), _Val.year(), _Val.month(), _Val.weekday_last()); } - template + _EXPORT_STD template basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& _Os, const hh_mm_ss<_Duration>& _Val) { return _Os << _STD format(_Os.getloc(), _STATICALLY_WIDEN(_CharT, "{:L%T}"), _Val); } @@ -5167,14 +5197,14 @@ namespace chrono { } #pragma warning(pop) - template + _EXPORT_STD template basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& _Os, const sys_info& _Val) { return _Os << _STD format(_Os.getloc(), _STATICALLY_WIDEN(_CharT, "begin: {}, end: {}, offset: {}, save: {}, abbrev: {}"), // _Val.begin, _Val.end, _Val.offset, _Val.save, _Widen_string<_CharT>(_Val.abbrev)); } - template + _EXPORT_STD template basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& _Os, const local_info& _Val) { switch (_Val.result) { case local_info::unique: @@ -5196,7 +5226,7 @@ namespace chrono { } } - template + _EXPORT_STD template // clang-format off requires (!treat_as_floating_point_v && _Duration{1} < days{1}) basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& _Os, const sys_time<_Duration>& _Val) { @@ -5204,37 +5234,37 @@ namespace chrono { return _Os << _STD format(_Os.getloc(), _STATICALLY_WIDEN(_CharT, "{:L%F %T}"), _Val); } - template + _EXPORT_STD template basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& _Os, const sys_days& _Val) { return _Os << year_month_day{_Val}; } - template + _EXPORT_STD template basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& _Os, const utc_time<_Duration>& _Val) { return _Os << _STD format(_Os.getloc(), _STATICALLY_WIDEN(_CharT, "{:L%F %T}"), _Val); } - template + _EXPORT_STD template basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& _Os, const tai_time<_Duration>& _Val) { return _Os << _STD format(_Os.getloc(), _STATICALLY_WIDEN(_CharT, "{:L%F %T}"), _Val); } - template + _EXPORT_STD template basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& _Os, const gps_time<_Duration>& _Val) { return _Os << _STD format(_Os.getloc(), _STATICALLY_WIDEN(_CharT, "{:L%F %T}"), _Val); } - template + _EXPORT_STD template basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& _Os, const file_time<_Duration>& _Val) { return _Os << _STD format(_Os.getloc(), _STATICALLY_WIDEN(_CharT, "{:L%F %T}"), _Val); } - template + _EXPORT_STD template basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& _Os, const local_time<_Duration>& _Val) { return _Os << sys_time<_Duration>{_Val.time_since_epoch()}; } - template + _EXPORT_STD template basic_ostream<_CharT, _Traits>& operator<<( basic_ostream<_CharT, _Traits>& _Os, const zoned_time<_Duration, _TimeZonePtr>& _Val) { const auto _Info = _Val.get_info(); @@ -5985,10 +6015,10 @@ namespace chrono { inline namespace literals { inline namespace chrono_literals { - _NODISCARD constexpr _CHRONO day operator"" d(unsigned long long _Day) noexcept { + _EXPORT_STD _NODISCARD constexpr _CHRONO day operator"" d(unsigned long long _Day) noexcept { return _CHRONO day{static_cast(_Day)}; } - _NODISCARD constexpr _CHRONO year operator"" y(unsigned long long _Year) noexcept { + _EXPORT_STD _NODISCARD constexpr _CHRONO year operator"" y(unsigned long long _Year) noexcept { return _CHRONO year{static_cast(_Year)}; } } // namespace chrono_literals diff --git a/stl/inc/cinttypes b/stl/inc/cinttypes index d1f07e10a5..62a4a3084e 100644 --- a/stl/inc/cinttypes +++ b/stl/inc/cinttypes @@ -20,14 +20,14 @@ _STL_DISABLE_CLANG_WARNINGS #undef new _STD_BEGIN -using _CSTD imaxdiv_t; // from - -using _CSTD imaxabs; -using _CSTD imaxdiv; -using _CSTD strtoimax; -using _CSTD strtoumax; -using _CSTD wcstoimax; -using _CSTD wcstoumax; +_EXPORT_STD using _CSTD imaxdiv_t; // from + +_EXPORT_STD using _CSTD imaxabs; +_EXPORT_STD using _CSTD imaxdiv; +_EXPORT_STD using _CSTD strtoimax; +_EXPORT_STD using _CSTD strtoumax; +_EXPORT_STD using _CSTD wcstoimax; +_EXPORT_STD using _CSTD wcstoumax; _STD_END #pragma pop_macro("new") diff --git a/stl/inc/clocale b/stl/inc/clocale index bfc5a0aacf..09844d7ddb 100644 --- a/stl/inc/clocale +++ b/stl/inc/clocale @@ -19,9 +19,9 @@ _STL_DISABLE_CLANG_WARNINGS #undef new _STD_BEGIN -using _CSTD lconv; -using _CSTD localeconv; -using _CSTD setlocale; +_EXPORT_STD using _CSTD lconv; +_EXPORT_STD using _CSTD localeconv; +_EXPORT_STD using _CSTD setlocale; _STD_END #pragma pop_macro("new") diff --git a/stl/inc/cmath b/stl/inc/cmath index 21d8fe1d99..38b6bff4ad 100644 --- a/stl/inc/cmath +++ b/stl/inc/cmath @@ -708,199 +708,203 @@ _GENERIC_MATH2(fmin) _STD_BEGIN -using _CSTD abs; -using _CSTD acos; -using _CSTD asin; -using _CSTD atan; -using _CSTD atan2; -using _CSTD ceil; -using _CSTD cos; -using _CSTD cosh; -using _CSTD exp; -using _CSTD fabs; -using _CSTD floor; -using _CSTD fmod; -using _CSTD frexp; -using _CSTD ldexp; -using _CSTD log; -using _CSTD log10; -using _CSTD modf; -using _CSTD pow; -using _CSTD sin; -using _CSTD sinh; -using _CSTD sqrt; -using _CSTD tan; -using _CSTD tanh; - -using _CSTD acosf; -using _CSTD asinf; -using _CSTD atanf; -using _CSTD atan2f; -using _CSTD ceilf; -using _CSTD cosf; -using _CSTD coshf; -using _CSTD expf; -using _CSTD fabsf; -using _CSTD floorf; -using _CSTD fmodf; -using _CSTD frexpf; -using _CSTD ldexpf; -using _CSTD logf; -using _CSTD log10f; -using _CSTD modff; -using _CSTD powf; -using _CSTD sinf; -using _CSTD sinhf; -using _CSTD sqrtf; -using _CSTD tanf; -using _CSTD tanhf; - -using _CSTD acosl; -using _CSTD asinl; -using _CSTD atanl; -using _CSTD atan2l; -using _CSTD ceill; -using _CSTD cosl; -using _CSTD coshl; -using _CSTD expl; -using _CSTD fabsl; -using _CSTD floorl; -using _CSTD fmodl; -using _CSTD frexpl; -using _CSTD ldexpl; -using _CSTD logl; -using _CSTD log10l; -using _CSTD modfl; -using _CSTD powl; -using _CSTD sinl; -using _CSTD sinhl; -using _CSTD sqrtl; -using _CSTD tanl; -using _CSTD tanhl; - -using _CSTD float_t; -using _CSTD double_t; - -using _CSTD acosh; -using _CSTD asinh; -using _CSTD atanh; -using _CSTD cbrt; -using _CSTD erf; -using _CSTD erfc; -using _CSTD expm1; -using _CSTD exp2; -using _CSTD hypot; -using _CSTD ilogb; -using _CSTD lgamma; -using _CSTD log1p; -using _CSTD log2; -using _CSTD logb; -using _CSTD llrint; -using _CSTD lrint; -using _CSTD nearbyint; -using _CSTD rint; -using _CSTD llround; -using _CSTD lround; -using _CSTD fdim; -using _CSTD fma; -using _CSTD fmax; -using _CSTD fmin; -using _CSTD round; -using _CSTD trunc; -using _CSTD remainder; -using _CSTD remquo; -using _CSTD copysign; -using _CSTD nan; -using _CSTD nextafter; -using _CSTD scalbn; -using _CSTD scalbln; -using _CSTD nexttoward; -using _CSTD tgamma; - -using _CSTD acoshf; -using _CSTD asinhf; -using _CSTD atanhf; -using _CSTD cbrtf; -using _CSTD erff; -using _CSTD erfcf; -using _CSTD expm1f; -using _CSTD exp2f; -using _CSTD hypotf; -using _CSTD ilogbf; -using _CSTD lgammaf; -using _CSTD log1pf; -using _CSTD log2f; -using _CSTD logbf; -using _CSTD llrintf; -using _CSTD lrintf; -using _CSTD nearbyintf; -using _CSTD rintf; -using _CSTD llroundf; -using _CSTD lroundf; -using _CSTD fdimf; -using _CSTD fmaf; -using _CSTD fmaxf; -using _CSTD fminf; -using _CSTD roundf; -using _CSTD truncf; -using _CSTD remainderf; -using _CSTD remquof; -using _CSTD copysignf; -using _CSTD nanf; -using _CSTD nextafterf; -using _CSTD scalbnf; -using _CSTD scalblnf; -using _CSTD nexttowardf; -using _CSTD tgammaf; - -using _CSTD acoshl; -using _CSTD asinhl; -using _CSTD atanhl; -using _CSTD cbrtl; -using _CSTD erfl; -using _CSTD erfcl; -using _CSTD expm1l; -using _CSTD exp2l; -using _CSTD hypotl; -using _CSTD ilogbl; -using _CSTD lgammal; -using _CSTD log1pl; -using _CSTD log2l; -using _CSTD logbl; -using _CSTD llrintl; -using _CSTD lrintl; -using _CSTD nearbyintl; -using _CSTD rintl; -using _CSTD llroundl; -using _CSTD lroundl; -using _CSTD fdiml; -using _CSTD fmal; -using _CSTD fmaxl; -using _CSTD fminl; -using _CSTD roundl; -using _CSTD truncl; -using _CSTD remainderl; -using _CSTD remquol; -using _CSTD copysignl; -using _CSTD nanl; -using _CSTD nextafterl; -using _CSTD scalbnl; -using _CSTD scalblnl; -using _CSTD nexttowardl; -using _CSTD tgammal; - -using _CSTD fpclassify; -using _CSTD signbit; -using _CSTD isfinite; -using _CSTD isinf; -using _CSTD isnan; -using _CSTD isnormal; -using _CSTD isgreater; -using _CSTD isgreaterequal; -using _CSTD isless; -using _CSTD islessequal; -using _CSTD islessgreater; -using _CSTD isunordered; +_EXPORT_STD using _CSTD abs; +_EXPORT_STD using _CSTD acos; +_EXPORT_STD using _CSTD asin; +_EXPORT_STD using _CSTD atan; +_EXPORT_STD using _CSTD atan2; +_EXPORT_STD using _CSTD ceil; +_EXPORT_STD using _CSTD cos; +_EXPORT_STD using _CSTD cosh; +_EXPORT_STD using _CSTD exp; +_EXPORT_STD using _CSTD fabs; +_EXPORT_STD using _CSTD floor; +_EXPORT_STD using _CSTD fmod; +_EXPORT_STD using _CSTD frexp; +_EXPORT_STD using _CSTD ldexp; +_EXPORT_STD using _CSTD log; +_EXPORT_STD using _CSTD log10; +_EXPORT_STD using _CSTD modf; +_EXPORT_STD using _CSTD pow; +_EXPORT_STD using _CSTD sin; +_EXPORT_STD using _CSTD sinh; +_EXPORT_STD using _CSTD sqrt; +_EXPORT_STD using _CSTD tan; +_EXPORT_STD using _CSTD tanh; + +_EXPORT_STD using _CSTD acosf; +_EXPORT_STD using _CSTD asinf; +_EXPORT_STD using _CSTD atanf; +_EXPORT_STD using _CSTD atan2f; +_EXPORT_STD using _CSTD ceilf; +_EXPORT_STD using _CSTD cosf; +_EXPORT_STD using _CSTD coshf; +_EXPORT_STD using _CSTD expf; +_EXPORT_STD using _CSTD fabsf; +_EXPORT_STD using _CSTD floorf; +_EXPORT_STD using _CSTD fmodf; +_EXPORT_STD using _CSTD frexpf; +_EXPORT_STD using _CSTD ldexpf; +_EXPORT_STD using _CSTD logf; +_EXPORT_STD using _CSTD log10f; +_EXPORT_STD using _CSTD modff; +_EXPORT_STD using _CSTD powf; +_EXPORT_STD using _CSTD sinf; +_EXPORT_STD using _CSTD sinhf; +_EXPORT_STD using _CSTD sqrtf; +_EXPORT_STD using _CSTD tanf; +_EXPORT_STD using _CSTD tanhf; + +_EXPORT_STD using _CSTD acosl; +_EXPORT_STD using _CSTD asinl; +_EXPORT_STD using _CSTD atanl; +_EXPORT_STD using _CSTD atan2l; +_EXPORT_STD using _CSTD ceill; +_EXPORT_STD using _CSTD cosl; +_EXPORT_STD using _CSTD coshl; +_EXPORT_STD using _CSTD expl; +_EXPORT_STD using _CSTD fabsl; +_EXPORT_STD using _CSTD floorl; +_EXPORT_STD using _CSTD fmodl; +_EXPORT_STD using _CSTD frexpl; +_EXPORT_STD using _CSTD ldexpl; +_EXPORT_STD using _CSTD logl; +_EXPORT_STD using _CSTD log10l; +_EXPORT_STD using _CSTD modfl; +_EXPORT_STD using _CSTD powl; +_EXPORT_STD using _CSTD sinl; +_EXPORT_STD using _CSTD sinhl; +_EXPORT_STD using _CSTD sqrtl; +_EXPORT_STD using _CSTD tanl; +_EXPORT_STD using _CSTD tanhl; + +_EXPORT_STD using _CSTD float_t; +_EXPORT_STD using _CSTD double_t; + +_EXPORT_STD using _CSTD acosh; +_EXPORT_STD using _CSTD asinh; +_EXPORT_STD using _CSTD atanh; +_EXPORT_STD using _CSTD cbrt; +_EXPORT_STD using _CSTD erf; +_EXPORT_STD using _CSTD erfc; +_EXPORT_STD using _CSTD expm1; +_EXPORT_STD using _CSTD exp2; + +inline namespace _Binary_hypot { + _EXPORT_STD using _CSTD hypot; +} // namespace _Binary_hypot + +_EXPORT_STD using _CSTD ilogb; +_EXPORT_STD using _CSTD lgamma; +_EXPORT_STD using _CSTD log1p; +_EXPORT_STD using _CSTD log2; +_EXPORT_STD using _CSTD logb; +_EXPORT_STD using _CSTD llrint; +_EXPORT_STD using _CSTD lrint; +_EXPORT_STD using _CSTD nearbyint; +_EXPORT_STD using _CSTD rint; +_EXPORT_STD using _CSTD llround; +_EXPORT_STD using _CSTD lround; +_EXPORT_STD using _CSTD fdim; +_EXPORT_STD using _CSTD fma; +_EXPORT_STD using _CSTD fmax; +_EXPORT_STD using _CSTD fmin; +_EXPORT_STD using _CSTD round; +_EXPORT_STD using _CSTD trunc; +_EXPORT_STD using _CSTD remainder; +_EXPORT_STD using _CSTD remquo; +_EXPORT_STD using _CSTD copysign; +_EXPORT_STD using _CSTD nan; +_EXPORT_STD using _CSTD nextafter; +_EXPORT_STD using _CSTD scalbn; +_EXPORT_STD using _CSTD scalbln; +_EXPORT_STD using _CSTD nexttoward; +_EXPORT_STD using _CSTD tgamma; + +_EXPORT_STD using _CSTD acoshf; +_EXPORT_STD using _CSTD asinhf; +_EXPORT_STD using _CSTD atanhf; +_EXPORT_STD using _CSTD cbrtf; +_EXPORT_STD using _CSTD erff; +_EXPORT_STD using _CSTD erfcf; +_EXPORT_STD using _CSTD expm1f; +_EXPORT_STD using _CSTD exp2f; +_EXPORT_STD using _CSTD hypotf; +_EXPORT_STD using _CSTD ilogbf; +_EXPORT_STD using _CSTD lgammaf; +_EXPORT_STD using _CSTD log1pf; +_EXPORT_STD using _CSTD log2f; +_EXPORT_STD using _CSTD logbf; +_EXPORT_STD using _CSTD llrintf; +_EXPORT_STD using _CSTD lrintf; +_EXPORT_STD using _CSTD nearbyintf; +_EXPORT_STD using _CSTD rintf; +_EXPORT_STD using _CSTD llroundf; +_EXPORT_STD using _CSTD lroundf; +_EXPORT_STD using _CSTD fdimf; +_EXPORT_STD using _CSTD fmaf; +_EXPORT_STD using _CSTD fmaxf; +_EXPORT_STD using _CSTD fminf; +_EXPORT_STD using _CSTD roundf; +_EXPORT_STD using _CSTD truncf; +_EXPORT_STD using _CSTD remainderf; +_EXPORT_STD using _CSTD remquof; +_EXPORT_STD using _CSTD copysignf; +_EXPORT_STD using _CSTD nanf; +_EXPORT_STD using _CSTD nextafterf; +_EXPORT_STD using _CSTD scalbnf; +_EXPORT_STD using _CSTD scalblnf; +_EXPORT_STD using _CSTD nexttowardf; +_EXPORT_STD using _CSTD tgammaf; + +_EXPORT_STD using _CSTD acoshl; +_EXPORT_STD using _CSTD asinhl; +_EXPORT_STD using _CSTD atanhl; +_EXPORT_STD using _CSTD cbrtl; +_EXPORT_STD using _CSTD erfl; +_EXPORT_STD using _CSTD erfcl; +_EXPORT_STD using _CSTD expm1l; +_EXPORT_STD using _CSTD exp2l; +_EXPORT_STD using _CSTD hypotl; +_EXPORT_STD using _CSTD ilogbl; +_EXPORT_STD using _CSTD lgammal; +_EXPORT_STD using _CSTD log1pl; +_EXPORT_STD using _CSTD log2l; +_EXPORT_STD using _CSTD logbl; +_EXPORT_STD using _CSTD llrintl; +_EXPORT_STD using _CSTD lrintl; +_EXPORT_STD using _CSTD nearbyintl; +_EXPORT_STD using _CSTD rintl; +_EXPORT_STD using _CSTD llroundl; +_EXPORT_STD using _CSTD lroundl; +_EXPORT_STD using _CSTD fdiml; +_EXPORT_STD using _CSTD fmal; +_EXPORT_STD using _CSTD fmaxl; +_EXPORT_STD using _CSTD fminl; +_EXPORT_STD using _CSTD roundl; +_EXPORT_STD using _CSTD truncl; +_EXPORT_STD using _CSTD remainderl; +_EXPORT_STD using _CSTD remquol; +_EXPORT_STD using _CSTD copysignl; +_EXPORT_STD using _CSTD nanl; +_EXPORT_STD using _CSTD nextafterl; +_EXPORT_STD using _CSTD scalbnl; +_EXPORT_STD using _CSTD scalblnl; +_EXPORT_STD using _CSTD nexttowardl; +_EXPORT_STD using _CSTD tgammal; + +_EXPORT_STD using _CSTD fpclassify; +_EXPORT_STD using _CSTD signbit; +_EXPORT_STD using _CSTD isfinite; +_EXPORT_STD using _CSTD isinf; +_EXPORT_STD using _CSTD isnan; +_EXPORT_STD using _CSTD isnormal; +_EXPORT_STD using _CSTD isgreater; +_EXPORT_STD using _CSTD isgreaterequal; +_EXPORT_STD using _CSTD isless; +_EXPORT_STD using _CSTD islessequal; +_EXPORT_STD using _CSTD islessgreater; +_EXPORT_STD using _CSTD isunordered; _STD_END #if _HAS_CXX17 @@ -952,280 +956,293 @@ _NODISCARD _CRT_SATELLITE_2 float __stdcall __std_smf_hypot3f(float, float, floa _END_EXTERN_C _STD_BEGIN -_NODISCARD inline double assoc_laguerre( +_EXPORT_STD _NODISCARD inline double assoc_laguerre( const unsigned int _Degree, const unsigned int _Order, const double _Value) noexcept /* strengthened */ { return __std_smf_assoc_laguerre(_Degree, _Order, _Value); } -_NODISCARD inline float assoc_laguerref( +_EXPORT_STD _NODISCARD inline float assoc_laguerref( const unsigned int _Degree, const unsigned int _Order, const float _Value) noexcept /* strengthened */ { return __std_smf_assoc_laguerref(_Degree, _Order, _Value); } -_NODISCARD inline long double assoc_laguerrel( +_EXPORT_STD _NODISCARD inline long double assoc_laguerrel( const unsigned int _Degree, const unsigned int _Order, const long double _Value) noexcept /* strengthened */ { return __std_smf_assoc_laguerre(_Degree, _Order, static_cast(_Value)); } -_NODISCARD inline double assoc_legendre( +_EXPORT_STD _NODISCARD inline double assoc_legendre( const unsigned int _Degree, const unsigned int _Order, const double _Value) noexcept /* strengthened */ { return __std_smf_assoc_legendre(_Degree, _Order, _Value); } -_NODISCARD inline float assoc_legendref( +_EXPORT_STD _NODISCARD inline float assoc_legendref( const unsigned int _Degree, const unsigned int _Order, const float _Value) noexcept /* strengthened */ { return __std_smf_assoc_legendref(_Degree, _Order, _Value); } -_NODISCARD inline long double assoc_legendrel( +_EXPORT_STD _NODISCARD inline long double assoc_legendrel( const unsigned int _Degree, const unsigned int _Order, const long double _Value) noexcept /* strengthened */ { return __std_smf_assoc_legendre(_Degree, _Order, static_cast(_Value)); } -_NODISCARD inline double beta(const double _Arg1, const double _Arg2) noexcept /* strengthened */ { +_EXPORT_STD _NODISCARD inline double beta(const double _Arg1, const double _Arg2) noexcept /* strengthened */ { return __std_smf_beta(_Arg1, _Arg2); } -_NODISCARD inline float betaf(const float _Arg1, const float _Arg2) noexcept /* strengthened */ { +_EXPORT_STD _NODISCARD inline float betaf(const float _Arg1, const float _Arg2) noexcept /* strengthened */ { return __std_smf_betaf(_Arg1, _Arg2); } -_NODISCARD inline long double betal(const long double _Arg1, const long double _Arg2) noexcept /* strengthened */ { +_EXPORT_STD _NODISCARD inline long double betal(const long double _Arg1, const long double _Arg2) noexcept +/* strengthened */ { return __std_smf_beta(static_cast(_Arg1), static_cast(_Arg2)); } -_NODISCARD inline double comp_ellint_1(const double _Arg) noexcept /* strengthened */ { +_EXPORT_STD _NODISCARD inline double comp_ellint_1(const double _Arg) noexcept /* strengthened */ { return __std_smf_comp_ellint_1(_Arg); } -_NODISCARD inline float comp_ellint_1f(const float _Arg) noexcept /* strengthened */ { +_EXPORT_STD _NODISCARD inline float comp_ellint_1f(const float _Arg) noexcept /* strengthened */ { return __std_smf_comp_ellint_1f(_Arg); } -_NODISCARD inline long double comp_ellint_1l(const long double _Arg) noexcept /* strengthened */ { +_EXPORT_STD _NODISCARD inline long double comp_ellint_1l(const long double _Arg) noexcept /* strengthened */ { return __std_smf_comp_ellint_1(static_cast(_Arg)); } -_NODISCARD inline double comp_ellint_2(const double _Arg) noexcept /* strengthened */ { +_EXPORT_STD _NODISCARD inline double comp_ellint_2(const double _Arg) noexcept /* strengthened */ { return __std_smf_comp_ellint_2(_Arg); } -_NODISCARD inline float comp_ellint_2f(const float _Arg) noexcept /* strengthened */ { +_EXPORT_STD _NODISCARD inline float comp_ellint_2f(const float _Arg) noexcept /* strengthened */ { return __std_smf_comp_ellint_2f(_Arg); } -_NODISCARD inline long double comp_ellint_2l(const long double _Arg) noexcept /* strengthened */ { +_EXPORT_STD _NODISCARD inline long double comp_ellint_2l(const long double _Arg) noexcept /* strengthened */ { return __std_smf_comp_ellint_2(static_cast(_Arg)); } -_NODISCARD inline double comp_ellint_3(const double _Arg1, const double _Arg2) noexcept /* strengthened */ { +_EXPORT_STD _NODISCARD inline double comp_ellint_3(const double _Arg1, const double _Arg2) noexcept /* strengthened */ { return __std_smf_comp_ellint_3(_Arg1, _Arg2); } -_NODISCARD inline float comp_ellint_3f(const float _Arg1, const float _Arg2) noexcept /* strengthened */ { +_EXPORT_STD _NODISCARD inline float comp_ellint_3f(const float _Arg1, const float _Arg2) noexcept /* strengthened */ { return __std_smf_comp_ellint_3f(_Arg1, _Arg2); } -_NODISCARD inline long double comp_ellint_3l(const long double _Arg1, const long double _Arg2) noexcept +_EXPORT_STD _NODISCARD inline long double comp_ellint_3l(const long double _Arg1, const long double _Arg2) noexcept /* strengthened */ { return __std_smf_comp_ellint_3(static_cast(_Arg1), static_cast(_Arg2)); } -_NODISCARD inline double cyl_bessel_i(const double _Arg1, const double _Arg2) noexcept /* strengthened */ { +_EXPORT_STD _NODISCARD inline double cyl_bessel_i(const double _Arg1, const double _Arg2) noexcept /* strengthened */ { return __std_smf_cyl_bessel_i(_Arg1, _Arg2); } -_NODISCARD inline float cyl_bessel_if(const float _Arg1, const float _Arg2) noexcept /* strengthened */ { +_EXPORT_STD _NODISCARD inline float cyl_bessel_if(const float _Arg1, const float _Arg2) noexcept /* strengthened */ { return __std_smf_cyl_bessel_if(_Arg1, _Arg2); } -_NODISCARD inline long double cyl_bessel_il(const long double _Arg1, const long double _Arg2) noexcept +_EXPORT_STD _NODISCARD inline long double cyl_bessel_il(const long double _Arg1, const long double _Arg2) noexcept /* strengthened */ { return __std_smf_cyl_bessel_i(static_cast(_Arg1), static_cast(_Arg2)); } -_NODISCARD inline double cyl_bessel_j(const double _Arg1, const double _Arg2) noexcept /* strengthened */ { +_EXPORT_STD _NODISCARD inline double cyl_bessel_j(const double _Arg1, const double _Arg2) noexcept /* strengthened */ { return __std_smf_cyl_bessel_j(_Arg1, _Arg2); } -_NODISCARD inline float cyl_bessel_jf(const float _Arg1, const float _Arg2) noexcept /* strengthened */ { +_EXPORT_STD _NODISCARD inline float cyl_bessel_jf(const float _Arg1, const float _Arg2) noexcept /* strengthened */ { return __std_smf_cyl_bessel_jf(_Arg1, _Arg2); } -_NODISCARD inline long double cyl_bessel_jl(const long double _Arg1, const long double _Arg2) noexcept +_EXPORT_STD _NODISCARD inline long double cyl_bessel_jl(const long double _Arg1, const long double _Arg2) noexcept /* strengthened */ { return __std_smf_cyl_bessel_j(static_cast(_Arg1), static_cast(_Arg2)); } -_NODISCARD inline double cyl_bessel_k(const double _Arg1, const double _Arg2) noexcept /* strengthened */ { +_EXPORT_STD _NODISCARD inline double cyl_bessel_k(const double _Arg1, const double _Arg2) noexcept /* strengthened */ { return __std_smf_cyl_bessel_k(_Arg1, _Arg2); } -_NODISCARD inline float cyl_bessel_kf(const float _Arg1, const float _Arg2) noexcept /* strengthened */ { +_EXPORT_STD _NODISCARD inline float cyl_bessel_kf(const float _Arg1, const float _Arg2) noexcept /* strengthened */ { return __std_smf_cyl_bessel_kf(_Arg1, _Arg2); } -_NODISCARD inline long double cyl_bessel_kl(const long double _Arg1, const long double _Arg2) noexcept +_EXPORT_STD _NODISCARD inline long double cyl_bessel_kl(const long double _Arg1, const long double _Arg2) noexcept /* strengthened */ { return __std_smf_cyl_bessel_k(static_cast(_Arg1), static_cast(_Arg2)); } -_NODISCARD inline double cyl_neumann(const double _Arg1, const double _Arg2) noexcept /* strengthened */ { +_EXPORT_STD _NODISCARD inline double cyl_neumann(const double _Arg1, const double _Arg2) noexcept /* strengthened */ { return __std_smf_cyl_neumann(_Arg1, _Arg2); } -_NODISCARD inline float cyl_neumannf(const float _Arg1, const float _Arg2) noexcept /* strengthened */ { +_EXPORT_STD _NODISCARD inline float cyl_neumannf(const float _Arg1, const float _Arg2) noexcept /* strengthened */ { return __std_smf_cyl_neumannf(_Arg1, _Arg2); } -_NODISCARD inline long double cyl_neumannl(const long double _Arg1, const long double _Arg2) noexcept +_EXPORT_STD _NODISCARD inline long double cyl_neumannl(const long double _Arg1, const long double _Arg2) noexcept /* strengthened */ { return __std_smf_cyl_neumann(static_cast(_Arg1), static_cast(_Arg2)); } -_NODISCARD inline double ellint_1(const double _Arg1, const double _Arg2) noexcept /* strengthened */ { +_EXPORT_STD _NODISCARD inline double ellint_1(const double _Arg1, const double _Arg2) noexcept /* strengthened */ { return __std_smf_ellint_1(_Arg1, _Arg2); } -_NODISCARD inline float ellint_1f(const float _Arg1, const float _Arg2) noexcept /* strengthened */ { +_EXPORT_STD _NODISCARD inline float ellint_1f(const float _Arg1, const float _Arg2) noexcept /* strengthened */ { return __std_smf_ellint_1f(_Arg1, _Arg2); } -_NODISCARD inline long double ellint_1l(const long double _Arg1, const long double _Arg2) noexcept /* strengthened */ { +_EXPORT_STD _NODISCARD inline long double ellint_1l(const long double _Arg1, const long double _Arg2) noexcept +/* strengthened */ { return __std_smf_ellint_1(static_cast(_Arg1), static_cast(_Arg2)); } -_NODISCARD inline double ellint_2(const double _Arg1, const double _Arg2) noexcept /* strengthened */ { +_EXPORT_STD _NODISCARD inline double ellint_2(const double _Arg1, const double _Arg2) noexcept /* strengthened */ { return __std_smf_ellint_2(_Arg1, _Arg2); } -_NODISCARD inline float ellint_2f(const float _Arg1, const float _Arg2) noexcept /* strengthened */ { +_EXPORT_STD _NODISCARD inline float ellint_2f(const float _Arg1, const float _Arg2) noexcept /* strengthened */ { return __std_smf_ellint_2f(_Arg1, _Arg2); } -_NODISCARD inline long double ellint_2l(const long double _Arg1, const long double _Arg2) noexcept /* strengthened */ { +_EXPORT_STD _NODISCARD inline long double ellint_2l(const long double _Arg1, const long double _Arg2) noexcept +/* strengthened */ { return __std_smf_ellint_2(static_cast(_Arg1), static_cast(_Arg2)); } -_NODISCARD inline double ellint_3(const double _Arg1, const double _Arg2, const double _Arg3) noexcept +_EXPORT_STD _NODISCARD inline double ellint_3(const double _Arg1, const double _Arg2, const double _Arg3) noexcept /* strengthened */ { return __std_smf_ellint_3(_Arg1, _Arg2, _Arg3); } -_NODISCARD inline float ellint_3f(const float _Arg1, const float _Arg2, const float _Arg3) noexcept +_EXPORT_STD _NODISCARD inline float ellint_3f(const float _Arg1, const float _Arg2, const float _Arg3) noexcept /* strengthened */ { return __std_smf_ellint_3f(_Arg1, _Arg2, _Arg3); } -_NODISCARD inline long double ellint_3l( +_EXPORT_STD _NODISCARD inline long double ellint_3l( const long double _Arg1, const long double _Arg2, const long double _Arg3) noexcept /* strengthened */ { return __std_smf_ellint_3(static_cast(_Arg1), static_cast(_Arg2), static_cast(_Arg3)); } -_NODISCARD inline double expint(const double _Arg) noexcept /* strengthened */ { +_EXPORT_STD _NODISCARD inline double expint(const double _Arg) noexcept /* strengthened */ { return __std_smf_expint(_Arg); } -_NODISCARD inline float expintf(const float _Arg) noexcept /* strengthened */ { +_EXPORT_STD _NODISCARD inline float expintf(const float _Arg) noexcept /* strengthened */ { return __std_smf_expintf(_Arg); } -_NODISCARD inline long double expintl(const long double _Arg) noexcept /* strengthened */ { +_EXPORT_STD _NODISCARD inline long double expintl(const long double _Arg) noexcept /* strengthened */ { return __std_smf_expint(static_cast(_Arg)); } -_NODISCARD inline double hermite(const unsigned int _Arg1, const double _Arg2) noexcept /* strengthened */ { +_EXPORT_STD _NODISCARD inline double hermite(const unsigned int _Arg1, const double _Arg2) noexcept /* strengthened */ { return __std_smf_hermite(_Arg1, _Arg2); } -_NODISCARD inline float hermitef(const unsigned int _Arg1, const float _Arg2) noexcept /* strengthened */ { +_EXPORT_STD _NODISCARD inline float hermitef(const unsigned int _Arg1, const float _Arg2) noexcept /* strengthened */ { return __std_smf_hermitef(_Arg1, _Arg2); } -_NODISCARD inline long double hermitel(const unsigned int _Arg1, const long double _Arg2) noexcept /* strengthened */ { +_EXPORT_STD _NODISCARD inline long double hermitel(const unsigned int _Arg1, const long double _Arg2) noexcept +/* strengthened */ { return __std_smf_hermite(_Arg1, static_cast(_Arg2)); } -_NODISCARD inline double laguerre(const unsigned int _Arg1, const double _Arg2) noexcept /* strengthened */ { +_EXPORT_STD _NODISCARD inline double laguerre(const unsigned int _Arg1, const double _Arg2) noexcept +/* strengthened */ { return __std_smf_laguerre(_Arg1, _Arg2); } -_NODISCARD inline float laguerref(const unsigned int _Arg1, const float _Arg2) noexcept /* strengthened */ { +_EXPORT_STD _NODISCARD inline float laguerref(const unsigned int _Arg1, const float _Arg2) noexcept /* strengthened */ { return __std_smf_laguerref(_Arg1, _Arg2); } -_NODISCARD inline long double laguerrel(const unsigned int _Arg1, const long double _Arg2) noexcept +_EXPORT_STD _NODISCARD inline long double laguerrel(const unsigned int _Arg1, const long double _Arg2) noexcept /* strengthened */ { return __std_smf_laguerre(_Arg1, static_cast(_Arg2)); } -_NODISCARD inline double legendre(const unsigned int _Degree, const double _Value) noexcept /* strengthened */ { +_EXPORT_STD _NODISCARD inline double legendre(const unsigned int _Degree, const double _Value) noexcept +/* strengthened */ { return __std_smf_legendre(_Degree, _Value); } -_NODISCARD inline float legendref(const unsigned int _Degree, const float _Value) noexcept /* strengthened */ { +_EXPORT_STD _NODISCARD inline float legendref(const unsigned int _Degree, const float _Value) noexcept +/* strengthened */ { return __std_smf_legendref(_Degree, _Value); } -_NODISCARD inline long double legendrel(const unsigned int _Degree, const long double _Value) noexcept +_EXPORT_STD _NODISCARD inline long double legendrel(const unsigned int _Degree, const long double _Value) noexcept /* strengthened */ { return __std_smf_legendre(_Degree, static_cast(_Value)); } -_NODISCARD inline double riemann_zeta(const double _Arg) noexcept /* strengthened */ { +_EXPORT_STD _NODISCARD inline double riemann_zeta(const double _Arg) noexcept /* strengthened */ { return __std_smf_riemann_zeta(_Arg); } -_NODISCARD inline float riemann_zetaf(const float _Arg) noexcept /* strengthened */ { +_EXPORT_STD _NODISCARD inline float riemann_zetaf(const float _Arg) noexcept /* strengthened */ { return __std_smf_riemann_zetaf(_Arg); } -_NODISCARD inline long double riemann_zetal(const long double _Arg) noexcept /* strengthened */ { +_EXPORT_STD _NODISCARD inline long double riemann_zetal(const long double _Arg) noexcept /* strengthened */ { return __std_smf_riemann_zeta(static_cast(_Arg)); } -_NODISCARD inline double sph_bessel(const unsigned int _Arg1, const double _Arg2) noexcept /* strengthened */ { +_EXPORT_STD _NODISCARD inline double sph_bessel(const unsigned int _Arg1, const double _Arg2) noexcept +/* strengthened */ { return __std_smf_sph_bessel(_Arg1, _Arg2); } -_NODISCARD inline float sph_besself(const unsigned int _Arg1, const float _Arg2) noexcept /* strengthened */ { +_EXPORT_STD _NODISCARD inline float sph_besself(const unsigned int _Arg1, const float _Arg2) noexcept +/* strengthened */ { return __std_smf_sph_besself(_Arg1, _Arg2); } -_NODISCARD inline long double sph_bessell(const unsigned int _Arg1, const long double _Arg2) noexcept +_EXPORT_STD _NODISCARD inline long double sph_bessell(const unsigned int _Arg1, const long double _Arg2) noexcept /* strengthened */ { return __std_smf_sph_bessel(_Arg1, static_cast(_Arg2)); } -_NODISCARD inline double sph_legendre(const unsigned int _Arg1, const unsigned int _Arg2, const double _Theta) noexcept +_EXPORT_STD _NODISCARD inline double sph_legendre( + const unsigned int _Arg1, const unsigned int _Arg2, const double _Theta) noexcept /* strengthened */ { return __std_smf_sph_legendre(_Arg1, _Arg2, _Theta); } -_NODISCARD inline float sph_legendref(const unsigned int _Arg1, const unsigned int _Arg2, const float _Theta) noexcept +_EXPORT_STD _NODISCARD inline float sph_legendref( + const unsigned int _Arg1, const unsigned int _Arg2, const float _Theta) noexcept /* strengthened */ { return __std_smf_sph_legendref(_Arg1, _Arg2, _Theta); } -_NODISCARD inline long double sph_legendrel( +_EXPORT_STD _NODISCARD inline long double sph_legendrel( const unsigned int _Arg1, const unsigned int _Arg2, const long double _Theta) noexcept /* strengthened */ { return __std_smf_sph_legendre(_Arg1, _Arg2, static_cast(_Theta)); } -_NODISCARD inline double sph_neumann(const unsigned int _Arg1, const double _Arg2) noexcept /* strengthened */ { +_EXPORT_STD _NODISCARD inline double sph_neumann(const unsigned int _Arg1, const double _Arg2) noexcept +/* strengthened */ { return __std_smf_sph_neumann(_Arg1, _Arg2); } -_NODISCARD inline float sph_neumannf(const unsigned int _Arg1, const float _Arg2) noexcept /* strengthened */ { +_EXPORT_STD _NODISCARD inline float sph_neumannf(const unsigned int _Arg1, const float _Arg2) noexcept +/* strengthened */ { return __std_smf_sph_neumannf(_Arg1, _Arg2); } -_NODISCARD inline long double sph_neumannl(const unsigned int _Arg1, const long double _Arg2) noexcept +_EXPORT_STD _NODISCARD inline long double sph_neumannl(const unsigned int _Arg1, const long double _Arg2) noexcept /* strengthened */ { return __std_smf_sph_neumann(_Arg1, static_cast(_Arg2)); } #define _GENERIC_MATH_SPECIAL1(NAME) \ - template , int> = 0> \ + _EXPORT_STD template , int> = 0> \ _NODISCARD auto NAME(const _Ty _Arg) noexcept /* strengthened */ { \ using _Common = conditional_t, double, _Ty>; \ if constexpr (is_same_v<_Common, float>) { \ @@ -1236,7 +1253,8 @@ _NODISCARD inline long double sph_neumannl(const unsigned int _Arg1, const long } #define _GENERIC_MATH_SPECIAL2(NAME) \ - template && is_arithmetic_v<_Ty2>, int> = 0> \ + _EXPORT_STD template && is_arithmetic_v<_Ty2>, int> = 0> \ _NODISCARD auto NAME(const _Ty1 _Arg1, const _Ty2 _Arg2) noexcept /* strengthened */ { \ using _Common = _Common_float_type_t<_Ty1, _Ty2>; \ if constexpr (is_same_v<_Common, float>) { \ @@ -1247,7 +1265,7 @@ _NODISCARD inline long double sph_neumannl(const unsigned int _Arg1, const long } #define _GENERIC_MATH_SPECIAL3(NAME) \ - template && is_arithmetic_v<_Ty2> && is_arithmetic_v<_Ty3>, int> = 0> \ _NODISCARD auto NAME(const _Ty1 _Arg1, const _Ty2 _Arg2, const _Ty3 _Arg3) noexcept /* strengthened */ { \ using _Common = _Common_float_type_t<_Ty1, _Common_float_type_t<_Ty2, _Ty3>>; \ @@ -1260,7 +1278,7 @@ _NODISCARD inline long double sph_neumannl(const unsigned int _Arg1, const long } #define _GENERIC_MATH_SPECIAL_UINT1(NAME) \ - template , int> = 0> \ + _EXPORT_STD template , int> = 0> \ _NODISCARD auto NAME(const unsigned int _Arg1, const _Ty _Arg2) noexcept /* strengthened */ { \ using _Common = conditional_t, double, _Ty>; \ if constexpr (is_same_v<_Common, float>) { \ @@ -1271,7 +1289,7 @@ _NODISCARD inline long double sph_neumannl(const unsigned int _Arg1, const long } #define _GENERIC_MATH_SPECIAL_UINT2(NAME) \ - template , int> = 0> \ + _EXPORT_STD template , int> = 0> \ _NODISCARD auto NAME( \ const unsigned int _Arg1, const unsigned int _Arg2, const _Ty _Arg3) noexcept /* strengthened */ { \ using _Common = conditional_t, double, _Ty>; \ @@ -1311,19 +1329,19 @@ _GENERIC_MATH_SPECIAL_UINT1(sph_neumann) #undef _GENERIC_MATH_SPECIAL_UINT1 #undef _GENERIC_MATH_SPECIAL_UINT2 -_NODISCARD inline double hypot(const double _Dx, const double _Dy, const double _Dz) { +_EXPORT_STD _NODISCARD inline double hypot(const double _Dx, const double _Dy, const double _Dz) { return __std_smf_hypot3(_Dx, _Dy, _Dz); } -_NODISCARD inline float hypot(const float _Dx, const float _Dy, const float _Dz) { +_EXPORT_STD _NODISCARD inline float hypot(const float _Dx, const float _Dy, const float _Dz) { return __std_smf_hypot3f(_Dx, _Dy, _Dz); } -_NODISCARD inline long double hypot(const long double _Dx, const long double _Dy, const long double _Dz) { +_EXPORT_STD _NODISCARD inline long double hypot(const long double _Dx, const long double _Dy, const long double _Dz) { return __std_smf_hypot3(static_cast(_Dx), static_cast(_Dy), static_cast(_Dz)); } -template && is_arithmetic_v<_Ty2> && is_arithmetic_v<_Ty3>, int> = 0> _NODISCARD auto hypot(const _Ty1 _Dx, const _Ty2 _Dy, const _Ty3 _Dz) { // N4910 [cmath.syn]/2 "Sufficient additional overloads" @@ -1436,20 +1454,21 @@ _NODISCARD constexpr _Ty _Common_lerp(const _Ty _ArgA, const _Ty _ArgB, const _T } } -_NODISCARD constexpr inline float lerp(const float _ArgA, const float _ArgB, const float _ArgT) noexcept { +_EXPORT_STD _NODISCARD constexpr inline float lerp(const float _ArgA, const float _ArgB, const float _ArgT) noexcept { return _Common_lerp(_ArgA, _ArgB, _ArgT); } -_NODISCARD constexpr inline double lerp(const double _ArgA, const double _ArgB, const double _ArgT) noexcept { +_EXPORT_STD _NODISCARD constexpr inline double lerp( + const double _ArgA, const double _ArgB, const double _ArgT) noexcept { return _Common_lerp(_ArgA, _ArgB, _ArgT); } -_NODISCARD constexpr inline long double lerp( +_EXPORT_STD _NODISCARD constexpr inline long double lerp( const long double _ArgA, const long double _ArgB, const long double _ArgT) noexcept { return _Common_lerp(_ArgA, _ArgB, _ArgT); } -template && is_arithmetic_v<_Ty2> && is_arithmetic_v<_Ty3>, int> = 0> _NODISCARD constexpr auto lerp(const _Ty1 _ArgA, const _Ty2 _ArgB, const _Ty3 _ArgT) noexcept { using _Tgt = conditional_t<_Is_any_of_v, long double, double>; diff --git a/stl/inc/codecvt b/stl/inc/codecvt index 8534566026..b62004e707 100644 --- a/stl/inc/codecvt +++ b/stl/inc/codecvt @@ -22,12 +22,16 @@ _STD_BEGIN _INLINE_VAR constexpr int _Little_first = 1; _INLINE_VAR constexpr int _Big_first = 2; -enum _CXX17_DEPRECATE_CODECVT_HEADER codecvt_mode { consume_header = 4, generate_header = 2, little_endian = 1 }; +_EXPORT_STD enum _CXX17_DEPRECATE_CODECVT_HEADER codecvt_mode { + consume_header = 4, + generate_header = 2, + little_endian = 1 +}; using _Statype = _CSTD mbstate_t; _STL_DISABLE_DEPRECATED_WARNING -template +_EXPORT_STD template class _CXX17_DEPRECATE_CODECVT_HEADER codecvt_utf8 : public codecvt<_Elem, char, _Statype> { // facet for converting between _Elem and UTF-8 byte sequences public: @@ -218,7 +222,7 @@ protected: } }; -template +_EXPORT_STD template class _CXX17_DEPRECATE_CODECVT_HEADER codecvt_utf16 : public codecvt<_Elem, char, _Statype> { // facet for converting between _Elem and UTF-16 multibyte sequences private: @@ -435,7 +439,7 @@ protected: } }; -template +_EXPORT_STD template class _CXX17_DEPRECATE_CODECVT_HEADER codecvt_utf8_utf16 : public codecvt<_Elem, char, _Statype> { // facet for converting between UTF-16 _Elem and UTF-8 byte sequences public: diff --git a/stl/inc/compare b/stl/inc/compare index 96aa6d382b..feb5aafe97 100644 --- a/stl/inc/compare +++ b/stl/inc/compare @@ -35,7 +35,7 @@ enum class _Compare_eq : _Compare_t { equal = 0, equivalent = equal }; enum class _Compare_ord : _Compare_t { less = -1, greater = 1 }; enum class _Compare_ncmp : _Compare_t { unordered = -128 }; -struct partial_ordering { +_EXPORT_STD struct partial_ordering { static const partial_ordering less; static const partial_ordering equivalent; static const partial_ordering greater; @@ -101,7 +101,7 @@ inline constexpr partial_ordering partial_ordering::equivalent{static_cast<_Comp inline constexpr partial_ordering partial_ordering::greater{static_cast<_Compare_t>(_Compare_ord::greater)}; inline constexpr partial_ordering partial_ordering::unordered{static_cast<_Compare_t>(_Compare_ncmp::unordered)}; -struct weak_ordering { +_EXPORT_STD struct weak_ordering { static const weak_ordering less; static const weak_ordering equivalent; static const weak_ordering greater; @@ -163,7 +163,7 @@ inline constexpr weak_ordering weak_ordering::less{static_cast<_Compare_t>(_Comp inline constexpr weak_ordering weak_ordering::equivalent{static_cast<_Compare_t>(_Compare_eq::equivalent)}; inline constexpr weak_ordering weak_ordering::greater{static_cast<_Compare_t>(_Compare_ord::greater)}; -struct strong_ordering { +_EXPORT_STD struct strong_ordering { static const strong_ordering less; static const strong_ordering equal; static const strong_ordering equivalent; @@ -231,27 +231,27 @@ inline constexpr strong_ordering strong_ordering::equal{static_cast<_Compare_t>( inline constexpr strong_ordering strong_ordering::equivalent{static_cast<_Compare_t>(_Compare_eq::equivalent)}; inline constexpr strong_ordering strong_ordering::greater{static_cast<_Compare_t>(_Compare_ord::greater)}; -_NODISCARD constexpr bool is_eq(const partial_ordering _Comp) noexcept { +_EXPORT_STD _NODISCARD constexpr bool is_eq(const partial_ordering _Comp) noexcept { return _Comp == 0; } -_NODISCARD constexpr bool is_neq(const partial_ordering _Comp) noexcept { +_EXPORT_STD _NODISCARD constexpr bool is_neq(const partial_ordering _Comp) noexcept { return _Comp != 0; } -_NODISCARD constexpr bool is_lt(const partial_ordering _Comp) noexcept { +_EXPORT_STD _NODISCARD constexpr bool is_lt(const partial_ordering _Comp) noexcept { return _Comp < 0; } -_NODISCARD constexpr bool is_lteq(const partial_ordering _Comp) noexcept { +_EXPORT_STD _NODISCARD constexpr bool is_lteq(const partial_ordering _Comp) noexcept { return _Comp <= 0; } -_NODISCARD constexpr bool is_gt(const partial_ordering _Comp) noexcept { +_EXPORT_STD _NODISCARD constexpr bool is_gt(const partial_ordering _Comp) noexcept { return _Comp > 0; } -_NODISCARD constexpr bool is_gteq(const partial_ordering _Comp) noexcept { +_EXPORT_STD _NODISCARD constexpr bool is_gteq(const partial_ordering _Comp) noexcept { return _Comp >= 0; } @@ -274,14 +274,14 @@ inline constexpr unsigned char _Classify_category = _Comparison_c template <> inline constexpr unsigned char _Classify_category = _Comparison_category_strong; -template +_EXPORT_STD template using common_comparison_category_t = conditional_t<(_Classify_category<_Types...> & _Comparison_category_none) != 0, void, conditional_t<(_Classify_category<_Types...> & _Comparison_category_partial) != 0, partial_ordering, conditional_t<(_Classify_category<_Types...> & _Comparison_category_weak) != 0, weak_ordering, strong_ordering>>>; -template +_EXPORT_STD template struct common_comparison_category { using type = common_comparison_category_t<_Types...>; }; @@ -291,13 +291,13 @@ struct common_comparison_category { template concept _Compares_as = same_as, _Cat>; -template +_EXPORT_STD template concept three_way_comparable = _Half_equality_comparable<_Ty, _Ty> && _Half_ordered<_Ty, _Ty> && requires(const remove_reference_t<_Ty>& __a, const remove_reference_t<_Ty>& __b) { { __a <=> __b } -> _Compares_as<_Cat>; }; -template +_EXPORT_STD template concept three_way_comparable_with = three_way_comparable<_Ty1, _Cat> && three_way_comparable<_Ty2, _Cat> && common_reference_with&, const remove_reference_t<_Ty2>&> && three_way_comparable&, const remove_reference_t<_Ty2>&>, _Cat> @@ -307,11 +307,11 @@ concept three_way_comparable_with = three_way_comparable<_Ty1, _Cat> && three_wa { __u <=> __t } -> _Compares_as<_Cat>; }; -template +_EXPORT_STD template using compare_three_way_result_t = decltype(_STD declval&>() <=> _STD declval&>()); -template +_EXPORT_STD template struct compare_three_way_result {}; template @@ -320,7 +320,7 @@ struct compare_three_way_result<_Ty1, _Ty2> { using type = compare_three_way_result_t<_Ty1, _Ty2>; }; -struct compare_three_way { +_EXPORT_STD struct compare_three_way { template requires three_way_comparable_with<_Ty1, _Ty2> _NODISCARD constexpr auto operator()(_Ty1&& _Left, _Ty2&& _Right) const @@ -453,7 +453,7 @@ namespace _Strong_order { } // namespace _Strong_order inline namespace _Cpos { - inline constexpr _Strong_order::_Cpo strong_order; + _EXPORT_STD inline constexpr _Strong_order::_Cpo strong_order; } namespace _Weak_order { @@ -573,7 +573,7 @@ namespace _Weak_order { } // namespace _Weak_order inline namespace _Cpos { - inline constexpr _Weak_order::_Cpo weak_order; + _EXPORT_STD inline constexpr _Weak_order::_Cpo weak_order; } namespace _Partial_order { @@ -650,7 +650,7 @@ namespace _Partial_order { } // namespace _Partial_order inline namespace _Cpos { - inline constexpr _Partial_order::_Cpo partial_order; + _EXPORT_STD inline constexpr _Partial_order::_Cpo partial_order; } template @@ -710,7 +710,7 @@ namespace _Compare_strong_order_fallback { } // namespace _Compare_strong_order_fallback inline namespace _Cpos { - inline constexpr _Compare_strong_order_fallback::_Cpo compare_strong_order_fallback; + _EXPORT_STD inline constexpr _Compare_strong_order_fallback::_Cpo compare_strong_order_fallback; } template @@ -764,7 +764,7 @@ namespace _Compare_weak_order_fallback { } // namespace _Compare_weak_order_fallback inline namespace _Cpos { - inline constexpr _Compare_weak_order_fallback::_Cpo compare_weak_order_fallback; + _EXPORT_STD inline constexpr _Compare_weak_order_fallback::_Cpo compare_weak_order_fallback; } template @@ -827,7 +827,7 @@ namespace _Compare_partial_order_fallback { } // namespace _Compare_partial_order_fallback inline namespace _Cpos { - inline constexpr _Compare_partial_order_fallback::_Cpo compare_partial_order_fallback; + _EXPORT_STD inline constexpr _Compare_partial_order_fallback::_Cpo compare_partial_order_fallback; } #endif // __cpp_lib_concepts diff --git a/stl/inc/complex b/stl/inc/complex index d104cac919..42b2e32354 100644 --- a/stl/inc/complex +++ b/stl/inc/complex @@ -348,7 +348,7 @@ using _Dcomplex_value = _CSTD _C_double_complex; using _Fcomplex_value = _CSTD _C_float_complex; using _Lcomplex_value = _CSTD _C_ldouble_complex; -template +_EXPORT_STD template class complex; template <> class complex; @@ -1294,7 +1294,7 @@ constexpr complex::complex(const complex& _Right) constexpr complex::complex(const complex& _Right) : _Complex_base(_Right.real(), _Right.imag()) {} -template +_EXPORT_STD template class complex : public _Complex_base<_Ty, _Complex_value<_Ty>> { public: using _Mybase = _Complex_base<_Ty, _Complex_value<_Ty>>; @@ -1386,106 +1386,106 @@ public: } }; -template +_EXPORT_STD template _NODISCARD _CONSTEXPR20 complex<_Ty> operator+(const complex<_Ty>& _Left, const complex<_Ty>& _Right) { complex<_Ty> _Tmp(_Left); _Tmp += _Right; return _Tmp; } -template +_EXPORT_STD template _NODISCARD _CONSTEXPR20 complex<_Ty> operator+(const complex<_Ty>& _Left, const _Ty& _Right) { complex<_Ty> _Tmp(_Left); _Tmp += _Right; return _Tmp; } -template +_EXPORT_STD template _NODISCARD _CONSTEXPR20 complex<_Ty> operator+(const _Ty& _Left, const complex<_Ty>& _Right) { complex<_Ty> _Tmp(_Right); _Tmp += _Left; return _Tmp; } -template +_EXPORT_STD template _NODISCARD _CONSTEXPR20 complex<_Ty> operator-(const complex<_Ty>& _Left, const complex<_Ty>& _Right) { complex<_Ty> _Tmp(_Left); _Tmp -= _Right; return _Tmp; } -template +_EXPORT_STD template _NODISCARD _CONSTEXPR20 complex<_Ty> operator-(const complex<_Ty>& _Left, const _Ty& _Right) { complex<_Ty> _Tmp(_Left); _Tmp -= _Right; return _Tmp; } -template +_EXPORT_STD template _NODISCARD _CONSTEXPR20 complex<_Ty> operator-(const _Ty& _Left, const complex<_Ty>& _Right) { complex<_Ty> _Tmp(_Left); _Tmp -= _Right; return _Tmp; } -template +_EXPORT_STD template _NODISCARD _CONSTEXPR20 complex<_Ty> operator*(const complex<_Ty>& _Left, const complex<_Ty>& _Right) { complex<_Ty> _Tmp(_Left); _Tmp *= _Right; return _Tmp; } -template +_EXPORT_STD template _NODISCARD _CONSTEXPR20 complex<_Ty> operator*(const complex<_Ty>& _Left, const _Ty& _Right) { complex<_Ty> _Tmp(_Left); _Tmp *= _Right; return _Tmp; } -template +_EXPORT_STD template _NODISCARD _CONSTEXPR20 complex<_Ty> operator*(const _Ty& _Left, const complex<_Ty>& _Right) { complex<_Ty> _Tmp(_Right); _Tmp *= _Left; return _Tmp; } -template +_EXPORT_STD template _NODISCARD _CONSTEXPR20 complex<_Ty> operator/(const complex<_Ty>& _Left, const complex<_Ty>& _Right) { complex<_Ty> _Tmp(_Left); _Tmp /= _Right; return _Tmp; } -template +_EXPORT_STD template _NODISCARD _CONSTEXPR20 complex<_Ty> operator/(const complex<_Ty>& _Left, const _Ty& _Right) { complex<_Ty> _Tmp(_Left); _Tmp /= _Right; return _Tmp; } -template +_EXPORT_STD template _NODISCARD _CONSTEXPR20 complex<_Ty> operator/(const _Ty& _Left, const complex<_Ty>& _Right) { complex<_Ty> _Tmp(_Left); _Tmp /= _Right; return _Tmp; } -template +_EXPORT_STD template _NODISCARD _CONSTEXPR20 complex<_Ty> operator+(const complex<_Ty>& _Left) { return _Left; } -template +_EXPORT_STD template _NODISCARD _CONSTEXPR20 complex<_Ty> operator-(const complex<_Ty>& _Left) { return complex<_Ty>(-_Left.real(), -_Left.imag()); } -template +_EXPORT_STD template _NODISCARD constexpr bool operator==(const complex<_Ty>& _Left, const complex<_Ty>& _Right) { return _Left.real() == _Right.real() && _Left.imag() == _Right.imag(); } -template +_EXPORT_STD template _NODISCARD constexpr bool operator==(const complex<_Ty>& _Left, const _Ty& _Right) { return _Left.real() == _Right && _Left.imag() == 0; } @@ -1512,25 +1512,25 @@ _NODISCARD constexpr bool operator!=(const _Ty& _Left, const complex<_Ty>& _Righ } #endif // !_HAS_CXX20 -template +_EXPORT_STD template _NODISCARD constexpr _Ty imag(const complex<_Ty>& _Left) { return _Left.imag(); } -template +_EXPORT_STD template _NODISCARD constexpr _Ty real(const complex<_Ty>& _Left) { return _Left.real(); } -template +_EXPORT_STD template _NODISCARD complex<_Ty> sqrt(const complex<_Ty>& _Left); -template +_EXPORT_STD template _NODISCARD _Ty abs(const complex<_Ty>& _Left) { return _Ctraits<_Ty>::hypot(_Left.real(), _Left.imag()); } -template +_EXPORT_STD template _NODISCARD complex<_Ty> acos(const complex<_Ty>& _Left) { const _Ty _Arcbig = static_cast<_Ty>(0.25) * _Ctraits<_Ty>::sqrt(_Ctraits<_Ty>::_Flt_max()); constexpr _Ty _Pi = static_cast<_Ty>(3.1415926535897932384626433832795029L); @@ -1597,7 +1597,7 @@ _NODISCARD complex<_Ty> acos(const complex<_Ty>& _Left) { return complex<_Ty>(_Ux, _Vx); } -template +_EXPORT_STD template _NODISCARD complex<_Ty> acosh(const complex<_Ty>& _Left) { const _Ty _Arcbig = static_cast<_Ty>(0.25) * _Ctraits<_Ty>::sqrt(_Ctraits<_Ty>::_Flt_max()); constexpr _Ty _Pi = static_cast<_Ty>(3.1415926535897932384626433832795029L); @@ -1667,7 +1667,7 @@ _NODISCARD complex<_Ty> acosh(const complex<_Ty>& _Left) { return complex<_Ty>(_Ux, _Vx); } -template +_EXPORT_STD template _NODISCARD complex<_Ty> asinh(const complex<_Ty>& _Left) { const _Ty _Arcbig = static_cast<_Ty>(0.25) * _Ctraits<_Ty>::sqrt(_Ctraits<_Ty>::_Flt_max()); constexpr _Ty _Pi = static_cast<_Ty>(3.1415926535897932384626433832795029L); @@ -1732,14 +1732,14 @@ _NODISCARD complex<_Ty> asinh(const complex<_Ty>& _Left) { return complex<_Ty>(_Ux, _Vx); } -template +_EXPORT_STD template _NODISCARD complex<_Ty> asin(const complex<_Ty>& _Left) { complex<_Ty> _Asinh = _STD asinh(complex<_Ty>(-imag(_Left), real(_Left))); return complex<_Ty>(imag(_Asinh), -real(_Asinh)); } -template +_EXPORT_STD template _NODISCARD complex<_Ty> atanh(const complex<_Ty>& _Left) { const _Ty _Arcbig = static_cast<_Ty>(0.25) * _Ctraits<_Ty>::sqrt(_Ctraits<_Ty>::_Flt_max()); constexpr _Ty _Piby2 = static_cast<_Ty>(1.5707963267948966192313216916397514L); @@ -1791,14 +1791,14 @@ _NODISCARD complex<_Ty> atanh(const complex<_Ty>& _Left) { return complex<_Ty>(_Ux, _Vx); } -template +_EXPORT_STD template _NODISCARD complex<_Ty> atan(const complex<_Ty>& _Left) { complex<_Ty> _Atanh = _STD atanh(complex<_Ty>(-imag(_Left), real(_Left))); return complex<_Ty>(imag(_Atanh), -real(_Atanh)); } -template +_EXPORT_STD template _NODISCARD complex<_Ty> cosh(const complex<_Ty>& _Left) { return complex<_Ty>(_Ctraits<_Ty>::_Cosh(real(_Left), _Ctraits<_Ty>::cos(imag(_Left))), _Ctraits<_Ty>::_Sinh(real(_Left), _Ctraits<_Ty>::sin(imag(_Left)))); @@ -1820,7 +1820,7 @@ _NODISCARD complex<_Ty> _Polar_positive_nan_inf_zero_rho(const _Ty& _Rho, const } } -template +_EXPORT_STD template _NODISCARD complex<_Ty> exp(const complex<_Ty>& _Left) { const _Ty _Log_rho = _STD real(_Left); const _Ty _Theta = _STD imag(_Left); @@ -1921,7 +1921,7 @@ _NODISCARD inline float _Log_abs(const complex& _Left) noexcept { return _Math_algorithms::_Log_hypot(_STD real(_Left), _STD imag(_Left)); } -template +_EXPORT_STD template _NODISCARD complex<_Ty> log(const complex<_Ty>& _Left) { const _Ty _Log_abs_v = _Log_abs(_Left); // get logarithm of magnitude const _Ty _Theta = _Ctraits<_Ty>::atan2(_STD imag(_Left), _STD real(_Left)); // get phase @@ -1937,7 +1937,7 @@ complex<_Ty> _Pow(const _Ty& _Left, const _Ty& _Right) { } } -template +_EXPORT_STD template _NODISCARD complex<_Ty> pow(const complex<_Ty>& _Left, const _Ty& _Right) { if (imag(_Left) == 0) { if (_Ctraits<_Ty>::_Signbit(imag(_Left))) { @@ -1950,7 +1950,7 @@ _NODISCARD complex<_Ty> pow(const complex<_Ty>& _Left, const _Ty& _Right) { } } -template +_EXPORT_STD template _NODISCARD complex<_Ty> pow(const _Ty& _Left, const complex<_Ty>& _Right) { if (imag(_Right) == 0) { return _Pow(_Left, real(_Right)); @@ -1961,7 +1961,7 @@ _NODISCARD complex<_Ty> pow(const _Ty& _Left, const complex<_Ty>& _Right) { } } -template +_EXPORT_STD template _NODISCARD complex<_Ty> pow(const complex<_Ty>& _Left, const complex<_Ty>& _Right) { if (imag(_Right) == 0) { return pow(_Left, real(_Right)); @@ -1972,13 +1972,13 @@ _NODISCARD complex<_Ty> pow(const complex<_Ty>& _Left, const complex<_Ty>& _Righ } } -template +_EXPORT_STD template _NODISCARD complex<_Ty> sinh(const complex<_Ty>& _Left) { return complex<_Ty>(_Ctraits<_Ty>::_Sinh(real(_Left), _Ctraits<_Ty>::cos(imag(_Left))), _Ctraits<_Ty>::_Cosh(real(_Left), _Ctraits<_Ty>::sin(imag(_Left)))); } -template +_EXPORT_STD template _NODISCARD complex<_Ty> sqrt(const complex<_Ty>& _Left) { int _Leftexp; _Ty _Rho = _Fabs(_Left, &_Leftexp); // get magnitude and scale factor @@ -2022,7 +2022,7 @@ _NODISCARD complex<_Ty> sqrt(const complex<_Ty>& _Left) { } } -template +_EXPORT_STD template _NODISCARD complex<_Ty> tanh(const complex<_Ty>& _Left) { _Ty _Tv = _Ctraits<_Ty>::tan(imag(_Left)); _Ty _Sv = _Ctraits<_Ty>::_Sinh(real(_Left), _Ty{1}); @@ -2044,17 +2044,17 @@ _NODISCARD complex<_Ty> tanh(const complex<_Ty>& _Left) { return complex<_Ty>((_Ctraits<_Ty>::sqrt(_Ty{1} + _Sv * _Sv)) * _Bv / _Dv, _Tv / _Dv); } -template +_EXPORT_STD template _NODISCARD _Ty arg(const complex<_Ty>& _Left) { // return phase angle of complex as real return _Ctraits<_Ty>::atan2(imag(_Left), real(_Left)); } -template +_EXPORT_STD template _NODISCARD _CONSTEXPR20 complex<_Ty> conj(const complex<_Ty>& _Left) { // return complex conjugate return complex<_Ty>(real(_Left), -imag(_Left)); } -template +_EXPORT_STD template _NODISCARD complex<_Ty> proj(const complex<_Ty>& _Left) { // return complex projection if (_Ctraits<_Ty>::_Isinf(real(_Left)) || _Ctraits<_Ty>::_Isinf(imag(_Left))) { const _Ty _Imag = _Ctraits<_Ty>::_Copysign(_Ty{0}, imag(_Left)); @@ -2064,23 +2064,23 @@ _NODISCARD complex<_Ty> proj(const complex<_Ty>& _Left) { // return complex proj return _Left; } -template +_EXPORT_STD template _NODISCARD complex<_Ty> cos(const complex<_Ty>& _Left) { return complex<_Ty>(_Ctraits<_Ty>::_Cosh(imag(_Left), _Ctraits<_Ty>::cos(real(_Left))), -_Ctraits<_Ty>::_Sinh(imag(_Left), _Ctraits<_Ty>::sin(real(_Left)))); } -template +_EXPORT_STD template _NODISCARD complex<_Ty> log10(const complex<_Ty>& _Left) { return log(_Left) * static_cast<_Ty>(0.43429448190325182765112891891660508L); } -template +_EXPORT_STD template _NODISCARD _CONSTEXPR20 _Ty norm(const complex<_Ty>& _Left) { // return squared magnitude return real(_Left) * real(_Left) + imag(_Left) * imag(_Left); } -template +_EXPORT_STD template _NODISCARD complex<_Ty> polar(const _Ty& _Rho, const _Ty& _Theta) { // return _Rho * exp(i * _Theta) as complex if (!_Ctraits<_Ty>::_Isnan(_Rho) && !_Ctraits<_Ty>::_Isinf(_Rho) && _Rho != _Ty{0}) { // _Rho is finite non-zero return complex<_Ty>(_Rho * _Ctraits<_Ty>::cos(_Theta), _Rho * _Ctraits<_Ty>::sin(_Theta)); @@ -2094,18 +2094,18 @@ _NODISCARD complex<_Ty> polar(const _Ty& _Rho, const _Ty& _Theta) { // return _R } } -template +_EXPORT_STD template _NODISCARD complex<_Ty> polar(const _Ty& _Rho) { // return _Rho * exp(i * 0) as complex return complex<_Ty>(_Rho, _Ty{0}); } -template +_EXPORT_STD template _NODISCARD complex<_Ty> sin(const complex<_Ty>& _Left) { return complex<_Ty>(_Ctraits<_Ty>::_Cosh(imag(_Left), _Ctraits<_Ty>::sin(real(_Left))), _Ctraits<_Ty>::_Sinh(imag(_Left), _Ctraits<_Ty>::cos(real(_Left)))); } -template +_EXPORT_STD template _NODISCARD complex<_Ty> tan(const complex<_Ty>& _Left) { complex<_Ty> _Zv(tanh(complex<_Ty>(-imag(_Left), real(_Left)))); return complex<_Ty>(imag(_Zv), -real(_Zv)); @@ -2114,7 +2114,7 @@ _NODISCARD complex<_Ty> tan(const complex<_Ty>& _Left) { template using _Upgrade_to_double = conditional_t, double, _Ty>; -template , int> = 0> +_EXPORT_STD template , int> = 0> _NODISCARD _Upgrade_to_double<_Ty> arg(_Ty _Left) { using _Upgraded = _Upgrade_to_double<_Ty>; const auto _Val = static_cast<_Upgraded>(_Left); @@ -2122,12 +2122,12 @@ _NODISCARD _Upgrade_to_double<_Ty> arg(_Ty _Left) { return _Ctraits<_Upgraded>::atan2(0, _Val); } -template , int> = 0> +_EXPORT_STD template , int> = 0> _NODISCARD _CONSTEXPR20 _Upgrade_to_double<_Ty> imag(_Ty) { return 0; } -template , int> = 0> +_EXPORT_STD template , int> = 0> _NODISCARD _CONSTEXPR20 _Upgrade_to_double<_Ty> real(_Ty _Left) { using _Upgraded = _Upgrade_to_double<_Ty>; const auto _Val = static_cast<_Upgraded>(_Left); @@ -2135,7 +2135,7 @@ _NODISCARD _CONSTEXPR20 _Upgrade_to_double<_Ty> real(_Ty _Left) { return _Val; } -template , int> = 0> +_EXPORT_STD template , int> = 0> _NODISCARD _CONSTEXPR20 _Upgrade_to_double<_Ty> norm(_Ty _Left) { using _Upgraded = _Upgrade_to_double<_Ty>; const auto _Val = static_cast<_Upgraded>(_Left); @@ -2143,7 +2143,7 @@ _NODISCARD _CONSTEXPR20 _Upgrade_to_double<_Ty> norm(_Ty _Left) { return _Val * _Val; } -template , int> = 0> +_EXPORT_STD template , int> = 0> _NODISCARD _CONSTEXPR20 complex<_Upgrade_to_double<_Ty>> conj(_Ty _Left) { using _Upgraded = _Upgrade_to_double<_Ty>; const auto _Val = static_cast<_Upgraded>(_Left); @@ -2151,7 +2151,7 @@ _NODISCARD _CONSTEXPR20 complex<_Upgrade_to_double<_Ty>> conj(_Ty _Left) { return complex<_Upgraded>(_Val, -_Upgraded{0}); } -template , int> = 0> +_EXPORT_STD template , int> = 0> _NODISCARD complex<_Upgrade_to_double<_Ty>> proj(_Ty _Left) { using _Upgraded = _Upgrade_to_double<_Ty>; const auto _Val = static_cast<_Upgraded>(_Left); @@ -2165,27 +2165,27 @@ _NODISCARD complex<_Upgrade_to_double<_Ty>> proj(_Ty _Left) { return complex<_Upgraded>(_Val, 0); } -template +_EXPORT_STD template _NODISCARD complex<_Common_float_type_t<_Ty1, _Ty2>> pow(const complex<_Ty1>& _Left, const complex<_Ty2>& _Right) { using _Type = complex<_Common_float_type_t<_Ty1, _Ty2>>; return _STD pow(_Type(_Left), _Type(_Right)); } -template , int> = 0> +_EXPORT_STD template , int> = 0> _NODISCARD complex<_Common_float_type_t<_Ty1, _Ty2>> pow(const complex<_Ty1>& _Left, const _Ty2& _Right) { using _Promoted = _Common_float_type_t<_Ty1, _Ty2>; using _Type = complex<_Promoted>; return _STD pow(_Type(_Left), _Type(static_cast<_Promoted>(_Right))); } -template , int> = 0> +_EXPORT_STD template , int> = 0> _NODISCARD complex<_Common_float_type_t<_Ty1, _Ty2>> pow(const _Ty1& _Left, const complex<_Ty2>& _Right) { using _Promoted = _Common_float_type_t<_Ty1, _Ty2>; using _Type = complex<_Promoted>; return _STD pow(_Type(static_cast<_Promoted>(_Left)), _Type(_Right)); } -template +_EXPORT_STD template basic_istream<_Elem, _Tr>& operator>>(basic_istream<_Elem, _Tr>& _Istr, complex<_Ty>& _Right) { const ctype<_Elem>& _Ctype_fac = _STD use_facet>(_Istr.getloc()); _Elem _Ch = 0; @@ -2215,7 +2215,7 @@ basic_istream<_Elem, _Tr>& operator>>(basic_istream<_Elem, _Tr>& _Istr, complex< return _Istr; } -template +_EXPORT_STD template basic_ostream<_Elem, _Tr>& operator<<(basic_ostream<_Elem, _Tr>& _Ostr, const complex<_Ty>& _Right) { const ctype<_Elem>& _Ctype_fac = _STD use_facet>(_Ostr.getloc()); basic_ostringstream<_Elem, _Tr, allocator<_Elem>> _Sstr; @@ -2230,27 +2230,27 @@ basic_ostream<_Elem, _Tr>& operator<<(basic_ostream<_Elem, _Tr>& _Ostr, const co inline namespace literals { inline namespace complex_literals { - _NODISCARD constexpr complex operator""il(long double _Val) { + _EXPORT_STD _NODISCARD constexpr complex operator""il(long double _Val) { return complex(0.0L, static_cast(_Val)); } - _NODISCARD constexpr complex operator""il(unsigned long long _Val) { + _EXPORT_STD _NODISCARD constexpr complex operator""il(unsigned long long _Val) { return complex(0.0L, static_cast(_Val)); } - _NODISCARD constexpr complex operator""i(long double _Val) { + _EXPORT_STD _NODISCARD constexpr complex operator""i(long double _Val) { return complex(0.0, static_cast(_Val)); } - _NODISCARD constexpr complex operator""i(unsigned long long _Val) { + _EXPORT_STD _NODISCARD constexpr complex operator""i(unsigned long long _Val) { return complex(0.0, static_cast(_Val)); } - _NODISCARD constexpr complex operator""if(long double _Val) { + _EXPORT_STD _NODISCARD constexpr complex operator""if(long double _Val) { return complex(0.0f, static_cast(_Val)); } - _NODISCARD constexpr complex operator""if(unsigned long long _Val) { + _EXPORT_STD _NODISCARD constexpr complex operator""if(unsigned long long _Val) { return complex(0.0f, static_cast(_Val)); } } // namespace complex_literals diff --git a/stl/inc/concepts b/stl/inc/concepts index 0604da2002..49585e00ea 100644 --- a/stl/inc/concepts +++ b/stl/inc/concepts @@ -32,14 +32,14 @@ concept _Same_impl = // Must be a distinct concept to provide symmetric subsumpt is_same_v<_Ty1, _Ty2>; #endif // __clang__ -template +_EXPORT_STD template concept same_as = _Same_impl<_Ty1, _Ty2> && _Same_impl<_Ty2, _Ty1>; -template +_EXPORT_STD template concept derived_from = __is_base_of(_Base, _Derived) && __is_convertible_to(const volatile _Derived*, const volatile _Base*); -template +_EXPORT_STD template #if !defined(__EDG__) && !defined(__clang__) // TRANSITION, DevCom-1627396 concept convertible_to = is_convertible_v<_From, _To> #else // ^^^ workaround / no workaround vvv @@ -52,7 +52,7 @@ concept convertible_to = __is_convertible_to(_From, _To) template concept _Implicitly_convertible_to = is_convertible_v<_From, _To>; -template +_EXPORT_STD template concept common_reference_with = requires { typename common_reference_t<_Ty1, _Ty2>; @@ -62,7 +62,7 @@ concept common_reference_with = && convertible_to<_Ty1, common_reference_t<_Ty1, _Ty2>> && convertible_to<_Ty2, common_reference_t<_Ty1, _Ty2>>; -template +_EXPORT_STD template concept common_with = requires { typename common_type_t<_Ty1, _Ty2>; @@ -77,19 +77,19 @@ concept common_with = && common_reference_with>, common_reference_t, add_lvalue_reference_t>>; -template +_EXPORT_STD template concept integral = is_integral_v<_Ty>; -template +_EXPORT_STD template concept signed_integral = integral<_Ty> && static_cast<_Ty>(-1) < static_cast<_Ty>(0); -template +_EXPORT_STD template concept unsigned_integral = integral<_Ty> && !signed_integral<_Ty>; -template +_EXPORT_STD template concept floating_point = is_floating_point_v<_Ty>; -template +_EXPORT_STD template concept assignable_from = is_lvalue_reference_v<_LTy> && common_reference_with&, const remove_reference_t<_RTy>&> && requires(_LTy _Left, _RTy&& _Right) { @@ -98,21 +98,21 @@ concept assignable_from = is_lvalue_reference_v<_LTy> // swappable and swappable_with are defined below, since they depend on move_constructible. -template +_EXPORT_STD template concept destructible = __is_nothrow_destructible(_Ty); -template +_EXPORT_STD template concept constructible_from = destructible<_Ty> && __is_constructible(_Ty, _ArgTys...); -template +_EXPORT_STD template concept default_initializable = constructible_from<_Ty> && requires { _Ty{}; ::new (static_cast(nullptr)) _Ty; // is-default-initializable<_Ty> }; -template +_EXPORT_STD template concept move_constructible = constructible_from<_Ty, _Ty> && convertible_to<_Ty, _Ty>; template @@ -159,16 +159,16 @@ namespace ranges { } // namespace _Swap inline namespace _Cpos { - inline constexpr _Swap::_Cpo swap; + _EXPORT_STD inline constexpr _Swap::_Cpo swap; } } // namespace ranges -template +_EXPORT_STD template concept swappable = requires(_Ty& __x, _Ty& __y) { _RANGES swap(__x, __y); }; -template +_EXPORT_STD template concept swappable_with = common_reference_with<_Ty1, _Ty2> && requires(_Ty1&& __t, _Ty2&& __u) { _RANGES swap(static_cast<_Ty1&&>(__t), static_cast<_Ty1&&>(__t)); @@ -177,7 +177,7 @@ concept swappable_with = common_reference_with<_Ty1, _Ty2> _RANGES swap(static_cast<_Ty2&&>(__u), static_cast<_Ty1&&>(__t)); }; -template +_EXPORT_STD template concept copy_constructible = move_constructible<_Ty> && constructible_from<_Ty, _Ty&> && convertible_to<_Ty&, _Ty> && constructible_from<_Ty, const _Ty&> && convertible_to @@ -203,10 +203,10 @@ template concept _Weakly_equality_comparable_with = _Half_equality_comparable<_Ty1, _Ty2> && _Half_equality_comparable<_Ty2, _Ty1>; -template +_EXPORT_STD template concept equality_comparable = _Half_equality_comparable<_Ty, _Ty>; -template +_EXPORT_STD template concept equality_comparable_with = equality_comparable<_Ty1> && equality_comparable<_Ty2> && common_reference_with&, const remove_reference_t<_Ty2>&> && equality_comparable&, const remove_reference_t<_Ty2>&>> @@ -223,57 +223,57 @@ concept _Half_ordered = requires(const remove_reference_t<_Ty1>& __t, const remo template concept _Partially_ordered_with = _Half_ordered<_Ty1, _Ty2> && _Half_ordered<_Ty2, _Ty1>; -template +_EXPORT_STD template concept totally_ordered = equality_comparable<_Ty> && _Half_ordered<_Ty, _Ty>; -template +_EXPORT_STD template concept totally_ordered_with = totally_ordered<_Ty1> && totally_ordered<_Ty2> && equality_comparable_with<_Ty1, _Ty2> && totally_ordered&, const remove_reference_t<_Ty2>&>> && _Partially_ordered_with<_Ty1, _Ty2>; -template +_EXPORT_STD template concept movable = is_object_v<_Ty> && move_constructible<_Ty> && assignable_from<_Ty&, _Ty> && swappable<_Ty>; -template +_EXPORT_STD template concept copyable = copy_constructible<_Ty> && movable<_Ty> && assignable_from<_Ty&, _Ty&> && assignable_from<_Ty&, const _Ty&> && assignable_from<_Ty&, const _Ty>; -template +_EXPORT_STD template concept semiregular = copyable<_Ty> && default_initializable<_Ty>; -template +_EXPORT_STD template concept regular = semiregular<_Ty> && equality_comparable<_Ty>; -template +_EXPORT_STD template concept invocable = requires(_FTy&& _Fn, _ArgTys&&... _Args) { _STD invoke(static_cast<_FTy&&>(_Fn), static_cast<_ArgTys&&>(_Args)...); }; -template +_EXPORT_STD template concept regular_invocable = invocable<_FTy, _ArgTys...>; -template +_EXPORT_STD template concept predicate = regular_invocable<_FTy, _ArgTys...> && _Boolean_testable>; -template +_EXPORT_STD template concept relation = predicate<_FTy, _Ty1, _Ty1> && predicate<_FTy, _Ty2, _Ty2> && predicate<_FTy, _Ty1, _Ty2> && predicate<_FTy, _Ty2, _Ty1>; -template +_EXPORT_STD template concept equivalence_relation = relation<_FTy, _Ty1, _Ty2>; -template +_EXPORT_STD template concept strict_weak_order = relation<_FTy, _Ty1, _Ty2>; // clang-format on diff --git a/stl/inc/condition_variable b/stl/inc/condition_variable index 5d0641c718..fc11f39d58 100644 --- a/stl/inc/condition_variable +++ b/stl/inc/condition_variable @@ -49,7 +49,7 @@ private: _Lock& _Mtx; }; -class condition_variable_any { // class for waiting for conditions with any kind of mutex +_EXPORT_STD class condition_variable_any { // class for waiting for conditions with any kind of mutex public: condition_variable_any() : _Myptr{_STD make_shared()} { _Cnd_init_in_situ(_Mycnd()); @@ -273,7 +273,7 @@ private: } }; -inline void notify_all_at_thread_exit(condition_variable& _Cnd, unique_lock _Lck) { +_EXPORT_STD inline void notify_all_at_thread_exit(condition_variable& _Cnd, unique_lock _Lck) { // register _Cnd for release at thread exit _Cnd._Register(_Lck, nullptr); } diff --git a/stl/inc/coroutine b/stl/inc/coroutine index d884eba9c9..3f9b6de971 100644 --- a/stl/inc/coroutine +++ b/stl/inc/coroutine @@ -43,10 +43,10 @@ struct _Coroutine_traits<_Ret, void_t> { using promise_type = typename _Ret::promise_type; }; -template +_EXPORT_STD template struct coroutine_traits : _Coroutine_traits<_Ret> {}; -template +_EXPORT_STD template struct coroutine_handle; template <> @@ -93,7 +93,7 @@ private: void* _Ptr = nullptr; }; -template +_EXPORT_STD template struct coroutine_handle { constexpr coroutine_handle() noexcept = default; constexpr coroutine_handle(nullptr_t) noexcept {} @@ -153,12 +153,13 @@ private: void* _Ptr = nullptr; }; -_NODISCARD constexpr bool operator==(const coroutine_handle<> _Left, const coroutine_handle<> _Right) noexcept { +_EXPORT_STD _NODISCARD constexpr bool operator==( + const coroutine_handle<> _Left, const coroutine_handle<> _Right) noexcept { return _Left.address() == _Right.address(); } #if _HAS_CXX20 -_NODISCARD constexpr strong_ordering operator<=>( +_EXPORT_STD _NODISCARD constexpr strong_ordering operator<=>( const coroutine_handle<> _Left, const coroutine_handle<> _Right) noexcept { #ifdef __cpp_lib_concepts return compare_three_way{}(_Left.address(), _Right.address()); @@ -195,7 +196,7 @@ struct hash> { } }; -struct noop_coroutine_promise {}; +_EXPORT_STD struct noop_coroutine_promise {}; template <> struct coroutine_handle { @@ -231,14 +232,14 @@ private: void* _Ptr = __builtin_coro_noop(); }; -using noop_coroutine_handle = coroutine_handle; +_EXPORT_STD using noop_coroutine_handle = coroutine_handle; -_NODISCARD inline noop_coroutine_handle noop_coroutine() noexcept { +_EXPORT_STD _NODISCARD inline noop_coroutine_handle noop_coroutine() noexcept { // Returns a handle to a coroutine that has no observable effects when resumed or destroyed. return noop_coroutine_handle{}; } -struct suspend_never { +_EXPORT_STD struct suspend_never { _NODISCARD constexpr bool await_ready() const noexcept { return true; } @@ -247,7 +248,7 @@ struct suspend_never { constexpr void await_resume() const noexcept {} }; -struct suspend_always { +_EXPORT_STD struct suspend_always { _NODISCARD constexpr bool await_ready() const noexcept { return false; } diff --git a/stl/inc/csetjmp b/stl/inc/csetjmp index 802ff156e6..c22d99775a 100644 --- a/stl/inc/csetjmp +++ b/stl/inc/csetjmp @@ -19,8 +19,8 @@ _STL_DISABLE_CLANG_WARNINGS #undef new _STD_BEGIN -using ::jmp_buf; -using ::longjmp; +_EXPORT_STD using ::jmp_buf; +_EXPORT_STD using ::longjmp; using ::setjmp; _STD_END diff --git a/stl/inc/csignal b/stl/inc/csignal index 720c6d1150..5eba45955a 100644 --- a/stl/inc/csignal +++ b/stl/inc/csignal @@ -19,10 +19,10 @@ _STL_DISABLE_CLANG_WARNINGS #undef new _STD_BEGIN -using _CSTD sig_atomic_t; -using _CSTD raise; +_EXPORT_STD using _CSTD sig_atomic_t; +_EXPORT_STD using _CSTD raise; #ifndef _M_CEE_PURE -using _CSTD signal; +_EXPORT_STD using _CSTD signal; #endif // _M_CEE_PURE _STD_END diff --git a/stl/inc/cstdarg b/stl/inc/cstdarg index f9897bcb17..e1f2c08e5a 100644 --- a/stl/inc/cstdarg +++ b/stl/inc/cstdarg @@ -19,7 +19,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new _STD_BEGIN -using ::va_list; +_EXPORT_STD using ::va_list; _STD_END #pragma pop_macro("new") diff --git a/stl/inc/cstddef b/stl/inc/cstddef index b810544336..91aa280202 100644 --- a/stl/inc/cstddef +++ b/stl/inc/cstddef @@ -20,71 +20,72 @@ _STL_DISABLE_CLANG_WARNINGS #undef new _STD_BEGIN -using _CSTD ptrdiff_t; -using _CSTD size_t; -using max_align_t = double; // most aligned type +_EXPORT_STD using _CSTD ptrdiff_t; +_EXPORT_STD using _CSTD size_t; +_EXPORT_STD using max_align_t = double; // most aligned type +_EXPORT_STD using nullptr_t = decltype(nullptr); #ifdef __cpp_lib_byte -enum class byte : unsigned char {}; +_EXPORT_STD enum class byte : unsigned char {}; -template , int> = 0> +_EXPORT_STD template , int> = 0> _NODISCARD constexpr byte operator<<(const byte _Arg, const _IntType _Shift) noexcept { // every static_cast is intentional return static_cast(static_cast(static_cast(_Arg) << _Shift)); } -template , int> = 0> +_EXPORT_STD template , int> = 0> _NODISCARD constexpr byte operator>>(const byte _Arg, const _IntType _Shift) noexcept { // every static_cast is intentional return static_cast(static_cast(static_cast(_Arg) >> _Shift)); } -_NODISCARD constexpr byte operator|(const byte _Left, const byte _Right) noexcept { +_EXPORT_STD _NODISCARD constexpr byte operator|(const byte _Left, const byte _Right) noexcept { // every static_cast is intentional return static_cast( static_cast(static_cast(_Left) | static_cast(_Right))); } -_NODISCARD constexpr byte operator&(const byte _Left, const byte _Right) noexcept { +_EXPORT_STD _NODISCARD constexpr byte operator&(const byte _Left, const byte _Right) noexcept { // every static_cast is intentional return static_cast( static_cast(static_cast(_Left) & static_cast(_Right))); } -_NODISCARD constexpr byte operator^(const byte _Left, const byte _Right) noexcept { +_EXPORT_STD _NODISCARD constexpr byte operator^(const byte _Left, const byte _Right) noexcept { // every static_cast is intentional return static_cast( static_cast(static_cast(_Left) ^ static_cast(_Right))); } -_NODISCARD constexpr byte operator~(const byte _Arg) noexcept { +_EXPORT_STD _NODISCARD constexpr byte operator~(const byte _Arg) noexcept { // every static_cast is intentional return static_cast(static_cast(~static_cast(_Arg))); } -template , int> = 0> +_EXPORT_STD template , int> = 0> constexpr byte& operator<<=(byte& _Arg, const _IntType _Shift) noexcept { return _Arg = _Arg << _Shift; } -template , int> = 0> +_EXPORT_STD template , int> = 0> constexpr byte& operator>>=(byte& _Arg, const _IntType _Shift) noexcept { return _Arg = _Arg >> _Shift; } -constexpr byte& operator|=(byte& _Left, const byte _Right) noexcept { +_EXPORT_STD constexpr byte& operator|=(byte& _Left, const byte _Right) noexcept { return _Left = _Left | _Right; } -constexpr byte& operator&=(byte& _Left, const byte _Right) noexcept { +_EXPORT_STD constexpr byte& operator&=(byte& _Left, const byte _Right) noexcept { return _Left = _Left & _Right; } -constexpr byte& operator^=(byte& _Left, const byte _Right) noexcept { +_EXPORT_STD constexpr byte& operator^=(byte& _Left, const byte _Right) noexcept { return _Left = _Left ^ _Right; } -template , int> = 0> +_EXPORT_STD template , int> = 0> _NODISCARD constexpr _IntType to_integer(const byte _Arg) noexcept { return static_cast<_IntType>(_Arg); } diff --git a/stl/inc/cstdint b/stl/inc/cstdint index c61aed7d7b..e581d104da 100644 --- a/stl/inc/cstdint +++ b/stl/inc/cstdint @@ -19,37 +19,37 @@ _STL_DISABLE_CLANG_WARNINGS #undef new _STD_BEGIN -using _CSTD int8_t; -using _CSTD int16_t; -using _CSTD int32_t; -using _CSTD int64_t; -using _CSTD uint8_t; -using _CSTD uint16_t; -using _CSTD uint32_t; -using _CSTD uint64_t; +_EXPORT_STD using _CSTD int8_t; +_EXPORT_STD using _CSTD int16_t; +_EXPORT_STD using _CSTD int32_t; +_EXPORT_STD using _CSTD int64_t; +_EXPORT_STD using _CSTD uint8_t; +_EXPORT_STD using _CSTD uint16_t; +_EXPORT_STD using _CSTD uint32_t; +_EXPORT_STD using _CSTD uint64_t; -using _CSTD int_least8_t; -using _CSTD int_least16_t; -using _CSTD int_least32_t; -using _CSTD int_least64_t; -using _CSTD uint_least8_t; -using _CSTD uint_least16_t; -using _CSTD uint_least32_t; -using _CSTD uint_least64_t; +_EXPORT_STD using _CSTD int_least8_t; +_EXPORT_STD using _CSTD int_least16_t; +_EXPORT_STD using _CSTD int_least32_t; +_EXPORT_STD using _CSTD int_least64_t; +_EXPORT_STD using _CSTD uint_least8_t; +_EXPORT_STD using _CSTD uint_least16_t; +_EXPORT_STD using _CSTD uint_least32_t; +_EXPORT_STD using _CSTD uint_least64_t; -using _CSTD int_fast8_t; -using _CSTD int_fast16_t; -using _CSTD int_fast32_t; -using _CSTD int_fast64_t; -using _CSTD uint_fast8_t; -using _CSTD uint_fast16_t; -using _CSTD uint_fast32_t; -using _CSTD uint_fast64_t; +_EXPORT_STD using _CSTD int_fast8_t; +_EXPORT_STD using _CSTD int_fast16_t; +_EXPORT_STD using _CSTD int_fast32_t; +_EXPORT_STD using _CSTD int_fast64_t; +_EXPORT_STD using _CSTD uint_fast8_t; +_EXPORT_STD using _CSTD uint_fast16_t; +_EXPORT_STD using _CSTD uint_fast32_t; +_EXPORT_STD using _CSTD uint_fast64_t; -using _CSTD intmax_t; -using _CSTD intptr_t; -using _CSTD uintmax_t; -using _CSTD uintptr_t; +_EXPORT_STD using _CSTD intmax_t; +_EXPORT_STD using _CSTD intptr_t; +_EXPORT_STD using _CSTD uintmax_t; +_EXPORT_STD using _CSTD uintptr_t; #if _HAS_TR1_NAMESPACE namespace _DEPRECATE_TR1_NAMESPACE tr1 { diff --git a/stl/inc/cstdio b/stl/inc/cstdio index 78aa8aac77..5aaa8b5a8f 100644 --- a/stl/inc/cstdio +++ b/stl/inc/cstdio @@ -36,55 +36,55 @@ _STD_BEGIN using _CSTD _Mbstatet; -using _CSTD size_t; -using _CSTD fpos_t; -using _CSTD FILE; -using _CSTD clearerr; -using _CSTD fclose; -using _CSTD feof; -using _CSTD ferror; -using _CSTD fflush; -using _CSTD fgetc; -using _CSTD fgetpos; -using _CSTD fgets; -using _CSTD fopen; -using _CSTD fprintf; -using _CSTD fputc; -using _CSTD fputs; -using _CSTD fread; -using _CSTD freopen; -using _CSTD fscanf; -using _CSTD fseek; -using _CSTD fsetpos; -using _CSTD ftell; -using _CSTD fwrite; -using _CSTD getc; -using _CSTD getchar; -using _CSTD perror; -using _CSTD putc; -using _CSTD putchar; -using _CSTD printf; -using _CSTD puts; -using _CSTD remove; -using _CSTD rename; -using _CSTD rewind; -using _CSTD scanf; -using _CSTD setbuf; -using _CSTD setvbuf; -using _CSTD sprintf; -using _CSTD sscanf; -using _CSTD tmpfile; -using _CSTD tmpnam; -using _CSTD ungetc; -using _CSTD vfprintf; -using _CSTD vprintf; -using _CSTD vsprintf; +_EXPORT_STD using _CSTD size_t; +_EXPORT_STD using _CSTD fpos_t; +_EXPORT_STD using _CSTD FILE; +_EXPORT_STD using _CSTD clearerr; +_EXPORT_STD using _CSTD fclose; +_EXPORT_STD using _CSTD feof; +_EXPORT_STD using _CSTD ferror; +_EXPORT_STD using _CSTD fflush; +_EXPORT_STD using _CSTD fgetc; +_EXPORT_STD using _CSTD fgetpos; +_EXPORT_STD using _CSTD fgets; +_EXPORT_STD using _CSTD fopen; +_EXPORT_STD using _CSTD fprintf; +_EXPORT_STD using _CSTD fputc; +_EXPORT_STD using _CSTD fputs; +_EXPORT_STD using _CSTD fread; +_EXPORT_STD using _CSTD freopen; +_EXPORT_STD using _CSTD fscanf; +_EXPORT_STD using _CSTD fseek; +_EXPORT_STD using _CSTD fsetpos; +_EXPORT_STD using _CSTD ftell; +_EXPORT_STD using _CSTD fwrite; +_EXPORT_STD using _CSTD getc; +_EXPORT_STD using _CSTD getchar; +_EXPORT_STD using _CSTD perror; +_EXPORT_STD using _CSTD putc; +_EXPORT_STD using _CSTD putchar; +_EXPORT_STD using _CSTD printf; +_EXPORT_STD using _CSTD puts; +_EXPORT_STD using _CSTD remove; +_EXPORT_STD using _CSTD rename; +_EXPORT_STD using _CSTD rewind; +_EXPORT_STD using _CSTD scanf; +_EXPORT_STD using _CSTD setbuf; +_EXPORT_STD using _CSTD setvbuf; +_EXPORT_STD using _CSTD sprintf; +_EXPORT_STD using _CSTD sscanf; +_EXPORT_STD using _CSTD tmpfile; +_EXPORT_STD using _CSTD tmpnam; +_EXPORT_STD using _CSTD ungetc; +_EXPORT_STD using _CSTD vfprintf; +_EXPORT_STD using _CSTD vprintf; +_EXPORT_STD using _CSTD vsprintf; -using _CSTD snprintf; -using _CSTD vsnprintf; -using _CSTD vfscanf; -using _CSTD vscanf; -using _CSTD vsscanf; +_EXPORT_STD using _CSTD snprintf; +_EXPORT_STD using _CSTD vsnprintf; +_EXPORT_STD using _CSTD vfscanf; +_EXPORT_STD using _CSTD vscanf; +_EXPORT_STD using _CSTD vsscanf; #pragma warning(pop) _STD_END diff --git a/stl/inc/cstdlib b/stl/inc/cstdlib index 6507887012..91941aa282 100644 --- a/stl/inc/cstdlib +++ b/stl/inc/cstdlib @@ -33,52 +33,52 @@ _NODISCARD _Check_return_ inline long double abs(_In_ long double _Xx) noexcept } _STD_BEGIN -using _CSTD size_t; -using _CSTD div_t; -using _CSTD ldiv_t; -using _CSTD abort; -using _CSTD abs; -using _CSTD atexit; -using _CSTD atof; -using _CSTD atoi; -using _CSTD atol; -using _CSTD bsearch; -using _CSTD calloc; -using _CSTD div; -using _CSTD exit; -using _CSTD free; -using _CSTD labs; -using _CSTD ldiv; -using _CSTD malloc; -using _CSTD mblen; -using _CSTD mbstowcs; -using _CSTD mbtowc; -using _CSTD qsort; -using _CSTD rand; -using _CSTD realloc; -using _CSTD srand; -using _CSTD strtod; -using _CSTD strtol; -using _CSTD strtoul; -using _CSTD wcstombs; -using _CSTD wctomb; +_EXPORT_STD using _CSTD size_t; +_EXPORT_STD using _CSTD div_t; +_EXPORT_STD using _CSTD ldiv_t; +_EXPORT_STD using _CSTD abort; +_EXPORT_STD using _CSTD abs; +_EXPORT_STD using _CSTD atexit; +_EXPORT_STD using _CSTD atof; +_EXPORT_STD using _CSTD atoi; +_EXPORT_STD using _CSTD atol; +_EXPORT_STD using _CSTD bsearch; +_EXPORT_STD using _CSTD calloc; +_EXPORT_STD using _CSTD div; +_EXPORT_STD using _CSTD exit; +_EXPORT_STD using _CSTD free; +_EXPORT_STD using _CSTD labs; +_EXPORT_STD using _CSTD ldiv; +_EXPORT_STD using _CSTD malloc; +_EXPORT_STD using _CSTD mblen; +_EXPORT_STD using _CSTD mbstowcs; +_EXPORT_STD using _CSTD mbtowc; +_EXPORT_STD using _CSTD qsort; +_EXPORT_STD using _CSTD rand; +_EXPORT_STD using _CSTD realloc; +_EXPORT_STD using _CSTD srand; +_EXPORT_STD using _CSTD strtod; +_EXPORT_STD using _CSTD strtol; +_EXPORT_STD using _CSTD strtoul; +_EXPORT_STD using _CSTD wcstombs; +_EXPORT_STD using _CSTD wctomb; -using _CSTD lldiv_t; +_EXPORT_STD using _CSTD lldiv_t; -using _CSTD getenv; -using _CSTD system; +_EXPORT_STD using _CSTD getenv; +_EXPORT_STD using _CSTD system; -using _CSTD atoll; -using _CSTD llabs; -using _CSTD lldiv; -using _CSTD strtof; -using _CSTD strtold; -using _CSTD strtoll; -using _CSTD strtoull; +_EXPORT_STD using _CSTD atoll; +_EXPORT_STD using _CSTD llabs; +_EXPORT_STD using _CSTD lldiv; +_EXPORT_STD using _CSTD strtof; +_EXPORT_STD using _CSTD strtold; +_EXPORT_STD using _CSTD strtoll; +_EXPORT_STD using _CSTD strtoull; -using _CSTD _Exit; -using _CSTD at_quick_exit; -using _CSTD quick_exit; +_EXPORT_STD using _CSTD _Exit; +_EXPORT_STD using _CSTD at_quick_exit; +_EXPORT_STD using _CSTD quick_exit; _STD_END #pragma pop_macro("new") diff --git a/stl/inc/cstring b/stl/inc/cstring index a0140aa307..c82b78638d 100644 --- a/stl/inc/cstring +++ b/stl/inc/cstring @@ -22,29 +22,29 @@ _STD_BEGIN #pragma warning(push) #pragma warning(disable : 4995) // name was marked as #pragma deprecated -using _CSTD size_t; -using _CSTD memchr; -using _CSTD memcmp; -using _CSTD memcpy; -using _CSTD memmove; -using _CSTD memset; -using _CSTD strcat; -using _CSTD strchr; -using _CSTD strcmp; -using _CSTD strcoll; -using _CSTD strcpy; -using _CSTD strcspn; -using _CSTD strerror; -using _CSTD strlen; -using _CSTD strncat; -using _CSTD strncmp; -using _CSTD strncpy; -using _CSTD strpbrk; -using _CSTD strrchr; -using _CSTD strspn; -using _CSTD strstr; -using _CSTD strtok; -using _CSTD strxfrm; +_EXPORT_STD using _CSTD size_t; +_EXPORT_STD using _CSTD memchr; +_EXPORT_STD using _CSTD memcmp; +_EXPORT_STD using _CSTD memcpy; +_EXPORT_STD using _CSTD memmove; +_EXPORT_STD using _CSTD memset; +_EXPORT_STD using _CSTD strcat; +_EXPORT_STD using _CSTD strchr; +_EXPORT_STD using _CSTD strcmp; +_EXPORT_STD using _CSTD strcoll; +_EXPORT_STD using _CSTD strcpy; +_EXPORT_STD using _CSTD strcspn; +_EXPORT_STD using _CSTD strerror; +_EXPORT_STD using _CSTD strlen; +_EXPORT_STD using _CSTD strncat; +_EXPORT_STD using _CSTD strncmp; +_EXPORT_STD using _CSTD strncpy; +_EXPORT_STD using _CSTD strpbrk; +_EXPORT_STD using _CSTD strrchr; +_EXPORT_STD using _CSTD strspn; +_EXPORT_STD using _CSTD strstr; +_EXPORT_STD using _CSTD strtok; +_EXPORT_STD using _CSTD strxfrm; #pragma warning(pop) _STD_END diff --git a/stl/inc/ctime b/stl/inc/ctime index 94ed91c49c..a0bd471efe 100644 --- a/stl/inc/ctime +++ b/stl/inc/ctime @@ -19,23 +19,75 @@ _STL_DISABLE_CLANG_WARNINGS #undef new _STD_BEGIN -using _CSTD clock_t; -using _CSTD size_t; -using _CSTD time_t; -using _CSTD tm; -using _CSTD asctime; -using _CSTD clock; -using _CSTD ctime; -using _CSTD difftime; -using _CSTD gmtime; -using _CSTD localtime; -using _CSTD mktime; -using _CSTD strftime; -using _CSTD time; +_EXPORT_STD using _CSTD clock_t; +_EXPORT_STD using _CSTD size_t; +_EXPORT_STD using _CSTD time_t; +_EXPORT_STD using _CSTD tm; +_EXPORT_STD using _CSTD asctime; +_EXPORT_STD using _CSTD clock; +_EXPORT_STD using _CSTD strftime; #if _HAS_CXX17 -using _CSTD timespec; -using _CSTD timespec_get; +_EXPORT_STD using _CSTD timespec; #endif // _HAS_CXX17 + +#if _HAS_CXX23 && defined(_BUILD_STD_MODULE) // TRANSITION, DevCom-1126857 +_STL_DISABLE_DEPRECATED_WARNING + +// These workaround functions intentionally aren't inline. +_EXPORT_STD +_Check_return_ _CRT_INSECURE_DEPRECATE(ctime_s) +char* __CRTDECL ctime(_In_ const time_t* const _Time) noexcept /* strengthened */ { + return _CSTD _ctime64(_Time); +} + +_EXPORT_STD +_Check_return_ double __CRTDECL difftime(_In_ const time_t _Time1, _In_ const time_t _Time2) noexcept +/* strengthened */ { + return _CSTD _difftime64(_Time1, _Time2); +} + +_EXPORT_STD +_Check_return_ _CRT_INSECURE_DEPRECATE(gmtime_s) +tm* __CRTDECL gmtime(_In_ const time_t* const _Time) noexcept /* strengthened */ { + return _CSTD _gmtime64(_Time); +} + +_EXPORT_STD +_CRT_INSECURE_DEPRECATE(localtime_s) +tm* __CRTDECL localtime(_In_ const time_t* const _Time) noexcept /* strengthened */ { + return _CSTD _localtime64(_Time); +} + +_EXPORT_STD +_Check_return_opt_ time_t __CRTDECL mktime(_Inout_ tm* const _Tm) noexcept /* strengthened */ { + return _CSTD _mktime64(_Tm); +} + +_EXPORT_STD +time_t __CRTDECL time(_Out_opt_ time_t* const _Time) noexcept /* strengthened */ { + return _CSTD _time64(_Time); +} + +_EXPORT_STD +_Check_return_ int __CRTDECL timespec_get(_Out_ timespec* const _Ts, _In_ const int _Base) noexcept /* strengthened */ { + return _CSTD _timespec64_get(reinterpret_cast<_timespec64*>(_Ts), _Base); +} + +_STL_RESTORE_DEPRECATED_WARNING +#else // ^^^ workaround / no workaround vvv + +// _EXPORT_STD has no effect while the workaround is present. +_EXPORT_STD using _CSTD ctime; +_EXPORT_STD using _CSTD difftime; +_EXPORT_STD using _CSTD gmtime; +_EXPORT_STD using _CSTD localtime; +_EXPORT_STD using _CSTD mktime; +_EXPORT_STD using _CSTD time; +#if _HAS_CXX17 +_EXPORT_STD using _CSTD timespec_get; +#endif // _HAS_CXX17 + +#endif // ^^^ no workaround ^^^ _STD_END #pragma pop_macro("new") diff --git a/stl/inc/cuchar b/stl/inc/cuchar index fc8feb0be8..e43d714dbc 100644 --- a/stl/inc/cuchar +++ b/stl/inc/cuchar @@ -19,12 +19,12 @@ _STL_DISABLE_CLANG_WARNINGS #undef new _STD_BEGIN -using _CSTD mbstate_t; -using _CSTD size_t; -using _CSTD mbrtoc16; -using _CSTD c16rtomb; -using _CSTD mbrtoc32; -using _CSTD c32rtomb; +_EXPORT_STD using _CSTD mbstate_t; +_EXPORT_STD using _CSTD size_t; +_EXPORT_STD using _CSTD mbrtoc16; +_EXPORT_STD using _CSTD c16rtomb; +_EXPORT_STD using _CSTD mbrtoc32; +_EXPORT_STD using _CSTD c32rtomb; _STD_END #pragma pop_macro("new") diff --git a/stl/inc/cwchar b/stl/inc/cwchar index 7f48789ab9..8bccfb4f19 100644 --- a/stl/inc/cwchar +++ b/stl/inc/cwchar @@ -27,71 +27,71 @@ _STD_BEGIN using _CSTD _Mbstatet; -using _CSTD mbstate_t; -using _CSTD size_t; -using _CSTD tm; -using _CSTD wint_t; +_EXPORT_STD using _CSTD mbstate_t; +_EXPORT_STD using _CSTD size_t; +_EXPORT_STD using _CSTD tm; +_EXPORT_STD using _CSTD wint_t; -using _CSTD btowc; -using _CSTD fgetwc; -using _CSTD fgetws; -using _CSTD fputwc; -using _CSTD fputws; -using _CSTD fwide; -using _CSTD fwprintf; -using _CSTD fwscanf; -using _CSTD getwc; -using _CSTD getwchar; -using _CSTD mbrlen; -using _CSTD mbrtowc; -using _CSTD mbsrtowcs; -using _CSTD mbsinit; -using _CSTD putwc; -using _CSTD putwchar; -using _CSTD swprintf; -using _CSTD swscanf; -using _CSTD ungetwc; -using _CSTD vfwprintf; -using _CSTD vswprintf; -using _CSTD vwprintf; -using _CSTD wcrtomb; -using _CSTD wprintf; -using _CSTD wscanf; -using _CSTD wcsrtombs; -using _CSTD wcstol; -using _CSTD wcscat; -using _CSTD wcschr; -using _CSTD wcscmp; -using _CSTD wcscoll; -using _CSTD wcscpy; -using _CSTD wcscspn; -using _CSTD wcslen; -using _CSTD wcsncat; -using _CSTD wcsncmp; -using _CSTD wcsncpy; -using _CSTD wcspbrk; -using _CSTD wcsrchr; -using _CSTD wcsspn; -using _CSTD wcstod; -using _CSTD wcstoul; -using _CSTD wcsstr; -using _CSTD wcstok; -using _CSTD wcsxfrm; -using _CSTD wctob; -using _CSTD wmemchr; -using _CSTD wmemcmp; -using _CSTD wmemcpy; -using _CSTD wmemmove; -using _CSTD wmemset; -using _CSTD wcsftime; +_EXPORT_STD using _CSTD btowc; +_EXPORT_STD using _CSTD fgetwc; +_EXPORT_STD using _CSTD fgetws; +_EXPORT_STD using _CSTD fputwc; +_EXPORT_STD using _CSTD fputws; +_EXPORT_STD using _CSTD fwide; +_EXPORT_STD using _CSTD fwprintf; +_EXPORT_STD using _CSTD fwscanf; +_EXPORT_STD using _CSTD getwc; +_EXPORT_STD using _CSTD getwchar; +_EXPORT_STD using _CSTD mbrlen; +_EXPORT_STD using _CSTD mbrtowc; +_EXPORT_STD using _CSTD mbsrtowcs; +_EXPORT_STD using _CSTD mbsinit; +_EXPORT_STD using _CSTD putwc; +_EXPORT_STD using _CSTD putwchar; +_EXPORT_STD using _CSTD swprintf; +_EXPORT_STD using _CSTD swscanf; +_EXPORT_STD using _CSTD ungetwc; +_EXPORT_STD using _CSTD vfwprintf; +_EXPORT_STD using _CSTD vswprintf; +_EXPORT_STD using _CSTD vwprintf; +_EXPORT_STD using _CSTD wcrtomb; +_EXPORT_STD using _CSTD wprintf; +_EXPORT_STD using _CSTD wscanf; +_EXPORT_STD using _CSTD wcsrtombs; +_EXPORT_STD using _CSTD wcstol; +_EXPORT_STD using _CSTD wcscat; +_EXPORT_STD using _CSTD wcschr; +_EXPORT_STD using _CSTD wcscmp; +_EXPORT_STD using _CSTD wcscoll; +_EXPORT_STD using _CSTD wcscpy; +_EXPORT_STD using _CSTD wcscspn; +_EXPORT_STD using _CSTD wcslen; +_EXPORT_STD using _CSTD wcsncat; +_EXPORT_STD using _CSTD wcsncmp; +_EXPORT_STD using _CSTD wcsncpy; +_EXPORT_STD using _CSTD wcspbrk; +_EXPORT_STD using _CSTD wcsrchr; +_EXPORT_STD using _CSTD wcsspn; +_EXPORT_STD using _CSTD wcstod; +_EXPORT_STD using _CSTD wcstoul; +_EXPORT_STD using _CSTD wcsstr; +_EXPORT_STD using _CSTD wcstok; +_EXPORT_STD using _CSTD wcsxfrm; +_EXPORT_STD using _CSTD wctob; +_EXPORT_STD using _CSTD wmemchr; +_EXPORT_STD using _CSTD wmemcmp; +_EXPORT_STD using _CSTD wmemcpy; +_EXPORT_STD using _CSTD wmemmove; +_EXPORT_STD using _CSTD wmemset; +_EXPORT_STD using _CSTD wcsftime; -using _CSTD vfwscanf; -using _CSTD vswscanf; -using _CSTD vwscanf; -using _CSTD wcstof; -using _CSTD wcstold; -using _CSTD wcstoll; -using _CSTD wcstoull; +_EXPORT_STD using _CSTD vfwscanf; +_EXPORT_STD using _CSTD vswscanf; +_EXPORT_STD using _CSTD vwscanf; +_EXPORT_STD using _CSTD wcstof; +_EXPORT_STD using _CSTD wcstold; +_EXPORT_STD using _CSTD wcstoll; +_EXPORT_STD using _CSTD wcstoull; #pragma warning(pop) _STD_END diff --git a/stl/inc/cwctype b/stl/inc/cwctype index 310125edc9..6c48792d14 100644 --- a/stl/inc/cwctype +++ b/stl/inc/cwctype @@ -39,29 +39,29 @@ _STL_DISABLE_CLANG_WARNINGS #undef wctype _STD_BEGIN -using _CSTD wint_t; -using _CSTD wctrans_t; -using _CSTD wctype_t; +_EXPORT_STD using _CSTD wint_t; +_EXPORT_STD using _CSTD wctrans_t; +_EXPORT_STD using _CSTD wctype_t; -using _CSTD iswalnum; -using _CSTD iswalpha; -using _CSTD iswcntrl; -using _CSTD iswctype; -using _CSTD iswdigit; -using _CSTD iswgraph; -using _CSTD iswlower; -using _CSTD iswprint; -using _CSTD iswpunct; -using _CSTD iswspace; -using _CSTD iswupper; -using _CSTD iswxdigit; -using _CSTD towctrans; -using _CSTD towlower; -using _CSTD towupper; -using _CSTD wctrans; -using _CSTD wctype; +_EXPORT_STD using _CSTD iswalnum; +_EXPORT_STD using _CSTD iswalpha; +_EXPORT_STD using _CSTD iswcntrl; +_EXPORT_STD using _CSTD iswctype; +_EXPORT_STD using _CSTD iswdigit; +_EXPORT_STD using _CSTD iswgraph; +_EXPORT_STD using _CSTD iswlower; +_EXPORT_STD using _CSTD iswprint; +_EXPORT_STD using _CSTD iswpunct; +_EXPORT_STD using _CSTD iswspace; +_EXPORT_STD using _CSTD iswupper; +_EXPORT_STD using _CSTD iswxdigit; +_EXPORT_STD using _CSTD towctrans; +_EXPORT_STD using _CSTD towlower; +_EXPORT_STD using _CSTD towupper; +_EXPORT_STD using _CSTD wctrans; +_EXPORT_STD using _CSTD wctype; -using _CSTD iswblank; +_EXPORT_STD using _CSTD iswblank; _STD_END #pragma pop_macro("new") diff --git a/stl/inc/deque b/stl/inc/deque index 04d535fc47..c2802fde09 100644 --- a/stl/inc/deque +++ b/stl/inc/deque @@ -570,7 +570,7 @@ public: size_type _Mysize; // current length of sequence }; -template > +_EXPORT_STD template > class deque { private: friend _Tidy_guard; @@ -1696,12 +1696,12 @@ template <_RANGES input_range _Rng, class _Alloc = allocator<_RANGES range_value deque(from_range_t, _Rng&&, _Alloc = _Alloc()) -> deque<_RANGES range_value_t<_Rng>, _Alloc>; #endif // _HAS_CXX23 && defined(__cpp_lib_concepts) -template +_EXPORT_STD template void swap(deque<_Ty, _Alloc>& _Left, deque<_Ty, _Alloc>& _Right) noexcept /* strengthened */ { _Left.swap(_Right); } -template +_EXPORT_STD template _NODISCARD bool operator==(const deque<_Ty, _Alloc>& _Left, const deque<_Ty, _Alloc>& _Right) { return _Left.size() == _Right.size() && _STD equal(_Left._Unchecked_begin(), _Left._Unchecked_end(), _Right._Unchecked_begin()); @@ -1715,7 +1715,7 @@ _NODISCARD bool operator!=(const deque<_Ty, _Alloc>& _Left, const deque<_Ty, _Al #endif // !_HAS_CXX20 #ifdef __cpp_lib_concepts -template +_EXPORT_STD template _NODISCARD _Synth_three_way_result<_Ty> operator<=>(const deque<_Ty, _Alloc>& _Left, const deque<_Ty, _Alloc>& _Right) { return _STD lexicographical_compare_three_way(_Left._Unchecked_begin(), _Left._Unchecked_end(), _Right._Unchecked_begin(), _Right._Unchecked_end(), _Synth_three_way{}); @@ -1744,12 +1744,12 @@ _NODISCARD bool operator>=(const deque<_Ty, _Alloc>& _Left, const deque<_Ty, _Al #endif // ^^^ !defined(__cpp_lib_concepts) ^^^ #if _HAS_CXX20 -template +_EXPORT_STD template typename deque<_Ty, _Alloc>::size_type erase(deque<_Ty, _Alloc>& _Cont, const _Uty& _Val) { return _Erase_remove(_Cont, _Val); } -template +_EXPORT_STD template typename deque<_Ty, _Alloc>::size_type erase_if(deque<_Ty, _Alloc>& _Cont, _Pr _Pred) { return _Erase_remove_if(_Cont, _Pass_fn(_Pred)); } @@ -1757,7 +1757,7 @@ typename deque<_Ty, _Alloc>::size_type erase_if(deque<_Ty, _Alloc>& _Cont, _Pr _ #if _HAS_CXX17 namespace pmr { - template + _EXPORT_STD template using deque = _STD deque<_Ty, polymorphic_allocator<_Ty>>; } // namespace pmr #endif // _HAS_CXX17 diff --git a/stl/inc/exception b/stl/inc/exception index 3d7088805c..1aec7bec2e 100644 --- a/stl/inc/exception +++ b/stl/inc/exception @@ -21,9 +21,10 @@ _STL_DISABLE_CLANG_WARNINGS _STD_BEGIN #if _HAS_DEPRECATED_UNCAUGHT_EXCEPTION -_CXX17_DEPRECATE_UNCAUGHT_EXCEPTION _CRTIMP2_PURE bool __CLRCALL_PURE_OR_CDECL uncaught_exception() noexcept; +_EXPORT_STD extern "C++" _CXX17_DEPRECATE_UNCAUGHT_EXCEPTION _CRTIMP2_PURE bool __CLRCALL_PURE_OR_CDECL + uncaught_exception() noexcept; #endif // _HAS_DEPRECATED_UNCAUGHT_EXCEPTION -_CRTIMP2_PURE int __CLRCALL_PURE_OR_CDECL uncaught_exceptions() noexcept; +_EXPORT_STD extern "C++" _CRTIMP2_PURE int __CLRCALL_PURE_OR_CDECL uncaught_exceptions() noexcept; _STD_END @@ -34,13 +35,16 @@ _STD_END _STD_BEGIN -using ::terminate; +_EXPORT_STD class exception; +_EXPORT_STD class bad_exception; + +_EXPORT_STD using ::terminate; #ifndef _M_CEE_PURE -using ::set_terminate; -using ::terminate_handler; +_EXPORT_STD using ::set_terminate; +_EXPORT_STD using ::terminate_handler; -_NODISCARD inline terminate_handler __CRTDECL get_terminate() noexcept { +_EXPORT_STD _NODISCARD inline terminate_handler __CRTDECL get_terminate() noexcept { // get current terminate handler return _get_terminate(); } @@ -70,7 +74,7 @@ _STDEXT_END _STD_BEGIN -using _STDEXT exception; +_EXPORT_STD using _STDEXT exception; using _Prhand = void(__cdecl*)(const exception&); @@ -158,19 +162,19 @@ public: _STDEXT_END _STD_BEGIN -using terminate_handler = void(__cdecl*)(); +_EXPORT_STD using terminate_handler = void(__cdecl*)(); -inline terminate_handler __CRTDECL set_terminate(terminate_handler) noexcept { +_EXPORT_STD inline terminate_handler __CRTDECL set_terminate(terminate_handler) noexcept { // register a terminate handler return nullptr; } -[[noreturn]] inline void __CRTDECL terminate() noexcept { +_EXPORT_STD [[noreturn]] inline void __CRTDECL terminate() noexcept { // handle exception termination _CSTD abort(); } -_NODISCARD inline terminate_handler __CRTDECL get_terminate() noexcept { +_EXPORT_STD _NODISCARD inline terminate_handler __CRTDECL get_terminate() noexcept { // get current terminate handler return nullptr; } @@ -191,29 +195,30 @@ _NODISCARD inline unexpected_handler __CRTDECL get_unexpected() noexcept { } #endif // _HAS_UNEXPECTED -using _STDEXT bad_alloc; -using _STDEXT bad_array_new_length; -using _STDEXT bad_exception; +_EXPORT_STD using _STDEXT bad_alloc; +_EXPORT_STD using _STDEXT bad_array_new_length; +_EXPORT_STD using _STDEXT bad_exception; _STD_END #endif // _HAS_EXCEPTIONS -_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL __ExceptionPtrCreate(_Out_ void*) noexcept; -_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL __ExceptionPtrDestroy(_Inout_ void*) noexcept; -_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL __ExceptionPtrCopy(_Out_ void*, _In_ const void*) noexcept; -_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL __ExceptionPtrAssign(_Inout_ void*, _In_ const void*) noexcept; -_CRTIMP2_PURE bool __CLRCALL_PURE_OR_CDECL __ExceptionPtrCompare(_In_ const void*, _In_ const void*) noexcept; -_CRTIMP2_PURE bool __CLRCALL_PURE_OR_CDECL __ExceptionPtrToBool(_In_ const void*) noexcept; -_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL __ExceptionPtrSwap(_Inout_ void*, _Inout_ void*) noexcept; -_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL __ExceptionPtrCurrentException(void*) noexcept; -[[noreturn]] _CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL __ExceptionPtrRethrow(_In_ const void*); -_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL __ExceptionPtrCopyException( +extern "C++" _CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL __ExceptionPtrCreate(_Out_ void*) noexcept; +extern "C++" _CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL __ExceptionPtrDestroy(_Inout_ void*) noexcept; +extern "C++" _CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL __ExceptionPtrCopy(_Out_ void*, _In_ const void*) noexcept; +extern "C++" _CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL __ExceptionPtrAssign(_Inout_ void*, _In_ const void*) noexcept; +extern "C++" _CRTIMP2_PURE bool __CLRCALL_PURE_OR_CDECL __ExceptionPtrCompare( + _In_ const void*, _In_ const void*) noexcept; +extern "C++" _CRTIMP2_PURE bool __CLRCALL_PURE_OR_CDECL __ExceptionPtrToBool(_In_ const void*) noexcept; +extern "C++" _CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL __ExceptionPtrSwap(_Inout_ void*, _Inout_ void*) noexcept; +extern "C++" _CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL __ExceptionPtrCurrentException(void*) noexcept; +extern "C++" [[noreturn]] _CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL __ExceptionPtrRethrow(_In_ const void*); +extern "C++" _CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL __ExceptionPtrCopyException( _Inout_ void*, _In_ const void*, _In_ const void*) noexcept; _STD_BEGIN -class exception_ptr { +_EXPORT_STD class exception_ptr { public: exception_ptr() noexcept { __ExceptionPtrCreate(this); @@ -304,18 +309,18 @@ private: #endif // __clang__ }; -_NODISCARD inline exception_ptr current_exception() noexcept { +_EXPORT_STD _NODISCARD inline exception_ptr current_exception() noexcept { return exception_ptr::_Current_exception(); } -[[noreturn]] inline void rethrow_exception(_In_ exception_ptr _Ptr) { +_EXPORT_STD [[noreturn]] inline void rethrow_exception(_In_ exception_ptr _Ptr) { __ExceptionPtrRethrow(&_Ptr); } template void* __GetExceptionInfo(_Ex); -template +_EXPORT_STD template _NODISCARD_SMART_PTR_ALLOC exception_ptr make_exception_ptr(_Ex _Except) noexcept { return exception_ptr::_Copy_exception(_STD addressof(_Except), __GetExceptionInfo(_Except)); } @@ -324,7 +329,7 @@ _NODISCARD_SMART_PTR_ALLOC exception_ptr make_exception_ptr(_Ex _Except) noexcep _THROW(bad_array_new_length{}); } -class nested_exception { // wrap an exception_ptr +_EXPORT_STD class nested_exception { // wrap an exception_ptr public: nested_exception() noexcept : _Exc(_STD current_exception()) {} @@ -354,7 +359,7 @@ struct _With_nested : _Uty, nested_exception { // glue user exception to nested_ : _Uty(_STD forward<_Ty>(_Arg)), nested_exception() {} // store user exception and current_exception() }; -template +_EXPORT_STD template [[noreturn]] void throw_with_nested(_Ty&& _Arg) { // throw user exception, glued to nested_exception if possible using _Uty = decay_t<_Ty>; @@ -370,7 +375,7 @@ template } #ifdef _CPPRTTI -template +_EXPORT_STD template void rethrow_if_nested(const _Ty& _Arg) { // detect nested_exception inheritance constexpr bool _Can_use_dynamic_cast = @@ -385,11 +390,11 @@ void rethrow_if_nested(const _Ty& _Arg) { } } #else // _CPPRTTI -template +_EXPORT_STD template void rethrow_if_nested(const _Ty&) = delete; // requires /GR option #endif // _CPPRTTI -class bad_variant_access +_EXPORT_STD class bad_variant_access : public exception { // exception for visit of a valueless variant or get on a variant with index() != I public: bad_variant_access() noexcept = default; diff --git a/stl/inc/execution b/stl/inc/execution index 0953ef28cc..e465e848f4 100644 --- a/stl/inc/execution +++ b/stl/inc/execution @@ -71,7 +71,7 @@ inline constexpr size_t _Oversubmission_multiplier = 4; inline constexpr size_t _Still_active = static_cast(-1); namespace execution { - class sequenced_policy { + _EXPORT_STD class sequenced_policy { // indicates support for only sequential execution, and requests termination on exceptions public: using _Standard_execution_policy = int; @@ -79,9 +79,9 @@ namespace execution { static constexpr bool _Ivdep = false; }; - inline constexpr sequenced_policy seq{/* unspecified */}; + _EXPORT_STD inline constexpr sequenced_policy seq{/* unspecified */}; - class parallel_policy { + _EXPORT_STD class parallel_policy { // indicates support by element access functions for parallel execution with parallel forward progress // guarantees, and requests termination on exceptions public: @@ -90,9 +90,9 @@ namespace execution { static constexpr bool _Ivdep = true; }; - inline constexpr parallel_policy par{/* unspecified */}; + _EXPORT_STD inline constexpr parallel_policy par{/* unspecified */}; - class parallel_unsequenced_policy { + _EXPORT_STD class parallel_unsequenced_policy { // indicates support by element access functions for parallel execution with weakly parallel forward progress // guarantees, and requests termination on exceptions // @@ -103,10 +103,10 @@ namespace execution { static constexpr bool _Ivdep = true; }; - inline constexpr parallel_unsequenced_policy par_unseq{/* unspecified */}; + _EXPORT_STD inline constexpr parallel_unsequenced_policy par_unseq{/* unspecified */}; #if _HAS_CXX20 - class unsequenced_policy { + _EXPORT_STD class unsequenced_policy { // indicates support by element access functions for weakly parallel forward progress guarantees, and for // executing interleaved on the same thread, and requests termination on exceptions // @@ -117,7 +117,7 @@ namespace execution { static constexpr bool _Ivdep = true; }; - inline constexpr unsequenced_policy unseq{/* unspecified */}; + _EXPORT_STD inline constexpr unsequenced_policy unseq{/* unspecified */}; #endif // _HAS_CXX20 } // namespace execution @@ -472,7 +472,7 @@ struct _Parallel_choose_max_chunk { } }; -template +_EXPORT_STD /* TRANSITION, VSO-1592329 */ template struct alignas(_Ty) alignas(size_t) alignas(_Atomic_counter_t) _Circular_buffer { // work stealing deque extent type static_assert(is_trivial_v<_Ty>, "Work stealing deques work only with trivial operations"); @@ -1109,7 +1109,7 @@ bool _All_of_family_parallel(_FwdIt _First, const _FwdIt _Last, _Pr _Pred) { return true; } -template /* = 0 */> +_EXPORT_STD template /* = 0 */> _NODISCARD bool all_of(_ExPo&&, _FwdIt _First, _FwdIt _Last, _Pr _Pred) noexcept /* terminates */ { // test if all elements in [_First, _Last) satisfy _Pred with the indicated execution policy _REQUIRE_PARALLEL_ITERATOR(_FwdIt); @@ -1123,7 +1123,7 @@ _NODISCARD bool all_of(_ExPo&&, _FwdIt _First, _FwdIt _Last, _Pr _Pred) noexcept } } -template /* = 0 */> +_EXPORT_STD template /* = 0 */> _NODISCARD bool any_of(_ExPo&&, const _FwdIt _First, const _FwdIt _Last, _Pr _Pred) noexcept /* terminates */ { // test if any element in [_First, _Last) satisfies _Pred with the indicated execution policy _REQUIRE_PARALLEL_ITERATOR(_FwdIt); @@ -1137,7 +1137,7 @@ _NODISCARD bool any_of(_ExPo&&, const _FwdIt _First, const _FwdIt _Last, _Pr _Pr } } -template /* = 0 */> +_EXPORT_STD template /* = 0 */> _NODISCARD bool none_of(_ExPo&&, const _FwdIt _First, const _FwdIt _Last, _Pr _Pred) noexcept /* terminates */ { // test if no element in [_First, _Last) satisfies _Pred with the indicated execution policy _REQUIRE_PARALLEL_ITERATOR(_FwdIt); @@ -1186,7 +1186,7 @@ struct _Static_partitioned_for_each2 { // for_each task scheduled on the system } }; -template /* = 0 */> +_EXPORT_STD template /* = 0 */> void for_each(_ExPo&&, _FwdIt _First, _FwdIt _Last, _Fn _Func) noexcept /* terminates */ { // perform function for each element [_First, _Last) with the indicated execution policy _REQUIRE_PARALLEL_ITERATOR(_FwdIt); @@ -1232,7 +1232,7 @@ _FwdIt _For_each_n_ivdep(_FwdIt _First, _Diff _Count, _Fn _Func) { return _First; } -template /* = 0 */> +_EXPORT_STD template /* = 0 */> _FwdIt for_each_n(_ExPo&&, _FwdIt _First, const _Diff _Count_raw, _Fn _Func) noexcept /* terminates */ { // perform function for each element [_First, _First + _Count) _REQUIRE_PARALLEL_ITERATOR(_FwdIt); @@ -1334,7 +1334,7 @@ _FwdIt _Find_parallel_unchecked(_ExPo&&, const _FwdIt _First, const _FwdIt _Last return _Fx(_First, _Last); } -template /* = 0 */> +_EXPORT_STD template /* = 0 */> _NODISCARD _FwdIt find(_ExPo&& _Exec, _FwdIt _First, const _FwdIt _Last, const _Ty& _Val) noexcept /* terminates */ { // find first matching _Val _REQUIRE_PARALLEL_ITERATOR(_FwdIt); @@ -1346,7 +1346,7 @@ _NODISCARD _FwdIt find(_ExPo&& _Exec, _FwdIt _First, const _FwdIt _Last, const _ return _First; } -template /* = 0 */> +_EXPORT_STD template /* = 0 */> _NODISCARD _FwdIt find_if(_ExPo&& _Exec, _FwdIt _First, const _FwdIt _Last, _Pr _Pred) noexcept /* terminates */ { // find first satisfying _Pred _REQUIRE_PARALLEL_ITERATOR(_FwdIt); @@ -1359,7 +1359,7 @@ _NODISCARD _FwdIt find_if(_ExPo&& _Exec, _FwdIt _First, const _FwdIt _Last, _Pr return _First; } -template /* = 0 */> +_EXPORT_STD template /* = 0 */> _NODISCARD _FwdIt find_if_not(_ExPo&& _Exec, _FwdIt _First, const _FwdIt _Last, _Pr _Pred) noexcept /* terminates */ { // find first satisfying !_Pred _REQUIRE_PARALLEL_ITERATOR(_FwdIt); @@ -1516,7 +1516,8 @@ struct _Static_partitioned_find_end_backward3 { } }; -template /* = 0 */> +_EXPORT_STD template /* = 0 */> _NODISCARD _FwdIt1 find_end(_ExPo&&, _FwdIt1 _First1, const _FwdIt1 _Last1, const _FwdIt2 _First2, const _FwdIt2 _Last2, _Pr _Pred) noexcept /* terminates */ { // find last [_First2, _Last2) satisfying _Pred @@ -1574,7 +1575,8 @@ _NODISCARD _FwdIt1 find_end(_ExPo&&, _FwdIt1 _First1, const _FwdIt1 _Last1, cons return _First1; } -template /* = 0 */> +_EXPORT_STD template /* = 0 */> _NODISCARD _FwdIt1 find_first_of(_ExPo&& _Exec, const _FwdIt1 _First1, _FwdIt1 _Last1, const _FwdIt2 _First2, const _FwdIt2 _Last2, _Pr _Pred) noexcept /* terminates */ { // look for one of [_First2, _Last2) that matches element @@ -1641,7 +1643,7 @@ struct _Static_partitioned_adjacent_find3 { } }; -template /* = 0 */> +_EXPORT_STD template /* = 0 */> _NODISCARD _FwdIt adjacent_find(_ExPo&&, _FwdIt _First, _FwdIt _Last, _Pr _Pred) noexcept /* terminates */ { // find first satisfying _Pred with successor _Adl_verify_range(_First, _Last); @@ -1699,7 +1701,7 @@ struct _Static_partitioned_count_if2 { } }; -template /* = 0 */> +_EXPORT_STD template /* = 0 */> _NODISCARD _Iter_diff_t<_FwdIt> count_if(_ExPo&&, const _FwdIt _First, const _FwdIt _Last, _Pr _Pred) noexcept /* terminates */ { // count elements satisfying _Pred @@ -1734,7 +1736,7 @@ _NODISCARD _Iter_diff_t<_FwdIt> count_if(_ExPo&&, const _FwdIt _First, const _Fw return _STD count_if(_UFirst, _ULast, _Pass_fn(_Pred)); } -template /* = 0 */> +_EXPORT_STD template /* = 0 */> _NODISCARD _Iter_diff_t<_FwdIt> count(_ExPo&& _Exec, const _FwdIt _First, const _FwdIt _Last, const _Ty& _Val) noexcept /* terminates */ { // count elements that match _Val @@ -1861,7 +1863,8 @@ struct _Static_partitioned_mismatch3 { #pragma warning(push) #pragma warning(disable : 4868) // compiler may not enforce left-to-right evaluation order // in braced initializer list (/Wall) -template /* = 0 */> +_EXPORT_STD template /* = 0 */> _NODISCARD pair<_FwdIt1, _FwdIt2> mismatch( _ExPo&&, _FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _First2, _Pr _Pred) noexcept /* terminates */ { // return [_First1, _Last1)/[_First2, ...) mismatch @@ -1903,7 +1906,8 @@ _NODISCARD pair<_FwdIt1, _FwdIt2> mismatch( } #pragma warning(pop) -template /* = 0 */> +_EXPORT_STD template /* = 0 */> _NODISCARD pair<_FwdIt1, _FwdIt2> mismatch( _ExPo&&, _FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _First2, _FwdIt2 _Last2, _Pr _Pred) noexcept /* terminates */ { // return [_First1, _Last1)/[_First2, _Last2) mismatch @@ -1980,7 +1984,8 @@ struct _Static_partitioned_equal2 { } }; -template /* = 0 */> +_EXPORT_STD template /* = 0 */> _NODISCARD bool equal(_ExPo&&, const _FwdIt1 _First1, const _FwdIt1 _Last1, const _FwdIt2 _First2, _Pr _Pred) noexcept /* terminates */ { // compare [_First1, _Last1) to [_First2, ...) @@ -2013,7 +2018,8 @@ _NODISCARD bool equal(_ExPo&&, const _FwdIt1 _First1, const _FwdIt1 _Last1, cons return _STD equal(_UFirst1, _ULast1, _First2, _Pass_fn(_Pred)); } -template /* = 0 */> +_EXPORT_STD template /* = 0 */> _NODISCARD bool equal(_ExPo&&, const _FwdIt1 _First1, const _FwdIt1 _Last1, const _FwdIt2 _First2, const _FwdIt2 _Last2, _Pr _Pred) noexcept /* terminates */ { // compare [_First1, _Last1) to [_First2, _Last2) @@ -2099,7 +2105,8 @@ struct _Static_partitioned_search3 { } }; -template /* = 0 */> +_EXPORT_STD template /* = 0 */> _NODISCARD _FwdItHaystack search(_ExPo&&, const _FwdItHaystack _First1, _FwdItHaystack _Last1, const _FwdItPat _First2, const _FwdItPat _Last2, _Pr _Pred) noexcept /* terminates */ { // find first [_First2, _Last2) match @@ -2228,7 +2235,8 @@ struct _Static_partitioned_search_n3 { } }; -template /* = 0 */> +_EXPORT_STD template /* = 0 */> _NODISCARD _FwdIt search_n(_ExPo&&, const _FwdIt _First, _FwdIt _Last, const _Diff _Count_raw, const _Ty& _Val, _Pr _Pred) noexcept /* terminates */ { // find first _Count * _Val satisfying _Pred @@ -2304,7 +2312,8 @@ struct _Static_partitioned_unary_transform2 { } }; -template /* = 0 */> +_EXPORT_STD template /* = 0 */> _FwdIt2 transform(_ExPo&&, const _FwdIt1 _First, const _FwdIt1 _Last, _FwdIt2 _Dest, _Fn _Func) noexcept /* terminates */ { // transform [_First, _Last) with _Func @@ -2382,7 +2391,7 @@ struct _Static_partitioned_binary_transform2 { #pragma warning(push) #pragma warning(disable : 4868) // compiler may not enforce left-to-right evaluation order // in braced initializer list (/Wall) -template /* = 0 */> _FwdIt3 transform(_ExPo&&, const _FwdIt1 _First1, const _FwdIt1 _Last1, const _FwdIt2 _First2, _FwdIt3 _Dest, _Fn _Func) noexcept /* terminates */ { @@ -2428,7 +2437,7 @@ _FwdIt3 transform(_ExPo&&, const _FwdIt1 _First1, const _FwdIt1 _Last1, const _F } #pragma warning(pop) -template /* = 0 */> +_EXPORT_STD template /* = 0 */> void replace(_ExPo&& _Exec, const _FwdIt _First, const _FwdIt _Last, const _Ty& _Oldval, const _Ty& _Newval) noexcept /* terminates */ { // replace each matching _Oldval with _Newval @@ -2440,7 +2449,7 @@ void replace(_ExPo&& _Exec, const _FwdIt _First, const _FwdIt _Last, const _Ty& }); } -template /* = 0 */> +_EXPORT_STD template /* = 0 */> void replace_if(_ExPo&& _Exec, const _FwdIt _First, const _FwdIt _Last, _Pr _Pred, const _Ty& _Val) noexcept /* terminates */ { // replace each satisfying _Pred with _Val @@ -2564,7 +2573,7 @@ struct _Static_partitioned_remove_if2 { } }; -template /* = 0 */> +_EXPORT_STD template /* = 0 */> _NODISCARD_REMOVE_ALG _FwdIt remove_if(_ExPo&&, _FwdIt _First, const _FwdIt _Last, _Pr _Pred) noexcept /* terminates */ { // remove each satisfying _Pred @@ -2592,7 +2601,7 @@ _NODISCARD_REMOVE_ALG _FwdIt remove_if(_ExPo&&, _FwdIt _First, const _FwdIt _Las return _First; } -template /* = 0 */> +_EXPORT_STD template /* = 0 */> _NODISCARD_REMOVE_ALG _FwdIt remove(_ExPo&& _Exec, const _FwdIt _First, const _FwdIt _Last, const _Ty& _Val) noexcept /* terminates */ { // remove each matching _Val @@ -2703,7 +2712,7 @@ struct _Sort_operation { // context for background threads } }; -template /* = 0 */> +_EXPORT_STD template /* = 0 */> void sort(_ExPo&&, const _RanIt _First, const _RanIt _Last, _Pr _Pred) noexcept /* terminates */ { // order [_First, _Last) _Adl_verify_range(_First, _Last); @@ -2960,7 +2969,7 @@ struct _Static_partitioned_stable_sort3 { } }; -template /* = 0 */> +_EXPORT_STD template /* = 0 */> void stable_sort(_ExPo&&, const _BidIt _First, const _BidIt _Last, _Pr _Pred) noexcept /* terminates */ { // sort preserving order of equivalents _Adl_verify_range(_First, _Last); @@ -3047,7 +3056,7 @@ struct _Static_partitioned_is_sorted_until2 { } }; -template /* = 0 */> +_EXPORT_STD template /* = 0 */> _NODISCARD _FwdIt is_sorted_until(_ExPo&&, _FwdIt _First, _FwdIt _Last, _Pr _Pred) noexcept /* terminates */ { // find extent of range that is ordered by predicate _REQUIRE_PARALLEL_ITERATOR(_FwdIt); @@ -3201,7 +3210,7 @@ struct _Static_partitioned_is_partitioned { } }; -template /* = 0 */> +_EXPORT_STD template /* = 0 */> _NODISCARD bool is_partitioned(_ExPo&&, const _FwdIt _First, const _FwdIt _Last, _Pr _Pred) noexcept /* terminates */ { // test if [_First, _Last) is partitioned by _Pred _REQUIRE_PARALLEL_ITERATOR(_FwdIt); @@ -3273,7 +3282,7 @@ struct _Static_partitioned_is_heap_until2 { } }; -template /* = 0 */> +_EXPORT_STD template /* = 0 */> _NODISCARD _RanIt is_heap_until(_ExPo&&, _RanIt _First, _RanIt _Last, _Pr _Pred) noexcept /* terminates */ { // find extent of range that is a heap _REQUIRE_PARALLEL_ITERATOR(_RanIt); @@ -3522,7 +3531,7 @@ struct _Static_partitioned_partition2 { } }; -template /* = 0 */> +_EXPORT_STD template /* = 0 */> _FwdIt partition(_ExPo&&, _FwdIt _First, const _FwdIt _Last, _Pr _Pred) noexcept /* terminates */ { // move elements satisfying _Pred to beginning of sequence _Adl_verify_range(_First, _Last); @@ -3851,7 +3860,7 @@ struct _Set_intersection_per_chunk { } }; -template /* = 0 */> _FwdIt3 set_intersection(_ExPo&&, _FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _First2, _FwdIt2 _Last2, _FwdIt3 _Dest, _Pr _Pred) noexcept /* terminates */ { @@ -3943,7 +3952,7 @@ struct _Set_difference_per_chunk { } }; -template /* = 0 */> _FwdIt3 set_difference(_ExPo&&, _FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _First2, _FwdIt2 _Last2, _FwdIt3 _Dest, _Pr _Pred) noexcept /* terminates */ { @@ -4048,7 +4057,8 @@ struct _Static_partitioned_reduce2 { } }; -template /* = 0 */> +_EXPORT_STD template /* = 0 */> _NODISCARD _Ty reduce(_ExPo&&, const _FwdIt _First, const _FwdIt _Last, _Ty _Val, _BinOp _Reduce_op) noexcept /* terminates */ { // return commutative and associative reduction of _Val and [_First, _Last), using _Reduce_op @@ -4147,7 +4157,7 @@ struct _Static_partitioned_transform_reduce_binary2 { // transform-reduction tas #pragma warning(push) #pragma warning(disable : 4868) // compiler may not enforce left-to-right evaluation order // in braced initializer list (/Wall) -template /* = 0 */> _NODISCARD _Ty transform_reduce(_ExPo&&, _FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _First2, _Ty _Val, _BinOp1 _Reduce_op, _BinOp2 _Transform_op) noexcept /* terminates */ { @@ -4243,7 +4253,7 @@ struct _Static_partitioned_transform_reduce2 { // transformed reduction task sch } }; -template /* = 0 */> _NODISCARD _Ty transform_reduce(_ExPo&&, const _FwdIt _First, const _FwdIt _Last, _Ty _Val, _BinOp _Reduce_op, _UnaryOp _Transform_op) noexcept /* terminates */ { @@ -4393,7 +4403,7 @@ struct _Static_partitioned_exclusive_scan2 { } }; -template /* = 0 */> _FwdIt2 exclusive_scan(_ExPo&&, const _FwdIt1 _First, const _FwdIt1 _Last, _FwdIt2 _Dest, _Ty _Val, _BinOp _Reduce_op) noexcept /* terminates */ { @@ -4522,7 +4532,7 @@ struct _Static_partitioned_inclusive_scan2 { } }; -template /* = 0 */> _FwdIt2 inclusive_scan(_ExPo&&, _FwdIt1 _First, _FwdIt1 _Last, _FwdIt2 _Dest, _BinOp _Reduce_op, _Ty _Val) noexcept /* terminates */ { @@ -4566,7 +4576,8 @@ _FwdIt2 inclusive_scan(_ExPo&&, _FwdIt1 _First, _FwdIt1 _Last, _FwdIt2 _Dest, _B return _Dest; } -template /* = 0 */> +_EXPORT_STD template /* = 0 */> _FwdIt2 inclusive_scan(_ExPo&&, _FwdIt1 _First, _FwdIt1 _Last, _FwdIt2 _Dest, _BinOp _Reduce_op) noexcept /* terminates */ { // compute partial noncommutative and associative reductions into _Dest, using _Reduce_op @@ -4709,7 +4720,7 @@ struct _Static_partitioned_transform_exclusive_scan2 { } }; -template /* = 0 */> _FwdIt2 transform_exclusive_scan(_ExPo&&, const _FwdIt1 _First, const _FwdIt1 _Last, _FwdIt2 _Dest, _Ty _Val, _BinOp _Reduce_op, _UnaryOp _Transform_op) noexcept /* terminates */ { @@ -4840,7 +4851,7 @@ struct _Static_partitioned_transform_inclusive_scan2 { } }; -template /* = 0 */> _FwdIt2 transform_inclusive_scan(_ExPo&&, const _FwdIt1 _First, const _FwdIt1 _Last, _FwdIt2 _Dest, _BinOp _Reduce_op, _UnaryOp _Transform_op, _Ty _Val) noexcept /* terminates */ { @@ -4886,7 +4897,7 @@ _FwdIt2 transform_inclusive_scan(_ExPo&&, const _FwdIt1 _First, const _FwdIt1 _L return _Dest; } -template /* = 0 */> _FwdIt2 transform_inclusive_scan(_ExPo&&, const _FwdIt1 _First, const _FwdIt1 _Last, _FwdIt2 _Dest, _BinOp _Reduce_op, _UnaryOp _Transform_op) noexcept /* terminates */ { @@ -4988,7 +4999,8 @@ _FwdIt2 _Adjacent_difference_seq(_FwdIt1 _First, const _FwdIt1 _Last, _FwdIt2 _D return _Dest; } -template /* = 0 */> +_EXPORT_STD template /* = 0 */> _FwdIt2 adjacent_difference(_ExPo&&, const _FwdIt1 _First, const _FwdIt1 _Last, _FwdIt2 _Dest, _BinOp _Diff_op) noexcept /* terminates */ { // compute adjacent differences into _Dest diff --git a/stl/inc/expected b/stl/inc/expected index 20894ab5a3..3f25d69314 100644 --- a/stl/inc/expected +++ b/stl/inc/expected @@ -25,7 +25,7 @@ _STL_DISABLE_CLANG_WARNINGS _STD_BEGIN -template +_EXPORT_STD template class unexpected; template @@ -39,7 +39,7 @@ struct _Check_unexpected_argument : true_type { }; // [expected.un.general] -template +_EXPORT_STD template class unexpected { static_assert(_Check_unexpected_argument<_Err>::value); @@ -110,7 +110,7 @@ private: template unexpected(_Err) -> unexpected<_Err>; -template +_EXPORT_STD template class bad_expected_access; template <> @@ -134,7 +134,7 @@ protected: #endif // !_HAS_EXCEPTIONS }; -template +_EXPORT_STD template class bad_expected_access : public bad_expected_access { public: explicit bad_expected_access(_Err _Unex) noexcept(is_nothrow_move_constructible_v<_Err>) // strengthened @@ -157,13 +157,11 @@ private: _Err _Unexpected; }; -struct unexpect_t { - explicit unexpect_t() = default; -}; +_EXPORT_STD struct unexpect_t { explicit unexpect_t() = default; }; -inline constexpr unexpect_t unexpect{}; +_EXPORT_STD inline constexpr unexpect_t unexpect{}; -template +_EXPORT_STD template class expected { static_assert(!is_reference_v<_Ty>, "T must not be a reference type. (N4910 [expected.object.general]/2)"); static_assert(!is_function_v<_Ty>, "T must not be a function type. (N4910 [expected.object.general]/2)"); diff --git a/stl/inc/experimental/filesystem b/stl/inc/experimental/filesystem index ea4eb2cd5c..d4d5bab72f 100644 --- a/stl/inc/experimental/filesystem +++ b/stl/inc/experimental/filesystem @@ -89,7 +89,7 @@ enum class copy_options { // names for copy options _Unspecified_recursion_prevention_tag = 512 }; -_BITMASK_OPS(copy_options) +_BITMASK_OPS(_EMPTY_ARGUMENT, copy_options) enum class directory_options { // names for directory options none = 0, @@ -121,7 +121,7 @@ enum class perms { // names for permissions resolve_symlinks = 0x40000 }; -_BITMASK_OPS(perms) +_BITMASK_OPS(_EMPTY_ARGUMENT, perms) class file_status { // stores file status public: diff --git a/stl/inc/filesystem b/stl/inc/filesystem index df4e0f811b..e71ac1512a 100644 --- a/stl/inc/filesystem +++ b/stl/inc/filesystem @@ -173,7 +173,7 @@ namespace filesystem { template inline constexpr bool _Is_Source = _Is_Source_impl>; - class path; + _EXPORT_STD class path; template <> inline constexpr bool _Is_Source = false; // to avoid constraint recursion via the converting constructor and @@ -613,7 +613,7 @@ namespace filesystem { template class _Path_iterator; - class path { + _EXPORT_STD class path { template friend class _Path_iterator; friend inline __std_win_error _Absolute(path& _Result, const wstring& _Text); @@ -1372,12 +1372,12 @@ namespace filesystem { string_type _Text; }; - template , int> = 0> + _EXPORT_STD template , int> = 0> _CXX20_DEPRECATE_U8PATH _NODISCARD path u8path(const _Src& _Source) { // construct a path from UTF-8 _Source return path(_Convert_Source_to_wide(_Source, _Utf8_conversion{})); } - template + _EXPORT_STD template _CXX20_DEPRECATE_U8PATH _NODISCARD path u8path(_InIt _First, _InIt _Last) { // construct a path from UTF-8 [_First, _Last) static_assert(_Is_EcharT<_Iter_value_t<_InIt>>, "invalid value_type, see N4810 29.11.4 [fs.req]/3"); @@ -1584,11 +1584,11 @@ namespace filesystem { const path* _Mypath{}; }; - inline void swap(path& _Left, path& _Right) noexcept { + _EXPORT_STD inline void swap(path& _Left, path& _Right) noexcept { _Left.swap(_Right); } - _NODISCARD inline size_t hash_value(const path& _Path) noexcept { + _EXPORT_STD _NODISCARD inline size_t hash_value(const path& _Path) noexcept { // calculate a hash value for _Path // See path::compare; we effectively decompose the path with special handling for root_name, root_directory. // Examples: @@ -1748,7 +1748,7 @@ namespace filesystem { return iterator(_Text.cend(), this); } - class filesystem_error : public system_error { // base of all filesystem-error exceptions + _EXPORT_STD class filesystem_error : public system_error { // base of all filesystem-error exceptions public: filesystem_error(const string& _Message, const error_code _Errcode) : system_error(_Errcode, _Message), _What(runtime_error::what()) {} @@ -1829,7 +1829,7 @@ namespace filesystem { _THROW(filesystem_error(_Op, _Path1, _Path2, _Error)); } - enum class file_type { + _EXPORT_STD enum class file_type { none, not_found, regular, @@ -1848,7 +1848,7 @@ namespace filesystem { junction // implementation-defined value indicating an NT junction }; - enum class perms { + _EXPORT_STD enum class perms { none = 0, owner_read = 0400, @@ -1877,9 +1877,9 @@ namespace filesystem { _File_attribute_readonly = all & ~_All_write // returned for files with FILE_ATTRIBUTE_READONLY }; - _BITMASK_OPS(perms) + _BITMASK_OPS(_EXPORT_STD, perms) - enum class copy_options { + _EXPORT_STD enum class copy_options { none = static_cast(__std_fs_copy_options::_None), _Existing_mask = static_cast(__std_fs_copy_options::_Existing_mask), @@ -1901,9 +1901,9 @@ namespace filesystem { _Unspecified_copy_prevention_tag = 0x10000 // to be removed by LWG-3057 }; - _BITMASK_OPS(copy_options) + _BITMASK_OPS(_EXPORT_STD, copy_options) - class file_status { + _EXPORT_STD class file_status { public: // [fs.file_status.cons], constructors and destructor file_status() noexcept = default; @@ -1982,7 +1982,7 @@ namespace filesystem { perms _Myperms = perms::unknown; }; - _NODISCARD inline bool exists(const file_status _Status) noexcept { + _EXPORT_STD _NODISCARD inline bool exists(const file_status _Status) noexcept { // tests whether _Status indicates an existing file switch (_Status.type()) { case file_type::none: @@ -2002,27 +2002,27 @@ namespace filesystem { } } - _NODISCARD inline bool is_block_file(const file_status _Status) noexcept { + _EXPORT_STD _NODISCARD inline bool is_block_file(const file_status _Status) noexcept { // tests whether _Status indicates a block file return _Status.type() == file_type::block; } - _NODISCARD inline bool is_character_file(const file_status _Status) noexcept { + _EXPORT_STD _NODISCARD inline bool is_character_file(const file_status _Status) noexcept { // tests whether _Status indicates a character file return _Status.type() == file_type::character; } - _NODISCARD inline bool is_directory(const file_status _Status) noexcept { + _EXPORT_STD _NODISCARD inline bool is_directory(const file_status _Status) noexcept { // tests whether _Status indicates a directory return _Status.type() == file_type::directory; } - _NODISCARD inline bool is_fifo(const file_status _Status) noexcept { + _EXPORT_STD _NODISCARD inline bool is_fifo(const file_status _Status) noexcept { // tests whether _Status indicates a fifo return _Status.type() == file_type::fifo; } - _NODISCARD inline bool is_other(const file_status _Status) noexcept { + _EXPORT_STD _NODISCARD inline bool is_other(const file_status _Status) noexcept { // tests whether _Status indicates other file types switch (_Status.type()) { case file_type::none: @@ -2042,17 +2042,17 @@ namespace filesystem { } } - _NODISCARD inline bool is_regular_file(const file_status _Status) noexcept { + _EXPORT_STD _NODISCARD inline bool is_regular_file(const file_status _Status) noexcept { // tests whether _Status indicates a regular file return _Status.type() == file_type::regular; } - _NODISCARD inline bool is_socket(const file_status _Status) noexcept { + _EXPORT_STD _NODISCARD inline bool is_socket(const file_status _Status) noexcept { // tests whether _Status indicates a socket return _Status.type() == file_type::socket; } - _NODISCARD inline bool is_symlink(const file_status _Status) noexcept { + _EXPORT_STD _NODISCARD inline bool is_symlink(const file_status _Status) noexcept { // tests whether _Status indicates a symlink return _Status.type() == file_type::symlink; } @@ -2076,12 +2076,12 @@ namespace filesystem { __std_fs_stats_flags::_Attributes | __std_fs_stats_flags::_Reparse_tag; #if _HAS_CXX20 - using file_time_type = _CHRONO time_point<_CHRONO file_clock>; + _EXPORT_STD using file_time_type = _CHRONO time_point<_CHRONO file_clock>; #else // ^^^ _HAS_CXX20 / !_HAS_CXX20 vvv using file_time_type = _CHRONO time_point; #endif // ^^^ !_HAS_CXX20 - class directory_entry { + _EXPORT_STD class directory_entry { public: // [fs.dir.entry.cons], constructors and destructor directory_entry() noexcept : _Cached_data{}, _Path() {} @@ -2482,8 +2482,8 @@ namespace filesystem { filesystem::path _Path; }; - enum class directory_options { none = 0, follow_directory_symlink = 1, skip_permission_denied = 2 }; - _BITMASK_OPS(directory_options) + _EXPORT_STD enum class directory_options { none = 0, follow_directory_symlink = 1, skip_permission_denied = 2 }; + _BITMASK_OPS(_EXPORT_STD, directory_options) struct _Dir_enum_impl { _NODISCARD static __std_win_error _Advance_and_reset_if_no_more_files(shared_ptr<_Dir_enum_impl>& _Ptr) { @@ -2587,8 +2587,8 @@ namespace filesystem { _Find_file_handle _Dir; }; - class directory_iterator; - class recursive_directory_iterator; + _EXPORT_STD class directory_iterator; + _EXPORT_STD class recursive_directory_iterator; struct _Directory_entry_proxy { _NODISCARD directory_entry operator*() && noexcept { @@ -2604,7 +2604,7 @@ namespace filesystem { directory_entry _Entry; }; - class directory_iterator { + _EXPORT_STD class directory_iterator { public: using iterator_category = input_iterator_tag; using value_type = directory_entry; @@ -2696,11 +2696,11 @@ namespace filesystem { shared_ptr<_Dir_enum_impl> _Impl; }; - _NODISCARD inline directory_iterator begin(directory_iterator _Iter) noexcept { + _EXPORT_STD _NODISCARD inline directory_iterator begin(directory_iterator _Iter) noexcept { return _Iter; } - _NODISCARD inline directory_iterator end(directory_iterator) noexcept { + _EXPORT_STD _NODISCARD inline directory_iterator end(directory_iterator) noexcept { return {}; } @@ -2828,7 +2828,7 @@ namespace filesystem { : _Dir_enum_impl(_STD move(_Create_data)), _Options(_Options_arg) {} }; - class recursive_directory_iterator { + _EXPORT_STD class recursive_directory_iterator { public: using iterator_category = input_iterator_tag; using value_type = directory_entry; @@ -2948,11 +2948,11 @@ namespace filesystem { shared_ptr<_Recursive_dir_enum_impl> _Impl; }; - _NODISCARD inline recursive_directory_iterator begin(recursive_directory_iterator _Iter) noexcept { + _EXPORT_STD _NODISCARD inline recursive_directory_iterator begin(recursive_directory_iterator _Iter) noexcept { return _Iter; } - _NODISCARD inline recursive_directory_iterator end(recursive_directory_iterator) noexcept { + _EXPORT_STD _NODISCARD inline recursive_directory_iterator end(recursive_directory_iterator) noexcept { return {}; } @@ -2977,7 +2977,7 @@ namespace filesystem { return _Err; } - _NODISCARD inline path absolute(const path& _Input) { + _EXPORT_STD _NODISCARD inline path absolute(const path& _Input) { // normalize path according to system semantics, without touching the disk // calls GetFullPathNameW path _Result; @@ -2989,7 +2989,7 @@ namespace filesystem { return _Result; } - _NODISCARD inline path absolute(const path& _Input, error_code& _Ec) { + _EXPORT_STD _NODISCARD inline path absolute(const path& _Input, error_code& _Ec) { // normalize path according to system semantics, without touching the disk // calls GetFullPathNameW _Ec.clear(); // for exception safety @@ -3051,7 +3051,7 @@ namespace filesystem { return __std_win_error::_Success; } - _NODISCARD inline path canonical(const path& _Input) { + _EXPORT_STD _NODISCARD inline path canonical(const path& _Input) { // resolve the final path according to system semantics, by opening the file // calls GetFinalPathNameByHandleW path _Result; @@ -3063,7 +3063,7 @@ namespace filesystem { return _Result; } - _NODISCARD inline path canonical(const path& _Input, error_code& _Ec) { + _EXPORT_STD _NODISCARD inline path canonical(const path& _Input, error_code& _Ec) { // resolve the final path according to system semantics, by opening the file // calls GetFinalPathNameByHandleW _Ec.clear(); // for exception safety @@ -3109,7 +3109,7 @@ namespace filesystem { return _Cleaned_link; } - inline void create_directory_symlink(const path& _To, const path& _New_symlink) { + _EXPORT_STD inline void create_directory_symlink(const path& _To, const path& _New_symlink) { // create a symlink for a directory, _New_symlink -> _To const auto _Cleaned = _Get_cleaned_symlink_target(_To); if (!_Cleaned) { @@ -3123,7 +3123,8 @@ namespace filesystem { } } - inline void create_directory_symlink(const path& _To, const path& _New_symlink, error_code& _Ec) noexcept { + _EXPORT_STD inline void create_directory_symlink( + const path& _To, const path& _New_symlink, error_code& _Ec) noexcept { // create a symlink for a directory, _New_symlink -> _To const auto _Cleaned = _Get_cleaned_symlink_target(_To); if (_Cleaned) { @@ -3134,7 +3135,7 @@ namespace filesystem { } } - inline void create_hard_link(const path& _To, const path& _New_hard_link) { + _EXPORT_STD inline void create_hard_link(const path& _To, const path& _New_hard_link) { // create a hard link for a file, _New_hard_link -> _To // note reversed parameter order: const auto _Err = __std_fs_create_hard_link(_New_hard_link.c_str(), _To.c_str()); @@ -3143,13 +3144,13 @@ namespace filesystem { } } - inline void create_hard_link(const path& _To, const path& _New_hard_link, error_code& _Ec) noexcept { + _EXPORT_STD inline void create_hard_link(const path& _To, const path& _New_hard_link, error_code& _Ec) noexcept { // create a hard link for a file, _New_hard_link -> _To // note reversed parameter order: _Ec = _Make_ec(__std_fs_create_hard_link(_New_hard_link.c_str(), _To.c_str())); } - inline void create_symlink(const path& _To, const path& _New_symlink) { + _EXPORT_STD inline void create_symlink(const path& _To, const path& _New_symlink) { // create a symlink for a file, _New_symlink -> _To const auto _Cleaned = _Get_cleaned_symlink_target(_To); if (!_Cleaned) { @@ -3163,7 +3164,7 @@ namespace filesystem { } } - inline void create_symlink(const path& _To, const path& _New_symlink, error_code& _Ec) noexcept { + _EXPORT_STD inline void create_symlink(const path& _To, const path& _New_symlink, error_code& _Ec) noexcept { // create a symlink for a file, _New_symlink -> _To const auto _Cleaned = _Get_cleaned_symlink_target(_To); if (_Cleaned) { @@ -3222,14 +3223,14 @@ namespace filesystem { return __std_win_error::_Success; } - _NODISCARD inline path read_symlink(const path& _Symlink_path, error_code& _Ec) { + _EXPORT_STD _NODISCARD inline path read_symlink(const path& _Symlink_path, error_code& _Ec) { _Ec.clear(); path _Result; _Ec = _Make_ec(_Read_symlink(_Symlink_path, _Result)); return _Result; } - _NODISCARD inline path read_symlink(const path& _Symlink_path) { + _EXPORT_STD _NODISCARD inline path read_symlink(const path& _Symlink_path) { path _Result; const auto _Err = _Read_symlink(_Symlink_path, _Result); if (_Err != __std_win_error::_Success) { @@ -3340,18 +3341,19 @@ namespace filesystem { return _Err; } - inline void copy_symlink(const path& _Symlink, const path& _New_symlink, error_code& _Ec) { + _EXPORT_STD inline void copy_symlink(const path& _Symlink, const path& _New_symlink, error_code& _Ec) { _Ec = _Make_ec(_Copy_symlink(_Symlink, _New_symlink)); } - inline void copy_symlink(const path& _Symlink, const path& _New_symlink) { + _EXPORT_STD inline void copy_symlink(const path& _Symlink, const path& _New_symlink) { const auto _Err = _Copy_symlink(_Symlink, _New_symlink); if (_Err != __std_win_error::_Success) { _Throw_fs_error("copy_symlink", _Err, _Symlink, _New_symlink); } } - inline bool copy_file(const path& _From, const path& _To, const copy_options _Options, error_code& _Ec) noexcept + _EXPORT_STD inline bool copy_file( + const path& _From, const path& _To, const copy_options _Options, error_code& _Ec) noexcept /* strengthened */ { // copy a file _From -> _To according to _Options const auto _Result = @@ -3360,7 +3362,7 @@ namespace filesystem { return _Result._Copied; } - inline bool copy_file(const path& _From, const path& _To, const copy_options _Options) { + _EXPORT_STD inline bool copy_file(const path& _From, const path& _To, const copy_options _Options) { // copy a file _From -> _To according to _Options const auto _Result = __std_fs_copy_file(_From.c_str(), _To.c_str(), static_cast<__std_fs_copy_options>(_Options)); @@ -3371,12 +3373,12 @@ namespace filesystem { return _Result._Copied; } - inline bool copy_file(const path& _From, const path& _To, error_code& _Ec) noexcept /* strengthened */ { + _EXPORT_STD inline bool copy_file(const path& _From, const path& _To, error_code& _Ec) noexcept /* strengthened */ { // copy a file _From -> _To, failing if the destination exists return _STD filesystem::copy_file(_From, _To, copy_options::none, _Ec); } - inline bool copy_file(const path& _From, const path& _To) { + _EXPORT_STD inline bool copy_file(const path& _From, const path& _To) { // copy a file _From -> _To, failing if the destination exists return _STD filesystem::copy_file(_From, _To, copy_options::none); } @@ -3398,7 +3400,7 @@ namespace filesystem { return {__std_win_error::_Success, _CSTD memcmp(&_Left_id, &_Right_id, sizeof(__std_fs_file_id)) == 0}; } - _NODISCARD inline bool equivalent(const path& _Lhs, const path& _Rhs) { + _EXPORT_STD _NODISCARD inline bool equivalent(const path& _Lhs, const path& _Rhs) { // test if the paths _Lhs and _Rhs refer to the same file const auto _Result = _Equivalent(_Lhs.c_str(), _Rhs.c_str()); if (_Result.first != __std_win_error::_Success) { @@ -3408,19 +3410,19 @@ namespace filesystem { return _Result.second; } - _NODISCARD inline bool equivalent(const path& _Lhs, const path& _Rhs, error_code& _Ec) noexcept { + _EXPORT_STD _NODISCARD inline bool equivalent(const path& _Lhs, const path& _Rhs, error_code& _Ec) noexcept { // test if the paths _Lhs and _Rhs refer to the same file const auto _Result = _Equivalent(_Lhs.c_str(), _Rhs.c_str()); _Ec = _Make_ec(_Result.first); return _Result.second; } - _NODISCARD inline file_status status(const path& _Path); - _NODISCARD inline file_status status(const path& _Path, error_code& _Ec) noexcept; - _NODISCARD inline file_status symlink_status(const path& _Path); - _NODISCARD inline file_status symlink_status(const path& _Path, error_code& _Ec) noexcept; + _EXPORT_STD _NODISCARD inline file_status status(const path& _Path); + _EXPORT_STD _NODISCARD inline file_status status(const path& _Path, error_code& _Ec) noexcept; + _EXPORT_STD _NODISCARD inline file_status symlink_status(const path& _Path); + _EXPORT_STD _NODISCARD inline file_status symlink_status(const path& _Path, error_code& _Ec) noexcept; - _NODISCARD inline bool exists(const path& _Target, error_code& _Ec) noexcept { + _EXPORT_STD _NODISCARD inline bool exists(const path& _Target, error_code& _Ec) noexcept { const auto _Type = _STD filesystem::status(_Target, _Ec).type(); if (_Type != file_type::none) { _Ec.clear(); @@ -3430,7 +3432,7 @@ namespace filesystem { return false; } - _NODISCARD inline bool exists(const path& _Target) { + _EXPORT_STD _NODISCARD inline bool exists(const path& _Target) { error_code _Ec; const bool _Result = _STD filesystem::exists(_Target, _Ec); if (_Ec) { @@ -3453,7 +3455,7 @@ namespace filesystem { return _Error; } - _NODISCARD inline uintmax_t file_size(const path& _Path) { + _EXPORT_STD _NODISCARD inline uintmax_t file_size(const path& _Path) { uintmax_t _Result; const auto _Error = _File_size(_Path, _Result); if (_Error != __std_win_error::_Success) { @@ -3463,7 +3465,7 @@ namespace filesystem { return _Result; } - _NODISCARD inline uintmax_t file_size(const path& _Path, error_code& _Ec) noexcept { + _EXPORT_STD _NODISCARD inline uintmax_t file_size(const path& _Path, error_code& _Ec) noexcept { uintmax_t _Result; _Ec = _Make_ec(_File_size(_Path, _Result)); return _Result; @@ -3482,7 +3484,7 @@ namespace filesystem { return _Error; } - _NODISCARD inline uintmax_t hard_link_count(const path& _Target) { + _EXPORT_STD _NODISCARD inline uintmax_t hard_link_count(const path& _Target) { // get the number of hard links to _Target uintmax_t _Result; const auto _Err = _Hard_link_count(_Target.c_str(), _Result); @@ -3493,46 +3495,46 @@ namespace filesystem { return _Result; } - _NODISCARD inline uintmax_t hard_link_count(const path& _Target, error_code& _Ec) noexcept { + _EXPORT_STD _NODISCARD inline uintmax_t hard_link_count(const path& _Target, error_code& _Ec) noexcept { // get the number of hard links to _Target uintmax_t _Result; _Ec = _Make_ec(_Hard_link_count(_Target.c_str(), _Result)); return _Result; } - _NODISCARD inline bool is_block_file(const path&) noexcept /* strengthened */ { + _EXPORT_STD _NODISCARD inline bool is_block_file(const path&) noexcept /* strengthened */ { // tests whether the input path is a block special file (never on Windows) return false; } - _NODISCARD inline bool is_block_file(const path& _Path, error_code& _Ec) noexcept { + _EXPORT_STD _NODISCARD inline bool is_block_file(const path& _Path, error_code& _Ec) noexcept { // tests whether the input path is a block special file (never on Windows) (void) _STD filesystem::status(_Path, _Ec); return false; // note status sets _Ec to an error on nonexistent input } - _NODISCARD inline bool is_character_file(const path&) noexcept /* strengthened */ { + _EXPORT_STD _NODISCARD inline bool is_character_file(const path&) noexcept /* strengthened */ { // tests whether the input path is a character special file (never on Windows) return false; } - _NODISCARD inline bool is_character_file(const path& _Path, error_code& _Ec) noexcept { + _EXPORT_STD _NODISCARD inline bool is_character_file(const path& _Path, error_code& _Ec) noexcept { // tests whether the input path is a character special file (never on Windows) (void) _STD filesystem::status(_Path, _Ec); return false; // note status sets _Ec to an error on nonexistent input } - _NODISCARD inline bool is_directory(const path& _Path) { + _EXPORT_STD _NODISCARD inline bool is_directory(const path& _Path) { // tests whether _Path is a directory return _STD filesystem::is_directory(_STD filesystem::status(_Path)); } - _NODISCARD inline bool is_directory(const path& _Path, error_code& _Ec) noexcept { + _EXPORT_STD _NODISCARD inline bool is_directory(const path& _Path, error_code& _Ec) noexcept { // tests whether _Path is a directory return _STD filesystem::is_directory(_STD filesystem::status(_Path, _Ec)); } - _NODISCARD inline bool is_empty(const path& _Path, error_code& _Ec) { + _EXPORT_STD _NODISCARD inline bool is_empty(const path& _Path, error_code& _Ec) { // test whether _Path refers to a zero sized file or empty directory constexpr auto _Flags = __std_fs_stats_flags::_Attributes | __std_fs_stats_flags::_File_size | __std_fs_stats_flags::_Follow_symlinks; @@ -3551,7 +3553,7 @@ namespace filesystem { } } - _NODISCARD inline bool is_empty(const path& _Path) { + _EXPORT_STD _NODISCARD inline bool is_empty(const path& _Path) { // test whether _Path refers to a zero sized file or empty directory error_code _Ec; const bool _Result = is_empty(_Path, _Ec); @@ -3562,59 +3564,59 @@ namespace filesystem { return _Result; } - _NODISCARD inline bool is_fifo(const path&) noexcept /* strengthened */ { + _EXPORT_STD _NODISCARD inline bool is_fifo(const path&) noexcept /* strengthened */ { // tests whether the input path is a fifo (never on Windows) return false; } - _NODISCARD inline bool is_fifo(const path& _Path, error_code& _Ec) noexcept { + _EXPORT_STD _NODISCARD inline bool is_fifo(const path& _Path, error_code& _Ec) noexcept { // tests whether the input path is a fifo (never on Windows) (void) _STD filesystem::status(_Path, _Ec); return false; // note status sets _Ec to an error on nonexistent input } - _NODISCARD inline bool is_other(const path& _Path) { + _EXPORT_STD _NODISCARD inline bool is_other(const path& _Path) { // tests whether _Path is an "other" file (such as a junction) return _STD filesystem::is_other(_STD filesystem::status(_Path)); } - _NODISCARD inline bool is_other(const path& _Path, error_code& _Ec) noexcept { + _EXPORT_STD _NODISCARD inline bool is_other(const path& _Path, error_code& _Ec) noexcept { // tests whether _Path is an "other" file (such as a junction) return _STD filesystem::is_other(_STD filesystem::status(_Path, _Ec)); } - _NODISCARD inline bool is_regular_file(const path& _Path) { + _EXPORT_STD _NODISCARD inline bool is_regular_file(const path& _Path) { // tests whether _Path is a regular file return _STD filesystem::is_regular_file(_STD filesystem::status(_Path)); } - _NODISCARD inline bool is_regular_file(const path& _Path, error_code& _Ec) noexcept { + _EXPORT_STD _NODISCARD inline bool is_regular_file(const path& _Path, error_code& _Ec) noexcept { // tests whether _Path is a regular file return _STD filesystem::is_regular_file(_STD filesystem::status(_Path, _Ec)); } - _NODISCARD inline bool is_socket(const path&) noexcept /* strengthened */ { + _EXPORT_STD _NODISCARD inline bool is_socket(const path&) noexcept /* strengthened */ { // tests whether the input path is a socket (never on Windows) return false; } - _NODISCARD inline bool is_socket(const path& _Path, error_code& _Ec) noexcept { + _EXPORT_STD _NODISCARD inline bool is_socket(const path& _Path, error_code& _Ec) noexcept { // tests whether the input path is a socket (never on Windows) (void) _STD filesystem::status(_Path, _Ec); return false; // note status sets _Ec to an error on nonexistent input } - _NODISCARD inline bool is_symlink(const path& _Path) { + _EXPORT_STD _NODISCARD inline bool is_symlink(const path& _Path) { // tests whether _Path is a symlink return _STD filesystem::is_symlink(_STD filesystem::symlink_status(_Path)); } - _NODISCARD inline bool is_symlink(const path& _Path, error_code& _Ec) noexcept { + _EXPORT_STD _NODISCARD inline bool is_symlink(const path& _Path, error_code& _Ec) noexcept { // tests whether _Path is a symlink return _STD filesystem::is_symlink(_STD filesystem::symlink_status(_Path, _Ec)); } - inline bool remove(const path& _Target) { + _EXPORT_STD inline bool remove(const path& _Target) { // remove file _Target (even if it is a directory); returns whether the file was removed // note !exists(_Target) is not an error, and merely returns false const auto _Result = __std_fs_remove(_Target.c_str()); @@ -3625,7 +3627,7 @@ namespace filesystem { return _Result._Removed; } - inline bool remove(const path& _Target, error_code& _Ec) noexcept { + _EXPORT_STD inline bool remove(const path& _Target, error_code& _Ec) noexcept { // remove file _Target (even if it is a directory); returns whether the file was removed // note !exists(_Target) is not an error, and merely returns false const auto _Result = __std_fs_remove(_Target.c_str()); @@ -3633,7 +3635,7 @@ namespace filesystem { return _Result._Removed; } - inline void rename(const path& _Old_p, const path& _New_p) { + _EXPORT_STD inline void rename(const path& _Old_p, const path& _New_p) { // rename _Old_p to _New_p, overwriting _New_p if it is an existing non-directory file // the standard explicitly allows an implementation to not replace _New_p if it is a directory, // and we take advantage of that here to be able to use MoveFileEx(... MOVEFILE_REPLACE_EXISTING) @@ -3643,14 +3645,14 @@ namespace filesystem { } } - inline void rename(const path& _Old_p, const path& _New_p, error_code& _Ec) noexcept { + _EXPORT_STD inline void rename(const path& _Old_p, const path& _New_p, error_code& _Ec) noexcept { // rename _Old_p to _New_p, overwriting _New_p if it is an existing non-directory file // the standard explicitly allows an implementation to not replace _New_p if it is a directory, // and we take advantage of that here to be able to use MoveFileEx(... MOVEFILE_REPLACE_EXISTING) _Ec = _Make_ec(__std_fs_rename(_Old_p.c_str(), _New_p.c_str())); } - inline void resize_file(const path& _Target, const uintmax_t _New_size) { + _EXPORT_STD inline void resize_file(const path& _Target, const uintmax_t _New_size) { // set the size of _Target to _New_size const auto _Err = __std_fs_resize_file(_Target.c_str(), _New_size); if (_Err != __std_win_error::_Success) { @@ -3658,12 +3660,12 @@ namespace filesystem { } } - inline void resize_file(const path& _Target, const uintmax_t _New_size, error_code& _Ec) noexcept { + _EXPORT_STD inline void resize_file(const path& _Target, const uintmax_t _New_size, error_code& _Ec) noexcept { // set the size of _Target to _New_size _Ec = _Make_ec(__std_fs_resize_file(_Target.c_str(), _New_size)); } - struct space_info { + _EXPORT_STD struct space_info { uintmax_t capacity; uintmax_t free; uintmax_t available; @@ -3673,7 +3675,7 @@ namespace filesystem { #endif // _HAS_CXX20 }; - _NODISCARD inline space_info space(const path& _Target) { + _EXPORT_STD _NODISCARD inline space_info space(const path& _Target) { // get capacity information for the volume on which the file _Target resides space_info _Result; const auto _Last_error = __std_fs_space(_Target.c_str(), &_Result.available, &_Result.capacity, &_Result.free); @@ -3684,14 +3686,14 @@ namespace filesystem { return _Result; } - _NODISCARD inline space_info space(const path& _Target, error_code& _Ec) noexcept { + _EXPORT_STD _NODISCARD inline space_info space(const path& _Target, error_code& _Ec) noexcept { // get capacity information for the volume on which the file _Target resides space_info _Result; _Ec = _Make_ec(__std_fs_space(_Target.c_str(), &_Result.available, &_Result.capacity, &_Result.free)); return _Result; } - _NODISCARD inline bool status_known(const file_status _Status) noexcept { + _EXPORT_STD _NODISCARD inline bool status_known(const file_status _Status) noexcept { return _Status.type() != file_type::none; } @@ -3707,13 +3709,13 @@ namespace filesystem { return _Result; } - _NODISCARD inline file_status status(const path& _Path, error_code& _Ec) noexcept { + _EXPORT_STD _NODISCARD inline file_status status(const path& _Path, error_code& _Ec) noexcept { const auto _Result = _Get_any_status(_Path, _Status_stats_flags); _Ec = _Make_ec(_Result._Error); return _Result._Status; } - _NODISCARD inline file_status status(const path& _Path) { + _EXPORT_STD _NODISCARD inline file_status status(const path& _Path) { const auto _Result = _Get_any_status(_Path, _Status_stats_flags); if (_Result._Not_good()) { _Throw_fs_error("status", _Result._Error, _Path); @@ -3721,13 +3723,13 @@ namespace filesystem { return _Result._Status; } - _NODISCARD inline file_status symlink_status(const path& _Path, error_code& _Ec) noexcept { + _EXPORT_STD _NODISCARD inline file_status symlink_status(const path& _Path, error_code& _Ec) noexcept { const auto _Result = _Get_any_status(_Path, _Symlink_status_stats_flags); _Ec = _Make_ec(_Result._Error); return _Result._Status; } - _NODISCARD inline file_status symlink_status(const path& _Path) { + _EXPORT_STD _NODISCARD inline file_status symlink_status(const path& _Path) { const auto _Result = _Get_any_status(_Path, _Symlink_status_stats_flags); if (_Result._Not_good()) { _Throw_fs_error("symlink_status", _Result._Error, _Path); @@ -3736,7 +3738,7 @@ namespace filesystem { return _Result._Status; } - inline bool create_directory(const path& _Path) { + _EXPORT_STD inline bool create_directory(const path& _Path) { const auto _Result = __std_fs_create_directory(_Path.c_str()); if (_Result._Error != __std_win_error::_Success) { _Throw_fs_error("create_directory", _Result._Error, _Path); @@ -3745,13 +3747,13 @@ namespace filesystem { return _Result._Created; } - inline bool create_directory(const path& _Path, error_code& _Ec) noexcept { + _EXPORT_STD inline bool create_directory(const path& _Path, error_code& _Ec) noexcept { const auto _Result = __std_fs_create_directory(_Path.c_str()); _Ec = _Make_ec(_Result._Error); return _Result._Created; } - inline bool create_directory(const path& _Path, const path& _Existing_p) { + _EXPORT_STD inline bool create_directory(const path& _Path, const path& _Existing_p) { const auto _Result = __std_fs_create_directory(_Path.c_str()); if (_Result._Error != __std_win_error::_Success) { _Throw_fs_error("create_directory", _Result._Error, _Path, _Existing_p); @@ -3760,13 +3762,13 @@ namespace filesystem { return _Result._Created; } - inline bool create_directory(const path& _Path, const path&, error_code& _Ec) noexcept { + _EXPORT_STD inline bool create_directory(const path& _Path, const path&, error_code& _Ec) noexcept { const auto _Result = __std_fs_create_directory(_Path.c_str()); _Ec = _Make_ec(_Result._Error); return _Result._Created; } - inline bool create_directories(const path& _Path, error_code& _Ec) { + _EXPORT_STD inline bool create_directories(const path& _Path, error_code& _Ec) { if (_Path.empty()) { _Ec = _Make_ec(__std_win_error::_Path_not_found); return false; @@ -3825,7 +3827,7 @@ namespace filesystem { return _Created_last; } - inline bool create_directories(const path& _Path) { + _EXPORT_STD inline bool create_directories(const path& _Path) { error_code _Ec; const bool _Result = _STD filesystem::create_directories(_Path, _Ec); if (_Ec) { @@ -3885,7 +3887,7 @@ namespace filesystem { } } - inline uintmax_t remove_all(const path& _Path, error_code& _Ec) { + _EXPORT_STD inline uintmax_t remove_all(const path& _Path, error_code& _Ec) { // remove _Path, including any contents _Ec.clear(); // for exception safety const auto _First_remove_result = __std_fs_remove(_Path.c_str()); @@ -3902,7 +3904,7 @@ namespace filesystem { return _Removed_count; } - inline uintmax_t remove_all(const path& _Path) { + _EXPORT_STD inline uintmax_t remove_all(const path& _Path) { error_code _Ec; const auto _Removed_count = _STD filesystem::remove_all(_Path, _Ec); if (_Ec) { @@ -3925,7 +3927,7 @@ namespace filesystem { return _Error; } - _NODISCARD inline file_time_type last_write_time(const path& _Path) { + _EXPORT_STD _NODISCARD inline file_time_type last_write_time(const path& _Path) { file_time_type _Result; const auto _Error = _Last_write_time(_Path, _Result); if (_Error != __std_win_error::_Success) { @@ -3935,13 +3937,13 @@ namespace filesystem { return _Result; } - _NODISCARD inline file_time_type last_write_time(const path& _Path, error_code& _Ec) noexcept { + _EXPORT_STD _NODISCARD inline file_time_type last_write_time(const path& _Path, error_code& _Ec) noexcept { file_time_type _Result; _Ec = _Make_ec(_Last_write_time(_Path, _Result)); return _Result; } - inline void last_write_time(const path& _Target, const file_time_type _New_time) { + _EXPORT_STD inline void last_write_time(const path& _Target, const file_time_type _New_time) { // set the last write time of _Target to _New_time const auto _Err = __std_fs_set_last_write_time(_New_time.time_since_epoch().count(), _Target.c_str()); if (_Err != __std_win_error::_Success) { @@ -3949,14 +3951,15 @@ namespace filesystem { } } - inline void last_write_time(const path& _Target, const file_time_type _New_time, error_code& _Ec) noexcept { + _EXPORT_STD inline void last_write_time( + const path& _Target, const file_time_type _New_time, error_code& _Ec) noexcept { // set the last write time of _Target to _New_time _Ec = _Make_ec(__std_fs_set_last_write_time(_New_time.time_since_epoch().count(), _Target.c_str())); } - enum class perm_options { replace = 0x1, add = 0x2, remove = 0x4, nofollow = 0x8 }; + _EXPORT_STD enum class perm_options { replace = 0x1, add = 0x2, remove = 0x4, nofollow = 0x8 }; - _BITMASK_OPS(perm_options) + _BITMASK_OPS(_EXPORT_STD, perm_options) _NODISCARD inline __std_win_error _Permissions( const path& _Target, const perms _Perms, perm_options _Options) noexcept { @@ -3995,7 +3998,7 @@ namespace filesystem { return __std_fs_change_permissions(_Target.c_str(), _Follow_symlinks, _Readonly); } - inline void permissions( + _EXPORT_STD inline void permissions( const path& _Target, const perms _Perms, const perm_options _Options = perm_options::replace) { const auto _Err = _Permissions(_Target, _Perms, _Options); if (_Err != __std_win_error::_Success) { @@ -4003,16 +4006,16 @@ namespace filesystem { } } - inline void permissions( + _EXPORT_STD inline void permissions( const path& _Target, const perms _Perms, const perm_options _Options, error_code& _Ec) noexcept { _Ec = _Make_ec(_Permissions(_Target, _Perms, _Options)); } - inline void permissions(const path& _Target, const perms _Perms, error_code& _Ec) noexcept { + _EXPORT_STD inline void permissions(const path& _Target, const perms _Perms, error_code& _Ec) noexcept { _STD filesystem::permissions(_Target, _Perms, perm_options::replace, _Ec); } - _NODISCARD inline path temp_directory_path(error_code& _Ec) { + _EXPORT_STD _NODISCARD inline path temp_directory_path(error_code& _Ec) { // get a location suitable for temporary storage, and verify that it is a directory _Ec.clear(); // for exception safety path _Result; @@ -4028,7 +4031,7 @@ namespace filesystem { return _Result; } - _NODISCARD inline path temp_directory_path() { + _EXPORT_STD _NODISCARD inline path temp_directory_path() { // get a location suitable for temporary storage, and verify that it is a directory error_code _Ec; // unusual arrangement to allow thrown error_code to have generic_category() path _Result(_STD filesystem::temp_directory_path(_Ec)); @@ -4050,14 +4053,14 @@ namespace filesystem { } } - _NODISCARD inline path current_path(error_code& _Ec) { + _EXPORT_STD _NODISCARD inline path current_path(error_code& _Ec) { _Ec.clear(); path _Result; _Ec = _Make_ec(_Current_path(_Result)); return _Result; } - _NODISCARD inline path current_path() { + _EXPORT_STD _NODISCARD inline path current_path() { path _Result; const auto _Err = _Current_path(_Result); if (_Err != __std_win_error::_Success) { @@ -4066,18 +4069,18 @@ namespace filesystem { return _Result; } - inline void current_path(const path& _To, error_code& _Ec) noexcept { // set the current path + _EXPORT_STD inline void current_path(const path& _To, error_code& _Ec) noexcept { // set the current path _Ec = _Make_ec(__std_fs_set_current_path(_To._Text.data())); } - inline void current_path(const path& _To) { // set the current path + _EXPORT_STD inline void current_path(const path& _To) { // set the current path const auto _Err = __std_fs_set_current_path(_To._Text.data()); if (_Err != __std_win_error::_Success) { _Throw_fs_error("current_path(const path&)", _Err, _To); } } - _NODISCARD inline path weakly_canonical(const path& _Input, error_code& _Ec) { + _EXPORT_STD _NODISCARD inline path weakly_canonical(const path& _Input, error_code& _Ec) { // eventually calls GetFinalPathNameByHandleW _Ec.clear(); // for exception safety @@ -4126,7 +4129,7 @@ namespace filesystem { return _Result; } - _NODISCARD inline path weakly_canonical(const path& _Input) { + _EXPORT_STD _NODISCARD inline path weakly_canonical(const path& _Input) { // eventually calls GetFinalPathNameByHandleW error_code _Ec; @@ -4139,14 +4142,15 @@ namespace filesystem { return _Result; } - _NODISCARD inline path proximate(const path& _Path, const path& _Base = _STD filesystem::current_path()) { + _EXPORT_STD _NODISCARD inline path proximate( + const path& _Path, const path& _Base = _STD filesystem::current_path()) { // eventually calls GetFinalPathNameByHandleW const path _Weakly_canonical_path = _STD filesystem::weakly_canonical(_Path); const path _Weakly_canonical_base = _STD filesystem::weakly_canonical(_Base); return _Weakly_canonical_path.lexically_proximate(_Weakly_canonical_base); } - _NODISCARD inline path proximate(const path& _Path, const path& _Base, error_code& _Ec) { + _EXPORT_STD _NODISCARD inline path proximate(const path& _Path, const path& _Base, error_code& _Ec) { // eventually calls GetFinalPathNameByHandleW const path _Weakly_canonical_path = _STD filesystem::weakly_canonical(_Path, _Ec); @@ -4163,7 +4167,7 @@ namespace filesystem { return _Weakly_canonical_path.lexically_proximate(_Weakly_canonical_base); } - _NODISCARD inline path proximate(const path& _Path, error_code& _Ec) { + _EXPORT_STD _NODISCARD inline path proximate(const path& _Path, error_code& _Ec) { // eventually calls GetFinalPathNameByHandleW const path _Base = _STD filesystem::current_path(_Ec); // N4810 29.11.14.27 [fs.op.proximate]/1 incorrectly calls current_path() @@ -4174,14 +4178,15 @@ namespace filesystem { return _STD filesystem::proximate(_Path, _Base, _Ec); } - _NODISCARD inline path relative(const path& _Path, const path& _Base = _STD filesystem::current_path()) { + _EXPORT_STD _NODISCARD inline path relative( + const path& _Path, const path& _Base = _STD filesystem::current_path()) { // eventually calls GetFinalPathNameByHandleW const path _Weakly_canonical_path = _STD filesystem::weakly_canonical(_Path); const path _Weakly_canonical_base = _STD filesystem::weakly_canonical(_Base); return _Weakly_canonical_path.lexically_relative(_Weakly_canonical_base); } - _NODISCARD inline path relative(const path& _Path, const path& _Base, error_code& _Ec) { + _EXPORT_STD _NODISCARD inline path relative(const path& _Path, const path& _Base, error_code& _Ec) { // eventually calls GetFinalPathNameByHandleW const path _Weakly_canonical_path = _STD filesystem::weakly_canonical(_Path, _Ec); @@ -4198,7 +4203,7 @@ namespace filesystem { return _Weakly_canonical_path.lexically_relative(_Weakly_canonical_base); } - _NODISCARD inline path relative(const path& _Path, error_code& _Ec) { + _EXPORT_STD _NODISCARD inline path relative(const path& _Path, error_code& _Ec) { // eventually calls GetFinalPathNameByHandleW const path _Base = _STD filesystem::current_path(_Ec); // N4810 29.11.14.29 [fs.op.relative]/1 incorrectly calls current_path() @@ -4366,7 +4371,7 @@ namespace filesystem { // Otherwise, no effects. } - inline void copy(const path& _From, const path& _To, const copy_options _Options, error_code& _Ec) { + _EXPORT_STD inline void copy(const path& _From, const path& _To, const copy_options _Options, error_code& _Ec) { const directory_entry _From_dir(_From, _Ec); if (_Ec) { // report an error if exists(f) is false return; @@ -4375,7 +4380,7 @@ namespace filesystem { _Copy_impl(_From_dir, _To, _Options, _Ec); } - inline void copy(const path& _From, const path& _To, const copy_options _Options) { + _EXPORT_STD inline void copy(const path& _From, const path& _To, const copy_options _Options) { error_code _Ec; _STD filesystem::copy(_From, _To, _Options, _Ec); if (_Ec) { @@ -4383,11 +4388,11 @@ namespace filesystem { } } - inline void copy(const path& _From, const path& _To, error_code& _Ec) { + _EXPORT_STD inline void copy(const path& _From, const path& _To, error_code& _Ec) { return _STD filesystem::copy(_From, _To, copy_options::none, _Ec); } - inline void copy(const path& _From, const path& _To) { + _EXPORT_STD inline void copy(const path& _From, const path& _To) { return _STD filesystem::copy(_From, _To, copy_options::none); } } // namespace filesystem diff --git a/stl/inc/format b/stl/inc/format index 25d61dddb0..4675dd3593 100644 --- a/stl/inc/format +++ b/stl/inc/format @@ -70,12 +70,10 @@ extern "C" _NODISCARD __std_win_error __stdcall __std_get_cvt(__std_code_page _C _STD_BEGIN -template +_EXPORT_STD template class vector; -class format_error : public runtime_error { - using runtime_error::runtime_error; -}; +_EXPORT_STD class format_error : public runtime_error { using runtime_error::runtime_error; }; [[noreturn]] inline void _Throw_format_error(const char* const _Message) { _THROW(format_error{_Message}); @@ -544,12 +542,12 @@ concept _Has_formatter = requires(_Ty& _Val, _Context& _Ctx) { template concept _Has_const_formatter = _Has_formatter, _Context>; -template +_EXPORT_STD template struct formatter; inline void _You_see_this_error_because_arg_id_is_out_of_range() noexcept {} -template +_EXPORT_STD template class basic_format_parse_context { public: using char_type = _CharT; @@ -624,10 +622,10 @@ private: ptrdiff_t _Next_arg_id = 0; }; -using format_parse_context = basic_format_parse_context; -using wformat_parse_context = basic_format_parse_context; +_EXPORT_STD using format_parse_context = basic_format_parse_context; +_EXPORT_STD using wformat_parse_context = basic_format_parse_context; -template +_EXPORT_STD template class basic_format_arg { public: using _CharType = typename _Context::char_type; @@ -716,7 +714,7 @@ public: }; }; -template +_EXPORT_STD template decltype(auto) visit_format_arg(_Visitor&& _Vis, basic_format_arg<_Context> _Arg) { switch (_Arg._Active_state) { case _Basic_format_arg_type::_None: @@ -1809,7 +1807,7 @@ struct _Format_arg_index { size_t _Type_ : 4; }; -template +_EXPORT_STD template class basic_format_args; template @@ -1896,7 +1894,7 @@ public: template class _Format_arg_store<_Context> {}; -template +_EXPORT_STD template class basic_format_args { public: basic_format_args() noexcept = default; @@ -2007,7 +2005,7 @@ public: } }; -template +_EXPORT_STD template requires output_iterator<_Out, const _CharT&> class basic_format_context { private: @@ -2251,8 +2249,8 @@ public: using _Fmt_it = back_insert_iterator<_Fmt_buffer>; using _Fmt_wit = back_insert_iterator<_Fmt_buffer>; -using format_context = basic_format_context<_Fmt_it, char>; -using wformat_context = basic_format_context<_Fmt_wit, wchar_t>; +_EXPORT_STD using format_context = basic_format_context<_Fmt_it, char>; +_EXPORT_STD using wformat_context = basic_format_context<_Fmt_wit, wchar_t>; template _NODISCARD _OutputIt _Fmt_write(_OutputIt _Out, monostate) { @@ -3279,7 +3277,7 @@ struct _Format_handler { // Generic formatter definition, the deleted default constructor // makes it "disabled" as per N4885 [format.formatter.spec]/5 -template +_EXPORT_STD template struct formatter { formatter() = delete; formatter(const formatter&) = delete; @@ -3375,7 +3373,7 @@ template <_Format_supported_charT _CharT, class _Traits> struct formatter, _CharT> : _Formatter_base, _CharT, _Basic_format_arg_type::_String_type> {}; -template +_EXPORT_STD template struct basic_format_string { public: template @@ -3394,26 +3392,26 @@ private: basic_string_view<_CharT> _Str; }; -template +_EXPORT_STD template using format_string = basic_format_string...>; -template +_EXPORT_STD template using wformat_string = basic_format_string...>; -using format_args = basic_format_args; -using wformat_args = basic_format_args; +_EXPORT_STD using format_args = basic_format_args; +_EXPORT_STD using wformat_args = basic_format_args; -template +_EXPORT_STD template _NODISCARD auto make_format_args(_Args&&... _Vals) { return _Format_arg_store<_Context, _Args...>{_Vals...}; } -template +_EXPORT_STD template _NODISCARD auto make_wformat_args(_Args&&... _Vals) { return _Format_arg_store{_Vals...}; } -template _OutputIt> +_EXPORT_STD template _OutputIt> _OutputIt vformat_to(_OutputIt _Out, const string_view _Fmt, const format_args _Args) { if constexpr (is_same_v<_OutputIt, _Fmt_it>) { _Format_handler _Handler(_Out, _Fmt, _Args); @@ -3427,7 +3425,7 @@ _OutputIt vformat_to(_OutputIt _Out, const string_view _Fmt, const format_args _ } } -template _OutputIt> +_EXPORT_STD template _OutputIt> _OutputIt vformat_to(_OutputIt _Out, const wstring_view _Fmt, const wformat_args _Args) { if constexpr (is_same_v<_OutputIt, _Fmt_wit>) { _Format_handler _Handler(_Out, _Fmt, _Args); @@ -3441,7 +3439,7 @@ _OutputIt vformat_to(_OutputIt _Out, const wstring_view _Fmt, const wformat_args } } -template _OutputIt> +_EXPORT_STD template _OutputIt> _OutputIt vformat_to(_OutputIt _Out, const locale& _Loc, const string_view _Fmt, const format_args _Args) { if constexpr (is_same_v<_OutputIt, _Fmt_it>) { _Format_handler _Handler(_Out, _Fmt, _Args, _Lazy_locale{_Loc}); @@ -3455,7 +3453,7 @@ _OutputIt vformat_to(_OutputIt _Out, const locale& _Loc, const string_view _Fmt, } } -template _OutputIt> +_EXPORT_STD template _OutputIt> _OutputIt vformat_to(_OutputIt _Out, const locale& _Loc, const wstring_view _Fmt, const wformat_args _Args) { if constexpr (is_same_v<_OutputIt, _Fmt_wit>) { _Format_handler _Handler(_Out, _Fmt, _Args, _Lazy_locale{_Loc}); @@ -3469,27 +3467,27 @@ _OutputIt vformat_to(_OutputIt _Out, const locale& _Loc, const wstring_view _Fmt } } -template _OutputIt, class... _Types> +_EXPORT_STD template _OutputIt, class... _Types> _OutputIt format_to(_OutputIt _Out, const format_string<_Types...> _Fmt, _Types&&... _Args) { return _STD vformat_to(_STD move(_Out), _Fmt.get(), _STD make_format_args(_Args...)); } -template _OutputIt, class... _Types> +_EXPORT_STD template _OutputIt, class... _Types> _OutputIt format_to(_OutputIt _Out, const wformat_string<_Types...> _Fmt, _Types&&... _Args) { return _STD vformat_to(_STD move(_Out), _Fmt.get(), _STD make_wformat_args(_Args...)); } -template _OutputIt, class... _Types> +_EXPORT_STD template _OutputIt, class... _Types> _OutputIt format_to(_OutputIt _Out, const locale& _Loc, const format_string<_Types...> _Fmt, _Types&&... _Args) { return _STD vformat_to(_STD move(_Out), _Loc, _Fmt.get(), _STD make_format_args(_Args...)); } -template _OutputIt, class... _Types> +_EXPORT_STD template _OutputIt, class... _Types> _OutputIt format_to(_OutputIt _Out, const locale& _Loc, const wformat_string<_Types...> _Fmt, _Types&&... _Args) { return _STD vformat_to(_STD move(_Out), _Loc, _Fmt.get(), _STD make_wformat_args(_Args...)); } -template // improves throughput, see GH-2329 +_EXPORT_STD template // improves throughput, see GH-2329 _NODISCARD string vformat(const string_view _Fmt, const format_args _Args) { string _Str; _Str.reserve(_Fmt.size() + _Args._Estimate_required_capacity()); @@ -3497,7 +3495,7 @@ _NODISCARD string vformat(const string_view _Fmt, const format_args _Args) { return _Str; } -template // improves throughput, see GH-2329 +_EXPORT_STD template // improves throughput, see GH-2329 _NODISCARD wstring vformat(const wstring_view _Fmt, const wformat_args _Args) { wstring _Str; _Str.reserve(_Fmt.size() + _Args._Estimate_required_capacity()); @@ -3505,7 +3503,7 @@ _NODISCARD wstring vformat(const wstring_view _Fmt, const wformat_args _Args) { return _Str; } -template // improves throughput, see GH-2329 +_EXPORT_STD template // improves throughput, see GH-2329 _NODISCARD string vformat(const locale& _Loc, const string_view _Fmt, const format_args _Args) { string _Str; _Str.reserve(_Fmt.size() + _Args._Estimate_required_capacity()); @@ -3513,7 +3511,7 @@ _NODISCARD string vformat(const locale& _Loc, const string_view _Fmt, const form return _Str; } -template // improves throughput, see GH-2329 +_EXPORT_STD template // improves throughput, see GH-2329 _NODISCARD wstring vformat(const locale& _Loc, const wstring_view _Fmt, const wformat_args _Args) { wstring _Str; _Str.reserve(_Fmt.size() + _Args._Estimate_required_capacity()); @@ -3521,33 +3519,33 @@ _NODISCARD wstring vformat(const locale& _Loc, const wstring_view _Fmt, const wf return _Str; } -template +_EXPORT_STD template _NODISCARD string format(const format_string<_Types...> _Fmt, _Types&&... _Args) { return _STD vformat(_Fmt.get(), _STD make_format_args(_Args...)); } -template +_EXPORT_STD template _NODISCARD wstring format(const wformat_string<_Types...> _Fmt, _Types&&... _Args) { return _STD vformat(_Fmt.get(), _STD make_wformat_args(_Args...)); } -template +_EXPORT_STD template _NODISCARD string format(const locale& _Loc, const format_string<_Types...> _Fmt, _Types&&... _Args) { return _STD vformat(_Loc, _Fmt.get(), _STD make_format_args(_Args...)); } -template +_EXPORT_STD template _NODISCARD wstring format(const locale& _Loc, const wformat_string<_Types...> _Fmt, _Types&&... _Args) { return _STD vformat(_Loc, _Fmt.get(), _STD make_wformat_args(_Args...)); } -template +_EXPORT_STD template struct format_to_n_result { _OutputIt out; iter_difference_t<_OutputIt> size; }; -template _OutputIt, class... _Types> +_EXPORT_STD template _OutputIt, class... _Types> format_to_n_result<_OutputIt> format_to_n( _OutputIt _Out, const iter_difference_t<_OutputIt> _Max, const format_string<_Types...> _Fmt, _Types&&... _Args) { _Fmt_iterator_buffer<_OutputIt, char, _Fmt_fixed_buffer_traits> _Buf(_STD move(_Out), _Max); @@ -3555,7 +3553,7 @@ format_to_n_result<_OutputIt> format_to_n( return {.out = _Buf._Out(), .size = _Buf._Count()}; } -template _OutputIt, class... _Types> +_EXPORT_STD template _OutputIt, class... _Types> format_to_n_result<_OutputIt> format_to_n( _OutputIt _Out, const iter_difference_t<_OutputIt> _Max, const wformat_string<_Types...> _Fmt, _Types&&... _Args) { _Fmt_iterator_buffer<_OutputIt, wchar_t, _Fmt_fixed_buffer_traits> _Buf(_STD move(_Out), _Max); @@ -3563,7 +3561,7 @@ format_to_n_result<_OutputIt> format_to_n( return {.out = _Buf._Out(), .size = _Buf._Count()}; } -template _OutputIt, class... _Types> +_EXPORT_STD template _OutputIt, class... _Types> format_to_n_result<_OutputIt> format_to_n(_OutputIt _Out, const iter_difference_t<_OutputIt> _Max, const locale& _Loc, const format_string<_Types...> _Fmt, _Types&&... _Args) { _Fmt_iterator_buffer<_OutputIt, char, _Fmt_fixed_buffer_traits> _Buf(_STD move(_Out), _Max); @@ -3571,7 +3569,7 @@ format_to_n_result<_OutputIt> format_to_n(_OutputIt _Out, const iter_difference_ return {.out = _Buf._Out(), .size = _Buf._Count()}; } -template _OutputIt, class... _Types> +_EXPORT_STD template _OutputIt, class... _Types> format_to_n_result<_OutputIt> format_to_n(_OutputIt _Out, const iter_difference_t<_OutputIt> _Max, const locale& _Loc, const wformat_string<_Types...> _Fmt, _Types&&... _Args) { _Fmt_iterator_buffer<_OutputIt, wchar_t, _Fmt_fixed_buffer_traits> _Buf(_STD move(_Out), _Max); @@ -3579,28 +3577,28 @@ format_to_n_result<_OutputIt> format_to_n(_OutputIt _Out, const iter_difference_ return {.out = _Buf._Out(), .size = _Buf._Count()}; } -template +_EXPORT_STD template _NODISCARD size_t formatted_size(const format_string<_Types...> _Fmt, _Types&&... _Args) { _Fmt_counting_buffer _Buf; _STD vformat_to(_Fmt_it{_Buf}, _Fmt.get(), _STD make_format_args(_Args...)); return _Buf._Count(); } -template +_EXPORT_STD template _NODISCARD size_t formatted_size(const wformat_string<_Types...> _Fmt, _Types&&... _Args) { _Fmt_counting_buffer _Buf; _STD vformat_to(_Fmt_wit{_Buf}, _Fmt.get(), _STD make_wformat_args(_Args...)); return _Buf._Count(); } -template +_EXPORT_STD template _NODISCARD size_t formatted_size(const locale& _Loc, const format_string<_Types...> _Fmt, _Types&&... _Args) { _Fmt_counting_buffer _Buf; _STD vformat_to(_Fmt_it{_Buf}, _Loc, _Fmt.get(), _STD make_format_args(_Args...)); return _Buf._Count(); } -template +_EXPORT_STD template _NODISCARD size_t formatted_size(const locale& _Loc, const wformat_string<_Types...> _Fmt, _Types&&... _Args) { _Fmt_counting_buffer _Buf; _STD vformat_to(_Fmt_wit{_Buf}, _Loc, _Fmt.get(), _STD make_wformat_args(_Args...)); diff --git a/stl/inc/forward_list b/stl/inc/forward_list index 3def6d663b..6c9417f393 100644 --- a/stl/inc/forward_list +++ b/stl/inc/forward_list @@ -507,7 +507,7 @@ private: pointer _Head; // Points at the first constructed node. }; -template > +_EXPORT_STD template > class forward_list { // singly linked list private: using _Alty = _Rebind_alloc_t<_Alloc, _Ty>; @@ -1561,12 +1561,12 @@ template <_RANGES input_range _Rng, class _Alloc = allocator<_RANGES range_value forward_list(from_range_t, _Rng&&, _Alloc = _Alloc()) -> forward_list<_RANGES range_value_t<_Rng>, _Alloc>; #endif // _HAS_CXX23 && defined(__cpp_lib_concepts) -template +_EXPORT_STD template void swap(forward_list<_Ty, _Alloc>& _Left, forward_list<_Ty, _Alloc>& _Right) noexcept /* strengthened */ { _Left.swap(_Right); } -template +_EXPORT_STD template _NODISCARD bool operator==(const forward_list<_Ty, _Alloc>& _Left, const forward_list<_Ty, _Alloc>& _Right) { return _STD equal( _Left._Unchecked_begin(), _Left._Unchecked_end_iter(), _Right._Unchecked_begin(), _Right._Unchecked_end_iter()); @@ -1580,7 +1580,7 @@ _NODISCARD bool operator!=(const forward_list<_Ty, _Alloc>& _Left, const forward #endif // !_HAS_CXX20 #ifdef __cpp_lib_concepts -template +_EXPORT_STD template _NODISCARD _Synth_three_way_result<_Ty> operator<=>( const forward_list<_Ty, _Alloc>& _Left, const forward_list<_Ty, _Alloc>& _Right) { return _STD lexicographical_compare_three_way(_Left._Unchecked_begin(), _Left._Unchecked_end_iter(), @@ -1610,12 +1610,12 @@ _NODISCARD bool operator>=(const forward_list<_Ty, _Alloc>& _Left, const forward #endif // ^^^ !defined(__cpp_lib_concepts) ^^^ #if _HAS_CXX20 -template +_EXPORT_STD template typename forward_list<_Ty, _Alloc>::size_type erase(forward_list<_Ty, _Alloc>& _Cont, const _Uty& _Val) { return _Cont.remove_if([&](_Ty& _Elem) { return _Elem == _Val; }); } -template +_EXPORT_STD template typename forward_list<_Ty, _Alloc>::size_type erase_if(forward_list<_Ty, _Alloc>& _Cont, _Pr _Pred) { return _Cont.remove_if(_Pass_fn(_Pred)); } @@ -1623,7 +1623,7 @@ typename forward_list<_Ty, _Alloc>::size_type erase_if(forward_list<_Ty, _Alloc> #if _HAS_CXX17 namespace pmr { - template + _EXPORT_STD template using forward_list = _STD forward_list<_Ty, polymorphic_allocator<_Ty>>; } // namespace pmr #endif // _HAS_CXX17 diff --git a/stl/inc/fstream b/stl/inc/fstream index e4fc17705e..07b85a4a23 100644 --- a/stl/inc/fstream +++ b/stl/inc/fstream @@ -26,7 +26,7 @@ _STL_DISABLE_CLANG_WARNINGS _STD_BEGIN #if _HAS_CXX17 namespace filesystem { - class path; + _EXPORT_STD class path; } #endif // _HAS_CXX17 @@ -60,11 +60,11 @@ _INLINE_VAR constexpr bool _Is_any_path = _Is_any_of_v<_Ty >; // clang-format on -_CRTIMP2_PURE FILE* __CLRCALL_PURE_OR_CDECL _Fiopen(const char*, ios_base::openmode, int); -_CRTIMP2_PURE FILE* __CLRCALL_PURE_OR_CDECL _Fiopen(const wchar_t*, ios_base::openmode, int); +extern "C++" _CRTIMP2_PURE FILE* __CLRCALL_PURE_OR_CDECL _Fiopen(const char*, ios_base::openmode, int); +extern "C++" _CRTIMP2_PURE FILE* __CLRCALL_PURE_OR_CDECL _Fiopen(const wchar_t*, ios_base::openmode, int); #ifdef _CRTBLD -_CRTIMP2_PURE FILE* __CLRCALL_PURE_OR_CDECL _Fiopen(const unsigned short*, ios_base::openmode, int); +extern "C++" _CRTIMP2_PURE FILE* __CLRCALL_PURE_OR_CDECL _Fiopen(const unsigned short*, ios_base::openmode, int); #endif // _CRTBLD template @@ -161,7 +161,7 @@ inline bool _Ungetc(const unsigned short& _Wchar, FILE* _File) { // put back an } #endif // _CRTBLD -template +_EXPORT_STD template class basic_filebuf : public basic_streambuf<_Elem, _Traits> { // stream buffer associated with a C stream public: using _Mysb = basic_streambuf<_Elem, _Traits>; @@ -797,12 +797,12 @@ private: _Elem* _Set_egptr; // saves egptr() }; -template +_EXPORT_STD template void swap(basic_filebuf<_Elem, _Traits>& _Left, basic_filebuf<_Elem, _Traits>& _Right) { _Left.swap(_Right); } -template +_EXPORT_STD template class basic_ifstream : public basic_istream<_Elem, _Traits> { // input stream associated with a C stream public: using _Mybase = basic_istream<_Elem, _Traits>; @@ -981,12 +981,12 @@ private: _Myfb _Filebuffer; }; -template +_EXPORT_STD template void swap(basic_ifstream<_Elem, _Traits>& _Left, basic_ifstream<_Elem, _Traits>& _Right) { _Left.swap(_Right); } -template +_EXPORT_STD template class basic_ofstream : public basic_ostream<_Elem, _Traits> { // output stream associated with a C stream public: using _Mybase = basic_ostream<_Elem, _Traits>; @@ -1164,12 +1164,12 @@ private: _Myfb _Filebuffer; }; -template +_EXPORT_STD template void swap(basic_ofstream<_Elem, _Traits>& _Left, basic_ofstream<_Elem, _Traits>& _Right) { _Left.swap(_Right); } -template +_EXPORT_STD template class basic_fstream : public basic_iostream<_Elem, _Traits> { // input/output stream associated with a C stream public: using _Mybase = basic_iostream<_Elem, _Traits>; @@ -1354,7 +1354,7 @@ private: _Myfb _Filebuffer; }; -template +_EXPORT_STD template void swap(basic_fstream<_Elem, _Traits>& _Left, basic_fstream<_Elem, _Traits>& _Right) { _Left.swap(_Right); } diff --git a/stl/inc/functional b/stl/inc/functional index 1ecd7fdb48..780d324a99 100644 --- a/stl/inc/functional +++ b/stl/inc/functional @@ -32,7 +32,7 @@ _STL_DISABLE_CLANG_WARNINGS _STD_BEGIN #if _HAS_CXX23 -template , int> = 0> _NODISCARD constexpr _Result_type invoke_r(_Callable&& _Obj, _Types&&... _Args) noexcept( is_nothrow_invocable_r_v<_Result_type, _Callable, _Types...>) { @@ -46,7 +46,7 @@ _NODISCARD constexpr _Result_type invoke_r(_Callable&& _Obj, _Types&&... _Args) // plus, minus, and multiplies are defined in -template +_EXPORT_STD template struct divides { using _FIRST_ARGUMENT_TYPE_NAME _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS = _Ty; using _SECOND_ARGUMENT_TYPE_NAME _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS = _Ty; @@ -57,7 +57,7 @@ struct divides { } }; -template +_EXPORT_STD template struct modulus { using _FIRST_ARGUMENT_TYPE_NAME _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS = _Ty; using _SECOND_ARGUMENT_TYPE_NAME _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS = _Ty; @@ -68,7 +68,7 @@ struct modulus { } }; -template +_EXPORT_STD template struct negate { using _ARGUMENT_TYPE_NAME _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS = _Ty; using _RESULT_TYPE_NAME _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS = _Ty; @@ -80,7 +80,7 @@ struct negate { // equal_to, not_equal_to, greater, less, greater_equal, and less_equal are defined in -template +_EXPORT_STD template struct logical_and { using _FIRST_ARGUMENT_TYPE_NAME _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS = _Ty; using _SECOND_ARGUMENT_TYPE_NAME _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS = _Ty; @@ -91,7 +91,7 @@ struct logical_and { } }; -template +_EXPORT_STD template struct logical_or { using _FIRST_ARGUMENT_TYPE_NAME _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS = _Ty; using _SECOND_ARGUMENT_TYPE_NAME _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS = _Ty; @@ -102,7 +102,7 @@ struct logical_or { } }; -template +_EXPORT_STD template struct logical_not { using _ARGUMENT_TYPE_NAME _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS = _Ty; using _RESULT_TYPE_NAME _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS = bool; @@ -112,7 +112,7 @@ struct logical_not { } }; -template +_EXPORT_STD template struct bit_and { using _FIRST_ARGUMENT_TYPE_NAME _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS = _Ty; using _SECOND_ARGUMENT_TYPE_NAME _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS = _Ty; @@ -123,7 +123,7 @@ struct bit_and { } }; -template +_EXPORT_STD template struct bit_or { using _FIRST_ARGUMENT_TYPE_NAME _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS = _Ty; using _SECOND_ARGUMENT_TYPE_NAME _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS = _Ty; @@ -134,7 +134,7 @@ struct bit_or { } }; -template +_EXPORT_STD template struct bit_xor { using _FIRST_ARGUMENT_TYPE_NAME _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS = _Ty; using _SECOND_ARGUMENT_TYPE_NAME _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS = _Ty; @@ -145,7 +145,7 @@ struct bit_xor { } }; -template +_EXPORT_STD template struct bit_not { using _ARGUMENT_TYPE_NAME _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS = _Ty; using _RESULT_TYPE_NAME _CXX17_DEPRECATE_ADAPTOR_TYPEDEFS = _Ty; @@ -268,7 +268,7 @@ struct bit_not { #if _HAS_DEPRECATED_NEGATORS _STL_DISABLE_DEPRECATED_WARNING -template +_EXPORT_STD template class _CXX17_DEPRECATE_NEGATORS unary_negate { public: using argument_type = typename _Fn::argument_type; @@ -284,12 +284,12 @@ private: _Fn _Functor; }; -template +_EXPORT_STD template _CXX17_DEPRECATE_NEGATORS _NODISCARD constexpr unary_negate<_Fn> not1(const _Fn& _Func) { return unary_negate<_Fn>(_Func); } -template +_EXPORT_STD template class _CXX17_DEPRECATE_NEGATORS binary_negate { public: using first_argument_type = typename _Fn::first_argument_type; @@ -306,7 +306,7 @@ private: _Fn _Functor; }; -template +_EXPORT_STD template _CXX17_DEPRECATE_NEGATORS _NODISCARD constexpr binary_negate<_Fn> not2(const _Fn& _Func) { return binary_negate<_Fn>(_Func); } @@ -315,7 +315,7 @@ _STL_RESTORE_DEPRECATED_WARNING #if _HAS_AUTO_PTR_ETC _STL_DISABLE_DEPRECATED_WARNING -template +_EXPORT_STD template class binder1st : public unary_function { // functor adapter _Func(stored, right) public: @@ -338,13 +338,13 @@ protected: typename _Fn::first_argument_type value; // the left operand }; -template +_EXPORT_STD template _NODISCARD binder1st<_Fn> bind1st(const _Fn& _Func, const _Ty& _Left) { typename _Fn::first_argument_type _Val(_Left); return binder1st<_Fn>(_Func, _Val); } -template +_EXPORT_STD template class binder2nd : public unary_function { // functor adapter _Func(left, stored) public: @@ -367,14 +367,14 @@ protected: typename _Fn::second_argument_type value; // the right operand }; -template +_EXPORT_STD template _NODISCARD binder2nd<_Fn> bind2nd(const _Fn& _Func, const _Ty& _Right) { typename _Fn::second_argument_type _Val(_Right); return binder2nd<_Fn>(_Func, _Val); } _STL_RESTORE_DEPRECATED_WARNING -template +_EXPORT_STD template class pointer_to_unary_function : public unary_function<_Arg, _Result> { // functor adapter (*pfunc)(left) public: explicit pointer_to_unary_function(_Fn _Left) : _Pfun(_Left) {} @@ -387,7 +387,7 @@ protected: _Fn _Pfun; // the function pointer }; -template +_EXPORT_STD template class pointer_to_binary_function : public binary_function<_Arg1, _Arg2, _Result> { // functor adapter (*pfunc)(left, right) public: @@ -402,12 +402,12 @@ protected: }; #define _PTR_FUN(CALL_OPT, X1, X2, X3) \ - template \ + _EXPORT_STD template \ _NODISCARD pointer_to_unary_function<_Arg, _Result, _Result(CALL_OPT*)(_Arg)> ptr_fun( \ _Result(CALL_OPT* _Left)(_Arg)) { \ return pointer_to_unary_function<_Arg, _Result, _Result(CALL_OPT*)(_Arg)>(_Left); \ } \ - template \ + _EXPORT_STD template \ _NODISCARD pointer_to_binary_function<_Arg1, _Arg2, _Result, _Result(CALL_OPT*)(_Arg1, _Arg2)> ptr_fun( \ _Result(CALL_OPT* _Left)(_Arg1, _Arg2)) { \ return pointer_to_binary_function<_Arg1, _Arg2, _Result, _Result(CALL_OPT*)(_Arg1, _Arg2)>(_Left); \ @@ -416,7 +416,7 @@ protected: _NON_MEMBER_CALL(_PTR_FUN, X1, X2, X3) #undef _PTR_FUN -template +_EXPORT_STD template class mem_fun_t : public unary_function<_Ty*, _Result> { // functor adapter (*p->*pfunc)(), non-const *pfunc public: explicit mem_fun_t(_Result (_Ty::*_Pm)()) : _Pmemfun(_Pm) {} @@ -429,7 +429,7 @@ private: _Result (_Ty::*_Pmemfun)(); // the member function pointer }; -template +_EXPORT_STD template class mem_fun1_t : public binary_function<_Ty*, _Arg, _Result> { // functor adapter (*p->*pfunc)(val), non-const *pfunc public: explicit mem_fun1_t(_Result (_Ty::*_Pm)(_Arg)) : _Pmemfun(_Pm) {} @@ -442,7 +442,7 @@ private: _Result (_Ty::*_Pmemfun)(_Arg); // the member function pointer }; -template +_EXPORT_STD template class const_mem_fun_t : public unary_function { // functor adapter (*p->*pfunc)(), const *pfunc public: explicit const_mem_fun_t(_Result (_Ty::*_Pm)() const) : _Pmemfun(_Pm) {} @@ -455,7 +455,7 @@ private: _Result (_Ty::*_Pmemfun)() const; // the member function pointer }; -template +_EXPORT_STD template class const_mem_fun1_t : public binary_function { // functor adapter (*p->*pfunc)(val), const *pfunc public: @@ -469,27 +469,27 @@ private: _Result (_Ty::*_Pmemfun)(_Arg) const; // the member function pointer }; -template +_EXPORT_STD template _NODISCARD mem_fun_t<_Result, _Ty> mem_fun(_Result (_Ty::*_Pm)()) { return mem_fun_t<_Result, _Ty>(_Pm); } -template +_EXPORT_STD template _NODISCARD mem_fun1_t<_Result, _Ty, _Arg> mem_fun(_Result (_Ty::*_Pm)(_Arg)) { return mem_fun1_t<_Result, _Ty, _Arg>(_Pm); } -template +_EXPORT_STD template _NODISCARD const_mem_fun_t<_Result, _Ty> mem_fun(_Result (_Ty::*_Pm)() const) { return const_mem_fun_t<_Result, _Ty>(_Pm); } -template +_EXPORT_STD template _NODISCARD const_mem_fun1_t<_Result, _Ty, _Arg> mem_fun(_Result (_Ty::*_Pm)(_Arg) const) { return const_mem_fun1_t<_Result, _Ty, _Arg>(_Pm); } -template +_EXPORT_STD template class mem_fun_ref_t : public unary_function<_Ty, _Result> { // functor adapter (*left.*pfunc)(), non-const *pfunc public: explicit mem_fun_ref_t(_Result (_Ty::*_Pm)()) : _Pmemfun(_Pm) {} @@ -502,7 +502,7 @@ private: _Result (_Ty::*_Pmemfun)(); // the member function pointer }; -template +_EXPORT_STD template class mem_fun1_ref_t : public binary_function<_Ty, _Arg, _Result> { // functor adapter (*left.*pfunc)(val), non-const *pfunc public: @@ -516,7 +516,7 @@ private: _Result (_Ty::*_Pmemfun)(_Arg); // the member function pointer }; -template +_EXPORT_STD template class const_mem_fun_ref_t : public unary_function<_Ty, _Result> { // functor adapter (*left.*pfunc)(), const *pfunc public: explicit const_mem_fun_ref_t(_Result (_Ty::*_Pm)() const) : _Pmemfun(_Pm) {} @@ -529,7 +529,7 @@ private: _Result (_Ty::*_Pmemfun)() const; // the member function pointer }; -template +_EXPORT_STD template class const_mem_fun1_ref_t : public binary_function<_Ty, _Arg, _Result> { // functor adapter (*left.*pfunc)(val), const *pfunc public: @@ -543,22 +543,22 @@ private: _Result (_Ty::*_Pmemfun)(_Arg) const; // the member function pointer }; -template +_EXPORT_STD template _NODISCARD mem_fun_ref_t<_Result, _Ty> mem_fun_ref(_Result (_Ty::*_Pm)()) { return mem_fun_ref_t<_Result, _Ty>(_Pm); } -template +_EXPORT_STD template _NODISCARD mem_fun1_ref_t<_Result, _Ty, _Arg> mem_fun_ref(_Result (_Ty::*_Pm)(_Arg)) { return mem_fun1_ref_t<_Result, _Ty, _Arg>(_Pm); } -template +_EXPORT_STD template _NODISCARD const_mem_fun_ref_t<_Result, _Ty> mem_fun_ref(_Result (_Ty::*_Pm)() const) { return const_mem_fun_ref_t<_Result, _Ty>(_Pm); } -template +_EXPORT_STD template _NODISCARD const_mem_fun1_ref_t<_Result, _Ty, _Arg> mem_fun_ref(_Result (_Ty::*_Pm)(_Arg) const) { return const_mem_fun1_ref_t<_Result, _Ty, _Arg>(_Pm); } @@ -580,7 +580,7 @@ public: } }; -template +_EXPORT_STD template _NODISCARD _CONSTEXPR20 _Mem_fn<_Rx _Ty::*> mem_fn(_Rx _Ty::*_Pm) noexcept { return _Mem_fn<_Rx _Ty::*>(_Pm); } @@ -633,7 +633,7 @@ public: } }; -template +_EXPORT_STD template _NODISCARD _CONSTEXPR20 _Not_fn> not_fn(_Callable&& _Obj) noexcept( is_nothrow_constructible_v, _Callable>) /* strengthened */ { // wrap a callable object to be negated @@ -641,7 +641,7 @@ _NODISCARD _CONSTEXPR20 _Not_fn> not_fn(_Callable&& _Obj) noe } #endif // _HAS_CXX17 -class bad_function_call : public exception { // exception thrown when an empty std::function is called +_EXPORT_STD class bad_function_call : public exception { // exception thrown when an empty std::function is called public: bad_function_call() noexcept {} @@ -651,7 +651,7 @@ public: } }; -[[noreturn]] _CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL _Xbad_function_call(); +extern "C++" [[noreturn]] _CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL _Xbad_function_call(); struct _Unforced { // tag to distinguish bind() from bind() explicit _Unforced() = default; @@ -684,7 +684,7 @@ struct _Invoker_ret<_Unforced> { // selected for _Rx being _Unforced } }; -template +_EXPORT_STD template class function; template @@ -1024,7 +1024,7 @@ _NON_MEMBER_CALL(_GET_FUNCTION_IMPL_NOEXCEPT, X1, X2, X3) #undef _GET_FUNCTION_IMPL_NOEXCEPT #endif // __cpp_noexcept_function_type -template +_EXPORT_STD template class function : public _Get_function_impl<_Fty>::type { // wrapper for callable objects private: using _Mybase = typename _Get_function_impl<_Fty>::type; @@ -1162,12 +1162,12 @@ template function(_Fx) -> function::type>; #endif // _HAS_CXX17 -template +_EXPORT_STD template void swap(function<_Fty>& _Left, function<_Fty>& _Right) noexcept { _Left.swap(_Right); } -template +_EXPORT_STD template _NODISCARD bool operator==(const function<_Fty>& _Other, nullptr_t) noexcept { return !_Other; } @@ -1747,7 +1747,7 @@ public: }; #endif // __cpp_noexcept_function_type -template +_EXPORT_STD template class move_only_function : private _Move_only_function_call<_Signature...> { private: using _Call = _Move_only_function_call<_Signature...>; @@ -1868,7 +1868,7 @@ struct _Ph { // placeholder static_assert(_Nx > 0, "invalid placeholder index"); }; -template +_EXPORT_STD template struct is_placeholder : integral_constant {}; // _Tx is not a placeholder template @@ -1883,13 +1883,13 @@ struct is_placeholder : is_placeholder<_Tx>::type {}; // ignore cv template struct is_placeholder : is_placeholder<_Tx>::type {}; // ignore cv-qualifiers -template +_EXPORT_STD template _INLINE_VAR constexpr int is_placeholder_v = is_placeholder<_Ty>::value; template class _Binder; -template +_EXPORT_STD template struct is_bind_expression : false_type {}; // _Tx is not a bind expression template @@ -1904,7 +1904,7 @@ struct is_bind_expression : is_bind_expression<_Tx>::type {}; // i template struct is_bind_expression : is_bind_expression<_Tx>::type {}; // ignore cv-qualifiers -template +_EXPORT_STD template _INLINE_VAR constexpr bool is_bind_expression_v = is_bind_expression<_Ty>::value; template , reference_wrapper>, @@ -2020,37 +2020,37 @@ public: #undef _CALL_BINDER }; -template +_EXPORT_STD template _NODISCARD _CONSTEXPR20 _Binder<_Unforced, _Fx, _Types...> bind(_Fx&& _Func, _Types&&... _Args) { return _Binder<_Unforced, _Fx, _Types...>(_STD forward<_Fx>(_Func), _STD forward<_Types>(_Args)...); } -template +_EXPORT_STD template _NODISCARD _CONSTEXPR20 _Binder<_Ret, _Fx, _Types...> bind(_Fx&& _Func, _Types&&... _Args) { return _Binder<_Ret, _Fx, _Types...>(_STD forward<_Fx>(_Func), _STD forward<_Types>(_Args)...); } namespace placeholders { - _INLINE_VAR constexpr _Ph<1> _1{}; - _INLINE_VAR constexpr _Ph<2> _2{}; - _INLINE_VAR constexpr _Ph<3> _3{}; - _INLINE_VAR constexpr _Ph<4> _4{}; - _INLINE_VAR constexpr _Ph<5> _5{}; - _INLINE_VAR constexpr _Ph<6> _6{}; - _INLINE_VAR constexpr _Ph<7> _7{}; - _INLINE_VAR constexpr _Ph<8> _8{}; - _INLINE_VAR constexpr _Ph<9> _9{}; - _INLINE_VAR constexpr _Ph<10> _10{}; - _INLINE_VAR constexpr _Ph<11> _11{}; - _INLINE_VAR constexpr _Ph<12> _12{}; - _INLINE_VAR constexpr _Ph<13> _13{}; - _INLINE_VAR constexpr _Ph<14> _14{}; - _INLINE_VAR constexpr _Ph<15> _15{}; - _INLINE_VAR constexpr _Ph<16> _16{}; - _INLINE_VAR constexpr _Ph<17> _17{}; - _INLINE_VAR constexpr _Ph<18> _18{}; - _INLINE_VAR constexpr _Ph<19> _19{}; - _INLINE_VAR constexpr _Ph<20> _20{}; + _EXPORT_STD _INLINE_VAR constexpr _Ph<1> _1{}; + _EXPORT_STD _INLINE_VAR constexpr _Ph<2> _2{}; + _EXPORT_STD _INLINE_VAR constexpr _Ph<3> _3{}; + _EXPORT_STD _INLINE_VAR constexpr _Ph<4> _4{}; + _EXPORT_STD _INLINE_VAR constexpr _Ph<5> _5{}; + _EXPORT_STD _INLINE_VAR constexpr _Ph<6> _6{}; + _EXPORT_STD _INLINE_VAR constexpr _Ph<7> _7{}; + _EXPORT_STD _INLINE_VAR constexpr _Ph<8> _8{}; + _EXPORT_STD _INLINE_VAR constexpr _Ph<9> _9{}; + _EXPORT_STD _INLINE_VAR constexpr _Ph<10> _10{}; + _EXPORT_STD _INLINE_VAR constexpr _Ph<11> _11{}; + _EXPORT_STD _INLINE_VAR constexpr _Ph<12> _12{}; + _EXPORT_STD _INLINE_VAR constexpr _Ph<13> _13{}; + _EXPORT_STD _INLINE_VAR constexpr _Ph<14> _14{}; + _EXPORT_STD _INLINE_VAR constexpr _Ph<15> _15{}; + _EXPORT_STD _INLINE_VAR constexpr _Ph<16> _16{}; + _EXPORT_STD _INLINE_VAR constexpr _Ph<17> _17{}; + _EXPORT_STD _INLINE_VAR constexpr _Ph<18> _18{}; + _EXPORT_STD _INLINE_VAR constexpr _Ph<19> _19{}; + _EXPORT_STD _INLINE_VAR constexpr _Ph<20> _20{}; } // namespace placeholders #if _HAS_CXX20 @@ -2115,7 +2115,7 @@ public: } }; -template +_EXPORT_STD template _NODISCARD constexpr auto bind_front(_Fx&& _Func, _Types&&... _Args) { static_assert(is_constructible_v, _Fx>, "std::bind_front requires the decayed callable to be constructible from an undecayed callable"); @@ -2192,7 +2192,7 @@ public: } }; -template +_EXPORT_STD template _NODISCARD constexpr auto bind_back(_Fx&& _Func, _Types&&... _Args) { static_assert(is_constructible_v, _Fx>, "std::bind_back requires the decayed callable to be constructible from an undecayed callable"); @@ -2298,7 +2298,7 @@ _CONSTEXPR20 pair<_FwdItHaystack, _FwdItHaystack> _Search_pair_unchecked( } } -template > +_EXPORT_STD template > class default_searcher { // functor to search haystacks for needles public: _CONSTEXPR20 default_searcher(_FwdItPat _First, _FwdItPat _Last, _Pred_eq _Eq = _Pred_eq()) @@ -2781,7 +2781,7 @@ using _Boyer_moore_traits = _Boyer_moore_traits_general_mode<_RanItPat, _Hash_ty, _Pred_eq>>; -template >, class _Pred_eq = equal_to<>> +_EXPORT_STD template >, class _Pred_eq = equal_to<>> class boyer_moore_searcher { public: boyer_moore_searcher( @@ -2820,7 +2820,7 @@ private: }; -template >, class _Pred_eq = equal_to<>> +_EXPORT_STD template >, class _Pred_eq = equal_to<>> class boyer_moore_horspool_searcher { // equivalent to Boyer-Moore without the second table public: boyer_moore_horspool_searcher( @@ -2861,7 +2861,7 @@ private: #ifdef __cpp_lib_concepts namespace ranges { - struct not_equal_to { + _EXPORT_STD struct not_equal_to { // clang-format off template requires equality_comparable_with<_Ty1, _Ty2> @@ -2874,7 +2874,7 @@ namespace ranges { using is_transparent = int; }; - struct greater_equal { + _EXPORT_STD struct greater_equal { // clang-format off template requires totally_ordered_with<_Ty1, _Ty2> @@ -2887,7 +2887,7 @@ namespace ranges { using is_transparent = int; }; - struct less_equal { + _EXPORT_STD struct less_equal { // clang-format off template requires totally_ordered_with<_Ty1, _Ty2> diff --git a/stl/inc/future b/stl/inc/future index 8e3f4be8da..031384331a 100644 --- a/stl/inc/future +++ b/stl/inc/future @@ -60,21 +60,21 @@ _NODISCARD _Unique_ptr_alloc<_Alloc> _Make_unique_alloc(_Alloc& _Al, _Args&&... struct _Nil {}; // empty struct, for unused argument types -enum class future_errc { // names for futures errors +_EXPORT_STD enum class future_errc { // names for futures errors broken_promise = 1, future_already_retrieved, promise_already_satisfied, no_state }; -enum class launch { // names for launch options passed to async +_EXPORT_STD enum class launch { // names for launch options passed to async async = 0x1, deferred = 0x2 }; -_BITMASK_OPS(launch) +_BITMASK_OPS(_EXPORT_STD, launch) -enum class future_status { // names for timed wait function returns +_EXPORT_STD enum class future_status { // names for timed wait function returns ready, timeout, deferred @@ -83,13 +83,13 @@ enum class future_status { // names for timed wait function returns template <> struct is_error_code_enum : true_type {}; -_NODISCARD const error_category& future_category() noexcept; +_EXPORT_STD _NODISCARD const error_category& future_category() noexcept; -_NODISCARD inline error_code make_error_code(future_errc _Ec) noexcept { +_EXPORT_STD _NODISCARD inline error_code make_error_code(future_errc _Ec) noexcept { return error_code(static_cast(_Ec), _STD future_category()); } -_NODISCARD inline error_condition make_error_condition(future_errc _Ec) noexcept { +_EXPORT_STD _NODISCARD inline error_condition make_error_condition(future_errc _Ec) noexcept { return error_condition(static_cast(_Ec), _STD future_category()); } @@ -112,7 +112,7 @@ _NODISCARD inline const char* _Future_error_map(int _Errcode) noexcept { // conv } } -class future_error : public logic_error { // future exception +_EXPORT_STD class future_error : public logic_error { // future exception public: explicit future_error(error_code _Errcode) // internal, TRANSITION, will be removed : logic_error(""), _Mycode(_Errcode) {} @@ -161,7 +161,7 @@ public: } }; -_NODISCARD inline const error_category& future_category() noexcept { +_EXPORT_STD _NODISCARD inline const error_category& future_category() noexcept { return _Immortalize_memcpy_image<_Future_error_category2>(); } @@ -880,10 +880,10 @@ private: bool _Get_only_once; }; -template +_EXPORT_STD template class shared_future; -template +_EXPORT_STD template class future : public _State_manager<_Ty> { // class that defines a non-copyable asynchronous return object that holds a value private: @@ -986,7 +986,7 @@ public: future& operator=(const future&) = delete; }; -template +_EXPORT_STD template class shared_future : public _State_manager<_Ty> { // class that defines a copyable asynchronous return object that holds a value private: @@ -1159,7 +1159,7 @@ private: bool _Future_retrieved; }; -template +_EXPORT_STD template class promise { // class that defines an asynchronous provider that holds a value public: static_assert(!is_array_v<_Ty> && is_object_v<_Ty> && is_destructible_v<_Ty>, @@ -1335,7 +1335,7 @@ private: template struct uses_allocator, _Alloc> : true_type {}; -template +_EXPORT_STD template void swap(promise<_Ty>& _Left, promise<_Ty>& _Right) noexcept { _Left.swap(_Right); } @@ -1355,7 +1355,7 @@ struct _P_arg_type { // type for functions returning void using type = int; }; -template +_EXPORT_STD template class packaged_task; // not defined template @@ -1458,7 +1458,7 @@ template struct uses_allocator, _Alloc> : true_type {}; #endif // _HAS_FUNCTION_ALLOCATOR_SUPPORT -template +_EXPORT_STD template void swap(packaged_task<_Ty>& _Left, packaged_task<_Ty>& _Right) noexcept { _Left.swap(_Right); } @@ -1518,7 +1518,7 @@ _Associated_state::type>* _Get_associated_state(launc } } -template +_EXPORT_STD template _NODISCARD_ASYNC future<_Invoke_result_t, decay_t<_ArgTypes>...>> async( launch _Policy, _Fty&& _Fnarg, _ArgTypes&&... _Args) { // manages a callable object launched with supplied policy @@ -1531,7 +1531,7 @@ _NODISCARD_ASYNC future<_Invoke_result_t, decay_t<_ArgTypes>...>> return future<_Ret>(_Pr._Get_state_for_future(), _Nil{}); } -template +_EXPORT_STD template _NODISCARD_ASYNC future<_Invoke_result_t, decay_t<_ArgTypes>...>> async( _Fty&& _Fnarg, _ArgTypes&&... _Args) { // manages a callable object launched with default policy diff --git a/stl/inc/initializer_list b/stl/inc/initializer_list index 2714f3d378..8fe7b121e5 100644 --- a/stl/inc/initializer_list +++ b/stl/inc/initializer_list @@ -18,7 +18,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new _STD_BEGIN -template +_EXPORT_STD template class initializer_list { public: using value_type = _Elem; @@ -51,12 +51,12 @@ private: const _Elem* _Last; }; -template +_EXPORT_STD template _NODISCARD constexpr const _Elem* begin(initializer_list<_Elem> _Ilist) noexcept { return _Ilist.begin(); } -template +_EXPORT_STD template _NODISCARD constexpr const _Elem* end(initializer_list<_Elem> _Ilist) noexcept { return _Ilist.end(); } diff --git a/stl/inc/iomanip b/stl/inc/iomanip index 711b792bd7..60a049221a 100644 --- a/stl/inc/iomanip +++ b/stl/inc/iomanip @@ -46,7 +46,7 @@ struct _Fillobj { // store fill character _Elem _Fill; // the fill character }; -template +_EXPORT_STD template _NODISCARD _Fillobj<_Elem> setfill(_Elem _Ch) { return _Fillobj<_Elem>(_Ch); } @@ -103,12 +103,12 @@ struct _Monobj { // store reference to monetary amount bool _Intl; // international flag }; -template +_EXPORT_STD template _NODISCARD _Monobj<_Money> get_money(_Money& _Val_arg, bool _Intl_arg = false) { return _Monobj<_Money>(_Val_arg, _Intl_arg); } -template +_EXPORT_STD template _NODISCARD _Monobj put_money(const _Money& _Val_arg, bool _Intl_arg = false) { return _Monobj(_Val_arg, _Intl_arg); } @@ -174,12 +174,12 @@ struct _Timeobj { // store reference to tm object and format const _Elem* _Fmtlast; // format string end }; -template +_EXPORT_STD template _NODISCARD _Timeobj<_Elem, tm*> get_time(tm* _Tptr_arg, const _Elem* _Fmt_arg) { return _Timeobj<_Elem, tm*>(_Tptr_arg, _Fmt_arg); } -template +_EXPORT_STD template _NODISCARD _Timeobj<_Elem, const tm*> put_time(const tm* _Tptr_arg, const _Elem* _Fmt_arg) { return _Timeobj<_Elem, const tm*>(_Tptr_arg, _Fmt_arg); } @@ -352,28 +352,28 @@ struct _Quote_in { // store reference to string _Elem _Escape; // escape element }; -template +_EXPORT_STD template _NODISCARD _Quote_out<_Elem, void, size_t> quoted( const _Elem* _Ptr, _Elem _Delim = _Elem('"'), _Elem _Escape = _Elem('\\')) { const size_t _Size = char_traits<_Elem>::length(_Ptr); return {_Ptr, _Size, _Delim, _Escape}; } -template +_EXPORT_STD template _NODISCARD _Quote_out<_Elem, _Traits, typename basic_string<_Elem, _Traits, _Alloc>::size_type> quoted( const basic_string<_Elem, _Traits, _Alloc>& _Str, _Elem _Delim = _Elem('"'), _Elem _Escape = _Elem('\\')) { return {_Str.c_str(), _Str.size(), _Delim, _Escape}; } #if _HAS_CXX17 -template +_EXPORT_STD template _NODISCARD _Quote_out<_Elem, _Traits, size_t> quoted( const basic_string_view<_Elem, _Traits> _Str, _Elem _Delim = _Elem('"'), _Elem _Escape = _Elem('\\')) { return {_Str.data(), _Str.size(), _Delim, _Escape}; } #endif // _HAS_CXX17 -template +_EXPORT_STD template _NODISCARD _Quote_in<_Elem, _Traits, _Alloc> quoted( basic_string<_Elem, _Traits, _Alloc>& _Str, _Elem _Delim = _Elem('"'), _Elem _Escape = _Elem('\\')) { return {_Str, _Delim, _Escape}; @@ -401,11 +401,11 @@ struct _Smanip { // store function pointer and argument value _Arg _Manarg; // the argument value }; -_NODISCARD _MRTIMP2 _Smanip __cdecl resetiosflags(ios_base::fmtflags); -_NODISCARD _MRTIMP2 _Smanip __cdecl setiosflags(ios_base::fmtflags); -_NODISCARD _MRTIMP2 _Smanip __cdecl setbase(int); -_NODISCARD _MRTIMP2 _Smanip __cdecl setprecision(streamsize); -_NODISCARD _MRTIMP2 _Smanip __cdecl setw(streamsize); +_EXPORT_STD extern "C++" _NODISCARD _MRTIMP2 _Smanip __cdecl resetiosflags(ios_base::fmtflags); +_EXPORT_STD extern "C++" _NODISCARD _MRTIMP2 _Smanip __cdecl setiosflags(ios_base::fmtflags); +_EXPORT_STD extern "C++" _NODISCARD _MRTIMP2 _Smanip __cdecl setbase(int); +_EXPORT_STD extern "C++" _NODISCARD _MRTIMP2 _Smanip __cdecl setprecision(streamsize); +_EXPORT_STD extern "C++" _NODISCARD _MRTIMP2 _Smanip __cdecl setw(streamsize); _STD_END #pragma pop_macro("new") _STL_RESTORE_CLANG_WARNINGS diff --git a/stl/inc/ios b/stl/inc/ios index 3fdfc02c1f..319a26c3d9 100644 --- a/stl/inc/ios +++ b/stl/inc/ios @@ -18,7 +18,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new _STD_BEGIN -template +_EXPORT_STD extern "C++" template class basic_ios : public ios_base { // base class for basic_istream/basic_ostream public: using _Myos = basic_ostream<_Elem, _Traits>; @@ -181,122 +181,122 @@ template class _CRTIMP2_PURE_IMPORT basic_ios -using streamoff = long long; -using streamsize = long long; +_EXPORT_STD using streamoff = long long; +_EXPORT_STD using streamsize = long long; -template +_EXPORT_STD template class fpos { // store arbitrary file position public: /* implicit */ fpos(streamoff _Off = 0) : _Myoff(_Off), _Fpos(0), _Mystate() {} @@ -134,19 +134,19 @@ private: _Statetype _Mystate; // current conversion state }; -using streampos = fpos<_Mbstatet>; -using wstreampos = streampos; +_EXPORT_STD using streampos = fpos<_Mbstatet>; +_EXPORT_STD using wstreampos = streampos; #ifdef __cpp_lib_char8_t -using u8streampos = streampos; +_EXPORT_STD using u8streampos = streampos; #endif // __cpp_lib_char8_t -using u16streampos = streampos; -using u32streampos = streampos; +_EXPORT_STD using u16streampos = streampos; +_EXPORT_STD using u32streampos = streampos; -class locale; -template +_EXPORT_STD extern "C++" class locale; +_EXPORT_STD template const _Facet& __CRTDECL use_facet(const locale&); -template +_EXPORT_STD template struct char_traits; template <> struct char_traits; @@ -165,117 +165,117 @@ template <> struct char_traits; #endif // _CRTBLD -template +_EXPORT_STD template class allocator; -class ios_base; -template > +_EXPORT_STD extern "C++" class ios_base; +_EXPORT_STD extern "C++" template > class basic_ios; -template > +_EXPORT_STD template > class istreambuf_iterator; -template > +_EXPORT_STD template > class ostreambuf_iterator; -template > +_EXPORT_STD extern "C++" template > class basic_streambuf; #pragma vtordisp(push, 2) // compiler bug workaround -template > +_EXPORT_STD extern "C++" template > class basic_istream; -template > +_EXPORT_STD extern "C++" template > class basic_ostream; #pragma vtordisp(pop) // compiler bug workaround -template > +_EXPORT_STD extern "C++" template > class basic_iostream; -template , class _Alloc = allocator<_Elem>> +_EXPORT_STD template , class _Alloc = allocator<_Elem>> class basic_stringbuf; -template , class _Alloc = allocator<_Elem>> +_EXPORT_STD template , class _Alloc = allocator<_Elem>> class basic_istringstream; -template , class _Alloc = allocator<_Elem>> +_EXPORT_STD template , class _Alloc = allocator<_Elem>> class basic_ostringstream; -template , class _Alloc = allocator<_Elem>> +_EXPORT_STD template , class _Alloc = allocator<_Elem>> class basic_stringstream; #if _HAS_CXX23 -template > +_EXPORT_STD template > class basic_spanbuf; -template > +_EXPORT_STD template > class basic_ispanstream; -template > +_EXPORT_STD template > class basic_ospanstream; -template > +_EXPORT_STD template > class basic_spanstream; #endif // _HAS_CXX23 -template > +_EXPORT_STD template > class basic_filebuf; -template > +_EXPORT_STD template > class basic_ifstream; -template > +_EXPORT_STD template > class basic_ofstream; -template > +_EXPORT_STD template > class basic_fstream; #if _HAS_CXX20 template > class _Basic_syncbuf_impl; -template , class _Alloc = allocator<_Elem>> +_EXPORT_STD template , class _Alloc = allocator<_Elem>> class basic_syncbuf; -template , class _Alloc = allocator<_Elem>> +_EXPORT_STD template , class _Alloc = allocator<_Elem>> class basic_osyncstream; #endif // _HAS_CXX20 #if defined(_DLL_CPPLIB) -template +_EXPORT_STD extern "C++" template class num_get; -template +_EXPORT_STD extern "C++" template class num_put; -template +_EXPORT_STD template class collate; #endif // defined(_DLL_CPPLIB) -using ios = basic_ios>; -using streambuf = basic_streambuf>; -using istream = basic_istream>; -using ostream = basic_ostream>; -using iostream = basic_iostream>; -using stringbuf = basic_stringbuf, allocator>; -using istringstream = basic_istringstream, allocator>; -using ostringstream = basic_ostringstream, allocator>; -using stringstream = basic_stringstream, allocator>; -using filebuf = basic_filebuf>; -using ifstream = basic_ifstream>; -using ofstream = basic_ofstream>; -using fstream = basic_fstream>; +_EXPORT_STD using ios = basic_ios>; +_EXPORT_STD using streambuf = basic_streambuf>; +_EXPORT_STD using istream = basic_istream>; +_EXPORT_STD using ostream = basic_ostream>; +_EXPORT_STD using iostream = basic_iostream>; +_EXPORT_STD using stringbuf = basic_stringbuf, allocator>; +_EXPORT_STD using istringstream = basic_istringstream, allocator>; +_EXPORT_STD using ostringstream = basic_ostringstream, allocator>; +_EXPORT_STD using stringstream = basic_stringstream, allocator>; +_EXPORT_STD using filebuf = basic_filebuf>; +_EXPORT_STD using ifstream = basic_ifstream>; +_EXPORT_STD using ofstream = basic_ofstream>; +_EXPORT_STD using fstream = basic_fstream>; #if _HAS_CXX20 -using syncbuf = basic_syncbuf; -using osyncstream = basic_osyncstream; +_EXPORT_STD using syncbuf = basic_syncbuf; +_EXPORT_STD using osyncstream = basic_osyncstream; #endif // _HAS_CXX20 #if _HAS_CXX23 -using spanbuf = basic_spanbuf; -using ispanstream = basic_ispanstream; -using ospanstream = basic_ospanstream; -using spanstream = basic_spanstream; +_EXPORT_STD using spanbuf = basic_spanbuf; +_EXPORT_STD using ispanstream = basic_ispanstream; +_EXPORT_STD using ospanstream = basic_ospanstream; +_EXPORT_STD using spanstream = basic_spanstream; #endif // _HAS_CXX23 -using wios = basic_ios>; -using wstreambuf = basic_streambuf>; -using wistream = basic_istream>; -using wostream = basic_ostream>; -using wiostream = basic_iostream>; -using wstringbuf = basic_stringbuf, allocator>; -using wistringstream = basic_istringstream, allocator>; -using wostringstream = basic_ostringstream, allocator>; -using wstringstream = basic_stringstream, allocator>; -using wfilebuf = basic_filebuf>; -using wifstream = basic_ifstream>; -using wofstream = basic_ofstream>; -using wfstream = basic_fstream>; +_EXPORT_STD using wios = basic_ios>; +_EXPORT_STD using wstreambuf = basic_streambuf>; +_EXPORT_STD using wistream = basic_istream>; +_EXPORT_STD using wostream = basic_ostream>; +_EXPORT_STD using wiostream = basic_iostream>; +_EXPORT_STD using wstringbuf = basic_stringbuf, allocator>; +_EXPORT_STD using wistringstream = basic_istringstream, allocator>; +_EXPORT_STD using wostringstream = basic_ostringstream, allocator>; +_EXPORT_STD using wstringstream = basic_stringstream, allocator>; +_EXPORT_STD using wfilebuf = basic_filebuf>; +_EXPORT_STD using wifstream = basic_ifstream>; +_EXPORT_STD using wofstream = basic_ofstream>; +_EXPORT_STD using wfstream = basic_fstream>; #if _HAS_CXX20 -using wsyncbuf = basic_syncbuf; -using wosyncstream = basic_osyncstream; +_EXPORT_STD using wsyncbuf = basic_syncbuf; +_EXPORT_STD using wosyncstream = basic_osyncstream; #endif // _HAS_CXX20 #if _HAS_CXX23 -using wspanbuf = basic_spanbuf; -using wispanstream = basic_ispanstream; -using wospanstream = basic_ospanstream; -using wspanstream = basic_spanstream; +_EXPORT_STD using wspanbuf = basic_spanbuf; +_EXPORT_STD using wispanstream = basic_ispanstream; +_EXPORT_STD using wospanstream = basic_ospanstream; +_EXPORT_STD using wspanstream = basic_spanstream; #endif // _HAS_CXX23 _STD_END diff --git a/stl/inc/iostream b/stl/inc/iostream index 04da464dd0..efa221eb4f 100644 --- a/stl/inc/iostream +++ b/stl/inc/iostream @@ -36,23 +36,23 @@ __PURE_APPDOMAIN_GLOBAL extern wostream* _Ptr_wcout; __PURE_APPDOMAIN_GLOBAL extern wostream* _Ptr_wcerr; __PURE_APPDOMAIN_GLOBAL extern wostream* _Ptr_wclog; #else // _M_CEE_PURE -__PURE_APPDOMAIN_GLOBAL extern _CRTDATA2_IMPORT istream cin; -__PURE_APPDOMAIN_GLOBAL extern _CRTDATA2_IMPORT ostream cout; -__PURE_APPDOMAIN_GLOBAL extern _CRTDATA2_IMPORT ostream cerr; -__PURE_APPDOMAIN_GLOBAL extern _CRTDATA2_IMPORT ostream clog; -__PURE_APPDOMAIN_GLOBAL extern _CRTDATA2_IMPORT istream* _Ptr_cin; -__PURE_APPDOMAIN_GLOBAL extern _CRTDATA2_IMPORT ostream* _Ptr_cout; -__PURE_APPDOMAIN_GLOBAL extern _CRTDATA2_IMPORT ostream* _Ptr_cerr; -__PURE_APPDOMAIN_GLOBAL extern _CRTDATA2_IMPORT ostream* _Ptr_clog; +_EXPORT_STD extern "C++" __PURE_APPDOMAIN_GLOBAL _CRTDATA2_IMPORT istream cin; +_EXPORT_STD extern "C++" __PURE_APPDOMAIN_GLOBAL _CRTDATA2_IMPORT ostream cout; +_EXPORT_STD extern "C++" __PURE_APPDOMAIN_GLOBAL _CRTDATA2_IMPORT ostream cerr; +_EXPORT_STD extern "C++" __PURE_APPDOMAIN_GLOBAL _CRTDATA2_IMPORT ostream clog; +extern "C++" __PURE_APPDOMAIN_GLOBAL _CRTDATA2_IMPORT istream* _Ptr_cin; +extern "C++" __PURE_APPDOMAIN_GLOBAL _CRTDATA2_IMPORT ostream* _Ptr_cout; +extern "C++" __PURE_APPDOMAIN_GLOBAL _CRTDATA2_IMPORT ostream* _Ptr_cerr; +extern "C++" __PURE_APPDOMAIN_GLOBAL _CRTDATA2_IMPORT ostream* _Ptr_clog; -__PURE_APPDOMAIN_GLOBAL extern _CRTDATA2_IMPORT wistream wcin; -__PURE_APPDOMAIN_GLOBAL extern _CRTDATA2_IMPORT wostream wcout; -__PURE_APPDOMAIN_GLOBAL extern _CRTDATA2_IMPORT wostream wcerr; -__PURE_APPDOMAIN_GLOBAL extern _CRTDATA2_IMPORT wostream wclog; -__PURE_APPDOMAIN_GLOBAL extern _CRTDATA2_IMPORT wistream* _Ptr_wcin; -__PURE_APPDOMAIN_GLOBAL extern _CRTDATA2_IMPORT wostream* _Ptr_wcout; -__PURE_APPDOMAIN_GLOBAL extern _CRTDATA2_IMPORT wostream* _Ptr_wcerr; -__PURE_APPDOMAIN_GLOBAL extern _CRTDATA2_IMPORT wostream* _Ptr_wclog; +_EXPORT_STD extern "C++" __PURE_APPDOMAIN_GLOBAL _CRTDATA2_IMPORT wistream wcin; +_EXPORT_STD extern "C++" __PURE_APPDOMAIN_GLOBAL _CRTDATA2_IMPORT wostream wcout; +_EXPORT_STD extern "C++" __PURE_APPDOMAIN_GLOBAL _CRTDATA2_IMPORT wostream wcerr; +_EXPORT_STD extern "C++" __PURE_APPDOMAIN_GLOBAL _CRTDATA2_IMPORT wostream wclog; +extern "C++" __PURE_APPDOMAIN_GLOBAL _CRTDATA2_IMPORT wistream* _Ptr_wcin; +extern "C++" __PURE_APPDOMAIN_GLOBAL _CRTDATA2_IMPORT wostream* _Ptr_wcout; +extern "C++" __PURE_APPDOMAIN_GLOBAL _CRTDATA2_IMPORT wostream* _Ptr_wcerr; +extern "C++" __PURE_APPDOMAIN_GLOBAL _CRTDATA2_IMPORT wostream* _Ptr_wclog; #ifdef _CRTBLD // TRANSITION, ABI: _Winit appears to be unused class _CRTIMP2_PURE_IMPORT _Winit { diff --git a/stl/inc/istream b/stl/inc/istream index fd7f0caaab..c976a77089 100644 --- a/stl/inc/istream +++ b/stl/inc/istream @@ -20,7 +20,7 @@ _STL_DISABLE_CLANG_WARNINGS _STD_BEGIN #pragma vtordisp(push, 2) // compiler bug workaround -template +_EXPORT_STD extern "C++" template class basic_istream : virtual public basic_ios<_Elem, _Traits> { // control extractions from a stream buffer public: using _Myios = basic_ios<_Elem, _Traits>; @@ -721,7 +721,7 @@ template class _CRTIMP2_PURE_IMPORT basic_istream +_EXPORT_STD extern "C++" template class basic_iostream : public basic_istream<_Elem, _Traits>, public basic_ostream<_Elem, _Traits> { // control insertions and extractions from a stream buffer public: @@ -820,19 +820,19 @@ basic_istream<_Elem, _Traits>& _Istream_extract_into_buffer( #if _HAS_CXX20 // P0487R1 Fixing operator>>(basic_istream&, CharT*) #pragma warning(push) #pragma warning(disable : 6001) // Using uninitialized memory '_Str'. -template +_EXPORT_STD template basic_istream<_Elem, _Traits>& operator>>( basic_istream<_Elem, _Traits>& _Istr, _Out_writes_z_(_Size) _Elem (&_Str)[_Size]) { return _Istream_extract_into_buffer(_Istr, _Size, _Str); } -template +_EXPORT_STD template basic_istream& operator>>( basic_istream& _Istr, _Out_writes_z_(_Size) signed char (&_Str)[_Size]) { return _Istream_extract_into_buffer(_Istr, _Size, reinterpret_cast(_Str)); } -template +_EXPORT_STD template basic_istream& operator>>( basic_istream& _Istr, _Out_writes_z_(_Size) unsigned char (&_Str)[_Size]) { return _Istream_extract_into_buffer(_Istr, _Size, reinterpret_cast(_Str)); @@ -855,7 +855,7 @@ basic_istream& operator>>(basic_istream& _Istr, un } #endif // _HAS_CXX20 -template +_EXPORT_STD template basic_istream<_Elem, _Traits>& operator>>(basic_istream<_Elem, _Traits>& _Istr, _Elem& _Ch) { // extract a character using _Myis = basic_istream<_Elem, _Traits>; @@ -878,13 +878,13 @@ basic_istream<_Elem, _Traits>& operator>>(basic_istream<_Elem, _Traits>& _Istr, return _Istr; } -template +_EXPORT_STD template basic_istream& operator>>(basic_istream& _Istr, signed char& _Ch) { // extract a signed char return _Istr >> reinterpret_cast(_Ch); } -template +_EXPORT_STD template basic_istream& operator>>(basic_istream& _Istr, unsigned char& _Ch) { // extract an unsigned char return _Istr >> reinterpret_cast(_Ch); @@ -896,14 +896,14 @@ struct _Can_stream_in : false_type {}; template struct _Can_stream_in<_Istr, _Ty, void_t() >> _STD declval<_Ty>())>> : true_type {}; -template , _Can_stream_in<_Istr, _Ty>>, int> = 0> _Istr&& operator>>(_Istr&& _Is, _Ty&& _Val) { // extract from rvalue stream _Is >> _STD forward<_Ty>(_Val); return _STD move(_Is); } -template +_EXPORT_STD template basic_istream<_Elem, _Traits>& __CLRCALL_OR_CDECL ws(basic_istream<_Elem, _Traits>& _Istr) { // consume whitespace const typename basic_istream<_Elem, _Traits>::sentry _Ok(_Istr, true); diff --git a/stl/inc/iterator b/stl/inc/iterator index 1da5cfd10e..5b2e5ec211 100644 --- a/stl/inc/iterator +++ b/stl/inc/iterator @@ -19,7 +19,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new _STD_BEGIN -template +_EXPORT_STD template class back_insert_iterator { // wrap pushes to back of container as output iterator public: using iterator_category = output_iterator_tag; @@ -64,13 +64,13 @@ protected: _Container* container; }; -template +_EXPORT_STD template _NODISCARD _CONSTEXPR20 back_insert_iterator<_Container> back_inserter(_Container& _Cont) noexcept /* strengthened */ { // return a back_insert_iterator return back_insert_iterator<_Container>(_Cont); } -template +_EXPORT_STD template class front_insert_iterator { // wrap pushes to front of container as output iterator public: using iterator_category = output_iterator_tag; @@ -115,12 +115,12 @@ protected: _Container* container; }; -template +_EXPORT_STD template _NODISCARD _CONSTEXPR20 front_insert_iterator<_Container> front_inserter(_Container& _Cont) { return front_insert_iterator<_Container>(_Cont); } -template +_EXPORT_STD template class insert_iterator { // wrap inserts into container as output iterator public: using iterator_category = output_iterator_tag; @@ -176,12 +176,12 @@ _NODISCARD _CONSTEXPR20 insert_iterator<_Container> inserter(_Container& _Cont, return insert_iterator<_Container>(_Cont, _Where); } #else // ^^^ No Ranges / Ranges vvv -template +_EXPORT_STD template _NODISCARD constexpr insert_iterator<_Container> inserter(_Container& _Cont, _RANGES iterator_t<_Container> _Where) { return insert_iterator<_Container>(_Cont, _Where); } -template +_EXPORT_STD template class move_sentinel { public: constexpr move_sentinel() = default; @@ -235,7 +235,7 @@ private: }; #endif // __cpp_lib_concepts -template , class _Diff = ptrdiff_t> +_EXPORT_STD template , class _Diff = ptrdiff_t> class istream_iterator { public: using iterator_category = input_iterator_tag; @@ -305,7 +305,7 @@ private: _Ty _Myval{}; // lookahead value (valid if _Myistr is not null) }; -template +_EXPORT_STD template _NODISCARD bool operator==(const istream_iterator<_Ty, _Elem, _Traits, _Diff>& _Left, const istream_iterator<_Ty, _Elem, _Traits, _Diff>& _Right) noexcept /* strengthened */ { return _Left._Equal(_Right); @@ -319,7 +319,7 @@ _NODISCARD bool operator!=(const istream_iterator<_Ty, _Elem, _Traits, _Diff>& _ } #endif // !_HAS_CXX20 -template > +_EXPORT_STD template > class ostream_iterator { public: using iterator_category = output_iterator_tag; @@ -364,7 +364,7 @@ private: ostream_type* _Myostr; // pointer to output stream }; -template +_EXPORT_STD template class istreambuf_iterator { public: using iterator_category = input_iterator_tag; @@ -487,7 +487,7 @@ private: mutable _Elem _Val; // next element to deliver }; -template +_EXPORT_STD template _NODISCARD bool operator==( const istreambuf_iterator<_Elem, _Traits>& _Left, const istreambuf_iterator<_Elem, _Traits>& _Right) { return _Left.equal(_Right); @@ -501,7 +501,7 @@ _NODISCARD bool operator!=( } #endif // !_HAS_CXX20 -template +_EXPORT_STD template class ostreambuf_iterator { public: using iterator_category = output_iterator_tag; @@ -848,7 +848,7 @@ concept _Use_postfix_proxy = !requires(_Iter& __it) { { *__it++ } -> _Can_refere && constructible_from, iter_reference_t<_Iter>> && move_constructible>; -template _Se> +_EXPORT_STD template _Se> requires (!same_as<_Iter, _Se> && copyable<_Iter>) class common_iterator { // clang-format on @@ -1128,7 +1128,7 @@ struct _Counted_iterator_concept_base<_Iter> : _Counted_iterator_category_base<_ using iterator_concept = typename _Iter::iterator_concept; }; -template +_EXPORT_STD template class counted_iterator : public _Counted_iterator_concept_base<_Iter> { public: using iterator_type = _Iter; diff --git a/stl/inc/latch b/stl/inc/latch index 7ca2d02cf9..e18586f415 100644 --- a/stl/inc/latch +++ b/stl/inc/latch @@ -29,7 +29,7 @@ _STL_DISABLE_CLANG_WARNINGS _STD_BEGIN -class latch { +_EXPORT_STD class latch { public: _NODISCARD static constexpr ptrdiff_t(max)() noexcept { return (1ULL << (sizeof(ptrdiff_t) * CHAR_BIT - 1)) - 1; diff --git a/stl/inc/limits b/stl/inc/limits index 9fa62e60dd..f255b2c214 100644 --- a/stl/inc/limits +++ b/stl/inc/limits @@ -35,13 +35,13 @@ _STL_DISABLE_CLANG_WARNINGS #undef new _STD_BEGIN -enum float_denorm_style { // constants for different IEEE float denormalization styles +_EXPORT_STD enum float_denorm_style { // constants for different IEEE float denormalization styles denorm_indeterminate = -1, denorm_absent = 0, denorm_present = 1 }; -enum float_round_style { // constants for different IEEE rounding styles +_EXPORT_STD enum float_round_style { // constants for different IEEE rounding styles round_indeterminate = -1, round_toward_zero = 0, round_to_nearest = 1, @@ -75,7 +75,7 @@ struct _Num_base { // base for all types, with common defaults static constexpr int radix = 0; }; -template +_EXPORT_STD template class numeric_limits : public _Num_base { // numeric limits for arbitrary type _Ty (say little or nothing) public: _NODISCARD static constexpr _Ty(min)() noexcept { diff --git a/stl/inc/list b/stl/inc/list index 7d248f34de..509e2299d6 100644 --- a/stl/inc/list +++ b/stl/inc/list @@ -752,7 +752,7 @@ private: template class _Hash; -template > +_EXPORT_STD template > class list { // bidirectional linked list private: template @@ -1864,12 +1864,12 @@ template <_RANGES input_range _Rng, class _Alloc = allocator<_RANGES range_value list(from_range_t, _Rng&&, _Alloc = _Alloc()) -> list<_RANGES range_value_t<_Rng>, _Alloc>; #endif // _HAS_CXX23 && defined(__cpp_lib_concepts) -template +_EXPORT_STD template void swap(list<_Ty, _Alloc>& _Left, list<_Ty, _Alloc>& _Right) noexcept /* strengthened */ { _Left.swap(_Right); } -template +_EXPORT_STD template _NODISCARD bool operator==(const list<_Ty, _Alloc>& _Left, const list<_Ty, _Alloc>& _Right) { return _Left.size() == _Right.size() && _STD equal(_Left._Unchecked_begin(), _Left._Unchecked_end(), _Right._Unchecked_begin()); @@ -1883,7 +1883,7 @@ _NODISCARD bool operator!=(const list<_Ty, _Alloc>& _Left, const list<_Ty, _Allo #endif // !_HAS_CXX20 #ifdef __cpp_lib_concepts -template +_EXPORT_STD template _NODISCARD _Synth_three_way_result<_Ty> operator<=>(const list<_Ty, _Alloc>& _Left, const list<_Ty, _Alloc>& _Right) { return _STD lexicographical_compare_three_way(_Left._Unchecked_begin(), _Left._Unchecked_end(), _Right._Unchecked_begin(), _Right._Unchecked_end(), _Synth_three_way{}); @@ -1912,12 +1912,12 @@ _NODISCARD bool operator>=(const list<_Ty, _Alloc>& _Left, const list<_Ty, _Allo #endif // ^^^ !defined(__cpp_lib_concepts) ^^^ #if _HAS_CXX20 -template +_EXPORT_STD template typename list<_Ty, _Alloc>::size_type erase(list<_Ty, _Alloc>& _Cont, const _Uty& _Val) { return _Cont.remove_if([&](_Ty& _Elem) { return _Elem == _Val; }); } -template +_EXPORT_STD template typename list<_Ty, _Alloc>::size_type erase_if(list<_Ty, _Alloc>& _Cont, _Pr _Pred) { return _Cont.remove_if(_Pass_fn(_Pred)); } @@ -1925,7 +1925,7 @@ typename list<_Ty, _Alloc>::size_type erase_if(list<_Ty, _Alloc>& _Cont, _Pr _Pr #if _HAS_CXX17 namespace pmr { - template + _EXPORT_STD template using list = _STD list<_Ty, polymorphic_allocator<_Ty>>; } // namespace pmr #endif // _HAS_CXX17 diff --git a/stl/inc/locale b/stl/inc/locale index d958a79794..bb80b9ed53 100644 --- a/stl/inc/locale +++ b/stl/inc/locale @@ -23,7 +23,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new _STD_BEGIN -template +_EXPORT_STD template class collate : public locale::facet { // facet for ordering sequences of elements public: static_assert(!_ENFORCE_FACET_SPECIALIZATIONS || _Is_any_of_v<_Elem, char, wchar_t>, _FACET_SPECIALIZATION_MESSAGE); @@ -140,7 +140,7 @@ template __PURE_APPDOMAIN_GLOBAL locale::id collate::id; #pragma clang diagnostic pop #endif // __clang__ -template +_EXPORT_STD template class collate_byname : public collate<_Elem> { // collate for named locale public: static_assert(!_ENFORCE_FACET_SPECIALIZATIONS || _Is_any_of_v<_Elem, char, wchar_t>, _FACET_SPECIALIZATION_MESSAGE); @@ -155,7 +155,7 @@ protected: __CLR_OR_THIS_CALL ~collate_byname() noexcept override {} }; -template +_EXPORT_STD template _NODISCARD bool has_facet(const locale& _Loc) noexcept { _BEGIN_LOCK(_LOCK_LOCALE) // the thread lock, make get atomic size_t _Id = _Facet::id; @@ -163,72 +163,72 @@ _NODISCARD bool has_facet(const locale& _Loc) noexcept { _END_LOCK() } -template +_EXPORT_STD template _NODISCARD bool isalnum(_Elem _Ch, const locale& _Loc) { return _STD use_facet>(_Loc).is(ctype_base::alnum, _Ch); } -template +_EXPORT_STD template _NODISCARD bool isalpha(_Elem _Ch, const locale& _Loc) { return _STD use_facet>(_Loc).is(ctype_base::alpha, _Ch); } -template +_EXPORT_STD template _NODISCARD bool isblank(_Elem _Ch, const locale& _Loc) { return _STD use_facet>(_Loc).is(ctype_base::blank, _Ch); } -template +_EXPORT_STD template _NODISCARD bool iscntrl(_Elem _Ch, const locale& _Loc) { return _STD use_facet>(_Loc).is(ctype_base::cntrl, _Ch); } -template +_EXPORT_STD template _NODISCARD bool isdigit(_Elem _Ch, const locale& _Loc) { return _STD use_facet>(_Loc).is(ctype_base::digit, _Ch); } -template +_EXPORT_STD template _NODISCARD bool isgraph(_Elem _Ch, const locale& _Loc) { return _STD use_facet>(_Loc).is(ctype_base::graph, _Ch); } -template +_EXPORT_STD template _NODISCARD bool islower(_Elem _Ch, const locale& _Loc) { return _STD use_facet>(_Loc).is(ctype_base::lower, _Ch); } -template +_EXPORT_STD template _NODISCARD bool isprint(_Elem _Ch, const locale& _Loc) { return _STD use_facet>(_Loc).is(ctype_base::print, _Ch); } -template +_EXPORT_STD template _NODISCARD bool ispunct(_Elem _Ch, const locale& _Loc) { return _STD use_facet>(_Loc).is(ctype_base::punct, _Ch); } -template +_EXPORT_STD template _NODISCARD bool isspace(_Elem _Ch, const locale& _Loc) { return _STD use_facet>(_Loc).is(ctype_base::space, _Ch); } -template +_EXPORT_STD template _NODISCARD bool isupper(_Elem _Ch, const locale& _Loc) { return _STD use_facet>(_Loc).is(ctype_base::upper, _Ch); } -template +_EXPORT_STD template _NODISCARD bool isxdigit(_Elem _Ch, const locale& _Loc) { return _STD use_facet>(_Loc).is(ctype_base::xdigit, _Ch); } -template +_EXPORT_STD template _NODISCARD _Elem tolower(_Elem _Ch, const locale& _Loc) { return _STD use_facet>(_Loc).tolower(_Ch); } -template +_EXPORT_STD template _NODISCARD _Elem toupper(_Elem _Ch, const locale& _Loc) { return _STD use_facet>(_Loc).toupper(_Ch); } diff --git a/stl/inc/map b/stl/inc/map index e2cbb000d5..63bbefdb82 100644 --- a/stl/inc/map +++ b/stl/inc/map @@ -69,7 +69,7 @@ public: } }; -template , class _Alloc = allocator>> +_EXPORT_STD template , class _Alloc = allocator>> class map : public _Tree<_Tmap_traits<_Kty, _Ty, _Pr, _Alloc, false>> { // ordered red-black tree of {key, mapped} values, unique keys public: @@ -395,7 +395,7 @@ map(from_range_t, _Rng&&, _Alloc) #endif // _HAS_CXX23 && defined(__cpp_lib_concepts) #endif // _HAS_CXX17 -template +_EXPORT_STD template _NODISCARD bool operator==(const map<_Kty, _Ty, _Pr, _Alloc>& _Left, const map<_Kty, _Ty, _Pr, _Alloc>& _Right) { return _Left.size() == _Right.size() && _STD equal(_Left._Unchecked_begin(), _Left._Unchecked_end_iter(), _Right._Unchecked_begin()); @@ -409,7 +409,7 @@ _NODISCARD bool operator!=(const map<_Kty, _Ty, _Pr, _Alloc>& _Left, const map<_ #endif // !_HAS_CXX20 #ifdef __cpp_lib_concepts -template +_EXPORT_STD template _NODISCARD _Synth_three_way_result> operator<=>( const map<_Kty, _Ty, _Pr, _Alloc>& _Left, const map<_Kty, _Ty, _Pr, _Alloc>& _Right) { return _STD lexicographical_compare_three_way(_Left._Unchecked_begin(), _Left._Unchecked_end_iter(), @@ -438,20 +438,20 @@ _NODISCARD bool operator>=(const map<_Kty, _Ty, _Pr, _Alloc>& _Left, const map<_ } #endif // ^^^ !defined(__cpp_lib_concepts) ^^^ -template +_EXPORT_STD template void swap(map<_Kty, _Ty, _Pr, _Alloc>& _Left, map<_Kty, _Ty, _Pr, _Alloc>& _Right) noexcept( noexcept(_Left.swap(_Right))) { _Left.swap(_Right); } #if _HAS_CXX20 -template +_EXPORT_STD template typename map<_Kty, _Ty, _Keylt, _Alloc>::size_type erase_if(map<_Kty, _Ty, _Keylt, _Alloc>& _Cont, _Pr _Pred) { return _Erase_nodes_if(_Cont, _Pass_fn(_Pred)); } #endif // _HAS_CXX20 -template , class _Alloc = allocator>> +_EXPORT_STD template , class _Alloc = allocator>> class multimap : public _Tree<_Tmap_traits<_Kty, _Ty, _Pr, _Alloc, true>> { // ordered red-black tree of {key, mapped} values, non-unique keys public: @@ -626,7 +626,7 @@ multimap(from_range_t, _Rng&&, _Alloc) #endif // _HAS_CXX23 && defined(__cpp_lib_concepts) #endif // _HAS_CXX17 -template +_EXPORT_STD template _NODISCARD bool operator==( const multimap<_Kty, _Ty, _Pr, _Alloc>& _Left, const multimap<_Kty, _Ty, _Pr, _Alloc>& _Right) { return _Left.size() == _Right.size() @@ -642,7 +642,7 @@ _NODISCARD bool operator!=( #endif // !_HAS_CXX20 #ifdef __cpp_lib_concepts -template +_EXPORT_STD template _NODISCARD _Synth_three_way_result> operator<=>( const multimap<_Kty, _Ty, _Pr, _Alloc>& _Left, const multimap<_Kty, _Ty, _Pr, _Alloc>& _Right) { return _STD lexicographical_compare_three_way(_Left._Unchecked_begin(), _Left._Unchecked_end_iter(), @@ -675,14 +675,14 @@ _NODISCARD bool operator>=( } #endif // ^^^ !defined(__cpp_lib_concepts) ^^^ -template +_EXPORT_STD template void swap(multimap<_Kty, _Ty, _Pr, _Alloc>& _Left, multimap<_Kty, _Ty, _Pr, _Alloc>& _Right) noexcept( noexcept(_Left.swap(_Right))) { _Left.swap(_Right); } #if _HAS_CXX20 -template +_EXPORT_STD template typename multimap<_Kty, _Ty, _Keylt, _Alloc>::size_type erase_if( multimap<_Kty, _Ty, _Keylt, _Alloc>& _Cont, _Pr _Pred) { return _Erase_nodes_if(_Cont, _Pass_fn(_Pred)); @@ -691,10 +691,10 @@ typename multimap<_Kty, _Ty, _Keylt, _Alloc>::size_type erase_if( #if _HAS_CXX17 namespace pmr { - template > + _EXPORT_STD template > using map = _STD map<_Kty, _Ty, _Pr, polymorphic_allocator>>; - template > + _EXPORT_STD template > using multimap = _STD multimap<_Kty, _Ty, _Pr, polymorphic_allocator>>; } // namespace pmr #endif // _HAS_CXX17 diff --git a/stl/inc/memory b/stl/inc/memory index 787d0b6786..94ac50ab41 100644 --- a/stl/inc/memory +++ b/stl/inc/memory @@ -28,7 +28,7 @@ _STL_DISABLE_CLANG_WARNINGS _STD_BEGIN #ifdef __cpp_lib_concepts namespace ranges { - template + _EXPORT_STD template using uninitialized_copy_result = in_out_result<_In, _Out>; class _Uninitialized_copy_fn : private _Not_quite_object { @@ -103,11 +103,11 @@ namespace ranges { } }; - inline constexpr _Uninitialized_copy_fn uninitialized_copy{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Uninitialized_copy_fn uninitialized_copy{_Not_quite_object::_Construct_tag{}}; } // namespace ranges #endif // __cpp_lib_concepts -template +_EXPORT_STD template _NoThrowFwdIt uninitialized_copy_n(const _InIt _First, const _Diff _Count_raw, _NoThrowFwdIt _Dest) { // copy [_First, _First + _Count) to [_Dest, ...) _Algorithm_int_t<_Diff> _Count = _Count_raw; @@ -135,7 +135,7 @@ _NoThrowFwdIt uninitialized_copy_n(const _InIt _First, const _Diff _Count_raw, _ #ifdef __cpp_lib_concepts namespace ranges { - template + _EXPORT_STD template using uninitialized_copy_n_result = in_out_result<_In, _Out>; class _Uninitialized_copy_n_fn : private _Not_quite_object { @@ -184,12 +184,12 @@ namespace ranges { } }; - inline constexpr _Uninitialized_copy_n_fn uninitialized_copy_n{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Uninitialized_copy_n_fn uninitialized_copy_n{_Not_quite_object::_Construct_tag{}}; } // namespace ranges #endif // __cpp_lib_concepts #if _HAS_CXX17 -template +_EXPORT_STD template _NoThrowFwdIt uninitialized_move(const _InIt _First, const _InIt _Last, _NoThrowFwdIt _Dest) { // move [_First, _Last) to raw [_Dest, ...) _Adl_verify_range(_First, _Last); @@ -238,11 +238,11 @@ namespace ranges { } }; - inline constexpr _Uninitialized_move_fn uninitialized_move{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Uninitialized_move_fn uninitialized_move{_Not_quite_object::_Construct_tag{}}; } // namespace ranges #endif // __cpp_lib_concepts -template +_EXPORT_STD template pair<_InIt, _NoThrowFwdIt> uninitialized_move_n(_InIt _First, const _Diff _Count_raw, _NoThrowFwdIt _Dest) { // move [_First, _First + _Count) to [_Dest, ...) _Algorithm_int_t<_Diff> _Count = _Count_raw; @@ -274,7 +274,7 @@ pair<_InIt, _NoThrowFwdIt> uninitialized_move_n(_InIt _First, const _Diff _Count #ifdef __cpp_lib_concepts namespace ranges { - template + _EXPORT_STD template using uninitialized_move_n_result = in_out_result<_In, _Out>; class _Uninitialized_move_n_fn : private _Not_quite_object { @@ -323,7 +323,7 @@ namespace ranges { } }; - inline constexpr _Uninitialized_move_n_fn uninitialized_move_n{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Uninitialized_move_n_fn uninitialized_move_n{_Not_quite_object::_Construct_tag{}}; class _Uninitialized_fill_fn : private _Not_quite_object { public: @@ -381,11 +381,11 @@ namespace ranges { } }; - inline constexpr _Uninitialized_fill_fn uninitialized_fill{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Uninitialized_fill_fn uninitialized_fill{_Not_quite_object::_Construct_tag{}}; } // namespace ranges #endif // __cpp_lib_concepts -template +_EXPORT_STD template _NoThrowFwdIt uninitialized_fill_n(_NoThrowFwdIt _First, const _Diff _Count_raw, const _Tval& _Val) { // copy _Count copies of _Val to raw _First _Algorithm_int_t<_Diff> _Count = _Count_raw; @@ -459,7 +459,7 @@ namespace ranges { } }; - inline constexpr _Uninitialized_fill_n_fn uninitialized_fill_n{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Uninitialized_fill_n_fn uninitialized_fill_n{_Not_quite_object::_Construct_tag{}}; class _Construct_at_fn : private _Not_quite_object { public: @@ -479,7 +479,7 @@ namespace ranges { } }; - inline constexpr _Construct_at_fn construct_at{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Construct_at_fn construct_at{_Not_quite_object::_Construct_tag{}}; // clang-format off template <_No_throw_input_iterator _It, _No_throw_sentinel_for<_It> _Se> @@ -501,12 +501,12 @@ namespace ranges { } }; - inline constexpr _Destroy_at_fn destroy_at{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Destroy_at_fn destroy_at{_Not_quite_object::_Construct_tag{}}; } // namespace ranges #endif // __cpp_lib_concepts #if _HAS_CXX17 -template +_EXPORT_STD template _CONSTEXPR20 void destroy(const _NoThrowFwdIt _First, const _NoThrowFwdIt _Last) { // destroy all elements in [_First, _Last) _Adl_verify_range(_First, _Last); @@ -558,11 +558,11 @@ namespace ranges { } }; - inline constexpr _Destroy_fn destroy{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Destroy_fn destroy{_Not_quite_object::_Construct_tag{}}; } // namespace ranges #endif // __cpp_lib_concepts -template +_EXPORT_STD template _CONSTEXPR20 _NoThrowFwdIt destroy_n(_NoThrowFwdIt _First, const _Diff _Count_raw) { // destroy all elements in [_First, _First + _Count) _Algorithm_int_t<_Diff> _Count = _Count_raw; @@ -615,11 +615,11 @@ namespace ranges { } }; - inline constexpr _Destroy_n_fn destroy_n{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Destroy_n_fn destroy_n{_Not_quite_object::_Construct_tag{}}; } // namespace ranges #endif // __cpp_lib_concepts -template +_EXPORT_STD template void uninitialized_default_construct(const _NoThrowFwdIt _First, const _NoThrowFwdIt _Last) { // default-initialize all elements in [_First, _Last) using _Ty = remove_reference_t<_Iter_ref_t<_NoThrowFwdIt>>; @@ -687,12 +687,12 @@ namespace ranges { } }; - inline constexpr _Uninitialized_default_construct_fn uninitialized_default_construct{ + _EXPORT_STD inline constexpr _Uninitialized_default_construct_fn uninitialized_default_construct{ _Not_quite_object::_Construct_tag{}}; } // namespace ranges #endif // __cpp_lib_concepts -template +_EXPORT_STD template _NoThrowFwdIt uninitialized_default_construct_n(_NoThrowFwdIt _First, const _Diff _Count_raw) { // default-initialize all elements in [_First, _First + _Count_raw) using _Ty = _Iter_value_t<_NoThrowFwdIt>; @@ -746,12 +746,12 @@ namespace ranges { } }; - inline constexpr _Uninitialized_default_construct_n_fn uninitialized_default_construct_n{ + _EXPORT_STD inline constexpr _Uninitialized_default_construct_n_fn uninitialized_default_construct_n{ _Not_quite_object::_Construct_tag{}}; } // namespace ranges #endif // __cpp_lib_concepts -template +_EXPORT_STD template void uninitialized_value_construct(const _NoThrowFwdIt _First, const _NoThrowFwdIt _Last) { // value-initialize all elements in [_First, _Last) _Adl_verify_range(_First, _Last); @@ -820,12 +820,12 @@ namespace ranges { } }; - inline constexpr _Uninitialized_value_construct_fn uninitialized_value_construct{ + _EXPORT_STD inline constexpr _Uninitialized_value_construct_fn uninitialized_value_construct{ _Not_quite_object::_Construct_tag{}}; } // namespace ranges #endif // __cpp_lib_concepts -template +_EXPORT_STD template _NoThrowFwdIt uninitialized_value_construct_n(_NoThrowFwdIt _First, const _Diff _Count_raw) { // value-initialize all elements in [_First, _First + _Count_raw) _Algorithm_int_t<_Diff> _Count = _Count_raw; @@ -868,7 +868,7 @@ namespace ranges { } }; - inline constexpr _Uninitialized_value_construct_n_fn uninitialized_value_construct_n{ + _EXPORT_STD inline constexpr _Uninitialized_value_construct_n_fn uninitialized_value_construct_n{ _Not_quite_object::_Construct_tag{}}; } // namespace ranges #endif // __cpp_lib_concepts @@ -876,7 +876,7 @@ namespace ranges { #if _HAS_DEPRECATED_RAW_STORAGE_ITERATOR -template +_EXPORT_STD template class _CXX17_DEPRECATE_RAW_STORAGE_ITERATOR raw_storage_iterator { // wrap stores to raw buffer as output iterator public: using iterator_category = output_iterator_tag; @@ -927,17 +927,17 @@ private: #if _HAS_AUTO_PTR_ETC -template +_EXPORT_STD template class auto_ptr; -template +_EXPORT_STD template struct auto_ptr_ref { // proxy reference for auto_ptr copying explicit auto_ptr_ref(_Ty* _Right) : _Ref(_Right) {} _Ty* _Ref; // generic pointer to auto_ptr ptr }; -template +_EXPORT_STD template class auto_ptr { // wrap an object pointer to ensure destruction public: using element_type = _Ty; @@ -1036,7 +1036,7 @@ public: #endif // _HAS_AUTO_PTR_ETC -class bad_weak_ptr : public exception { // exception type for invalid use of expired weak_ptr object +_EXPORT_STD class bad_weak_ptr : public exception { // exception type for invalid use of expired weak_ptr object public: bad_weak_ptr() noexcept {} @@ -1222,16 +1222,16 @@ private: _Compressed_pair<_Dx, _Compressed_pair<_Myalty, _Resource>> _Mypair; }; -template +_EXPORT_STD template struct default_delete; -template > +_EXPORT_STD template > class unique_ptr; -template +_EXPORT_STD template class shared_ptr; -template +_EXPORT_STD template class weak_ptr; template @@ -1490,7 +1490,7 @@ struct _Temporary_owner_del { } }; -template +_EXPORT_STD template class shared_ptr : public _Ptr_base<_Ty> { // class for reference counted resource management private: using _Mybase = _Ptr_base<_Ty>; @@ -1807,13 +1807,13 @@ template shared_ptr(unique_ptr<_Ty, _Dx>) -> shared_ptr<_Ty>; #endif // _HAS_CXX17 -template +_EXPORT_STD template _NODISCARD bool operator==(const shared_ptr<_Ty1>& _Left, const shared_ptr<_Ty2>& _Right) noexcept { return _Left.get() == _Right.get(); } #if _HAS_CXX20 -template +_EXPORT_STD template _NODISCARD strong_ordering operator<=>(const shared_ptr<_Ty1>& _Left, const shared_ptr<_Ty2>& _Right) noexcept { return _Left.get() <=> _Right.get(); } @@ -1844,13 +1844,13 @@ _NODISCARD bool operator<=(const shared_ptr<_Ty1>& _Left, const shared_ptr<_Ty2> } #endif // ^^^ !_HAS_CXX20 ^^^ -template +_EXPORT_STD template _NODISCARD bool operator==(const shared_ptr<_Ty>& _Left, nullptr_t) noexcept { return _Left.get() == nullptr; } #if _HAS_CXX20 -template +_EXPORT_STD template _NODISCARD strong_ordering operator<=>(const shared_ptr<_Ty>& _Left, nullptr_t) noexcept { return _Left.get() <=> static_cast::element_type*>(nullptr); } @@ -1911,53 +1911,53 @@ _NODISCARD bool operator<=(nullptr_t, const shared_ptr<_Ty>& _Right) noexcept { } #endif // ^^^ !_HAS_CXX20 ^^^ -template +_EXPORT_STD template basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Out, const shared_ptr<_Ty>& _Px) { // write contained pointer to stream return _Out << _Px.get(); } -template +_EXPORT_STD template void swap(shared_ptr<_Ty>& _Left, shared_ptr<_Ty>& _Right) noexcept { _Left.swap(_Right); } -template +_EXPORT_STD template _NODISCARD shared_ptr<_Ty1> static_pointer_cast(const shared_ptr<_Ty2>& _Other) noexcept { // static_cast for shared_ptr that properly respects the reference count control block const auto _Ptr = static_cast::element_type*>(_Other.get()); return shared_ptr<_Ty1>(_Other, _Ptr); } -template +_EXPORT_STD template _NODISCARD shared_ptr<_Ty1> static_pointer_cast(shared_ptr<_Ty2>&& _Other) noexcept { // static_cast for shared_ptr that properly respects the reference count control block const auto _Ptr = static_cast::element_type*>(_Other.get()); return shared_ptr<_Ty1>(_STD move(_Other), _Ptr); } -template +_EXPORT_STD template _NODISCARD shared_ptr<_Ty1> const_pointer_cast(const shared_ptr<_Ty2>& _Other) noexcept { // const_cast for shared_ptr that properly respects the reference count control block const auto _Ptr = const_cast::element_type*>(_Other.get()); return shared_ptr<_Ty1>(_Other, _Ptr); } -template +_EXPORT_STD template _NODISCARD shared_ptr<_Ty1> const_pointer_cast(shared_ptr<_Ty2>&& _Other) noexcept { // const_cast for shared_ptr that properly respects the reference count control block const auto _Ptr = const_cast::element_type*>(_Other.get()); return shared_ptr<_Ty1>(_STD move(_Other), _Ptr); } -template +_EXPORT_STD template _NODISCARD shared_ptr<_Ty1> reinterpret_pointer_cast(const shared_ptr<_Ty2>& _Other) noexcept { // reinterpret_cast for shared_ptr that properly respects the reference count control block const auto _Ptr = reinterpret_cast::element_type*>(_Other.get()); return shared_ptr<_Ty1>(_Other, _Ptr); } -template +_EXPORT_STD template _NODISCARD shared_ptr<_Ty1> reinterpret_pointer_cast(shared_ptr<_Ty2>&& _Other) noexcept { // reinterpret_cast for shared_ptr that properly respects the reference count control block const auto _Ptr = reinterpret_cast::element_type*>(_Other.get()); @@ -1965,7 +1965,7 @@ _NODISCARD shared_ptr<_Ty1> reinterpret_pointer_cast(shared_ptr<_Ty2>&& _Other) } #ifdef _CPPRTTI -template +_EXPORT_STD template _NODISCARD shared_ptr<_Ty1> dynamic_pointer_cast(const shared_ptr<_Ty2>& _Other) noexcept { // dynamic_cast for shared_ptr that properly respects the reference count control block const auto _Ptr = dynamic_cast::element_type*>(_Other.get()); @@ -1977,7 +1977,7 @@ _NODISCARD shared_ptr<_Ty1> dynamic_pointer_cast(const shared_ptr<_Ty2>& _Other) return {}; } -template +_EXPORT_STD template _NODISCARD shared_ptr<_Ty1> dynamic_pointer_cast(shared_ptr<_Ty2>&& _Other) noexcept { // dynamic_cast for shared_ptr that properly respects the reference count control block const auto _Ptr = dynamic_cast::element_type*>(_Other.get()); @@ -1989,14 +1989,14 @@ _NODISCARD shared_ptr<_Ty1> dynamic_pointer_cast(shared_ptr<_Ty2>&& _Other) noex return {}; } #else // _CPPRTTI -template +_EXPORT_STD template shared_ptr<_Ty1> dynamic_pointer_cast(const shared_ptr<_Ty2>&) noexcept = delete; // requires /GR option -template +_EXPORT_STD template shared_ptr<_Ty1> dynamic_pointer_cast(shared_ptr<_Ty2>&&) noexcept = delete; // requires /GR option #endif // _CPPRTTI #if _HAS_STATIC_RTTI -template +_EXPORT_STD template _NODISCARD _Dx* get_deleter(const shared_ptr<_Ty>& _Sx) noexcept { // return pointer to shared_ptr's deleter object if its type is _Dx if (_Sx._Rep) { @@ -2006,7 +2006,7 @@ _NODISCARD _Dx* get_deleter(const shared_ptr<_Ty>& _Sx) noexcept { return nullptr; } #else // _HAS_STATIC_RTTI -template +_EXPORT_STD template _Dx* get_deleter(const shared_ptr<_Ty>&) noexcept = delete; // requires static RTTI #endif // _HAS_STATIC_RTTI @@ -2693,7 +2693,7 @@ private: }; #endif // _HAS_CXX20 -template +_EXPORT_STD template _NODISCARD_SMART_PTR_ALLOC #if _HAS_CXX20 enable_if_t, shared_ptr<_Ty>> @@ -2722,7 +2722,7 @@ struct _NODISCARD _Global_delete_guard { } }; -template +_EXPORT_STD /* TRANSITION, VSO-1538698 */ template _NODISCARD shared_ptr<_Ty> _Make_shared_unbounded_array(const size_t _Count, const _ArgTypes&... _Args) { // make a shared_ptr to an unbounded array static_assert(is_unbounded_array_v<_Ty>); @@ -2736,18 +2736,18 @@ _NODISCARD shared_ptr<_Ty> _Make_shared_unbounded_array(const size_t _Count, con return _Ret; } -template +_EXPORT_STD template _NODISCARD_SMART_PTR_ALLOC enable_if_t, shared_ptr<_Ty>> make_shared(const size_t _Count) { return _Make_shared_unbounded_array<_Ty>(_Count); } -template +_EXPORT_STD template _NODISCARD_SMART_PTR_ALLOC enable_if_t, shared_ptr<_Ty>> make_shared( const size_t _Count, const remove_extent_t<_Ty>& _Val) { return _Make_shared_unbounded_array<_Ty>(_Count, _Val); } -template +_EXPORT_STD template _NODISCARD_SMART_PTR_ALLOC enable_if_t, shared_ptr<_Ty>> make_shared() { // make a shared_ptr to a bounded array const auto _Rx = new _Ref_count_bounded_array<_Ty>(); @@ -2756,7 +2756,7 @@ _NODISCARD_SMART_PTR_ALLOC enable_if_t, shared_ptr<_Ty>> return _Ret; } -template +_EXPORT_STD template _NODISCARD_SMART_PTR_ALLOC enable_if_t, shared_ptr<_Ty>> make_shared( const remove_extent_t<_Ty>& _Val) { // make a shared_ptr to a bounded array @@ -2766,7 +2766,7 @@ _NODISCARD_SMART_PTR_ALLOC enable_if_t, shared_ptr<_Ty>> return _Ret; } -template +_EXPORT_STD template _NODISCARD_SMART_PTR_ALLOC enable_if_t, shared_ptr<_Ty>> make_shared_for_overwrite() { shared_ptr<_Ty> _Ret; if constexpr (is_array_v<_Ty>) { @@ -2781,14 +2781,14 @@ _NODISCARD_SMART_PTR_ALLOC enable_if_t, shared_ptr<_T return _Ret; } -template +_EXPORT_STD template _NODISCARD_SMART_PTR_ALLOC enable_if_t, shared_ptr<_Ty>> make_shared_for_overwrite( const size_t _Count) { return _Make_shared_unbounded_array<_Ty>(_Count, _For_overwrite_tag{}); } #endif // _HAS_CXX20 -template +_EXPORT_STD template _NODISCARD_SMART_PTR_ALLOC #if _HAS_CXX20 enable_if_t, shared_ptr<_Ty>> @@ -2829,7 +2829,7 @@ struct _Allocate_n_ptr { _Allocate_n_ptr& operator=(const _Allocate_n_ptr&) = delete; }; -template +_EXPORT_STD /* TRANSITION, VSO-1538698 */ template _NODISCARD shared_ptr<_Ty> _Allocate_shared_unbounded_array( const _Alloc& _Al, const size_t _Count, const _ArgTypes&... _Args) { // make a shared_ptr to an unbounded array @@ -2849,19 +2849,19 @@ _NODISCARD shared_ptr<_Ty> _Allocate_shared_unbounded_array( return _Ret; } -template +_EXPORT_STD template _NODISCARD_SMART_PTR_ALLOC enable_if_t, shared_ptr<_Ty>> allocate_shared( const _Alloc& _Al, const size_t _Count) { return _Allocate_shared_unbounded_array<_Ty>(_Al, _Count); } -template +_EXPORT_STD template _NODISCARD_SMART_PTR_ALLOC enable_if_t, shared_ptr<_Ty>> allocate_shared( const _Alloc& _Al, const size_t _Count, const remove_extent_t<_Ty>& _Val) { return _Allocate_shared_unbounded_array<_Ty>(_Al, _Count, _Val); } -template +_EXPORT_STD template _NODISCARD_SMART_PTR_ALLOC enable_if_t, shared_ptr<_Ty>> allocate_shared(const _Alloc& _Al) { // make a shared_ptr to a bounded array using _Refc = _Ref_count_bounded_array_alloc, _Alloc>; @@ -2876,7 +2876,7 @@ _NODISCARD_SMART_PTR_ALLOC enable_if_t, shared_ptr<_Ty>> return _Ret; } -template +_EXPORT_STD template _NODISCARD_SMART_PTR_ALLOC enable_if_t, shared_ptr<_Ty>> allocate_shared( const _Alloc& _Al, const remove_extent_t<_Ty>& _Val) { // make a shared_ptr to a bounded array @@ -2892,7 +2892,7 @@ _NODISCARD_SMART_PTR_ALLOC enable_if_t, shared_ptr<_Ty>> return _Ret; } -template +_EXPORT_STD template _NODISCARD_SMART_PTR_ALLOC enable_if_t, shared_ptr<_Ty>> allocate_shared_for_overwrite( const _Alloc& _Al) { shared_ptr<_Ty> _Ret; @@ -2921,14 +2921,14 @@ _NODISCARD_SMART_PTR_ALLOC enable_if_t, shared_ptr<_T return _Ret; } -template +_EXPORT_STD template _NODISCARD_SMART_PTR_ALLOC enable_if_t, shared_ptr<_Ty>> allocate_shared_for_overwrite( const _Alloc& _Al, const size_t _Count) { return _Allocate_shared_unbounded_array<_Ty>(_Al, _Count, _For_overwrite_tag{}); } #endif // _HAS_CXX20 -template +_EXPORT_STD template class weak_ptr : public _Ptr_base<_Ty> { // class for pointer to reference counted resource public: #ifndef _M_CEE_PURE @@ -3047,12 +3047,12 @@ template weak_ptr(shared_ptr<_Ty>) -> weak_ptr<_Ty>; #endif // _HAS_CXX17 -template +_EXPORT_STD template void swap(weak_ptr<_Ty>& _Left, weak_ptr<_Ty>& _Right) noexcept { _Left.swap(_Right); } -template +_EXPORT_STD template class enable_shared_from_this { // provide member functions that create shared_ptr to this public: using _Esft_type = enable_shared_from_this; @@ -3094,7 +3094,7 @@ private: }; -template +_EXPORT_STD template struct default_delete { // default deleter for unique_ptr constexpr default_delete() noexcept = default; @@ -3135,7 +3135,7 @@ template using _Unique_ptr_enable_default_t = enable_if_t>, is_default_constructible<_Dx2>>, int>; -template */> +_EXPORT_STD template */> class unique_ptr { // non-copyable pointer to an object public: using pointer = typename _Get_deleter_pointer_type<_Ty, remove_reference_t<_Dx>>::type; @@ -3428,44 +3428,44 @@ private: }; -template , int> = 0> +_EXPORT_STD template , int> = 0> _NODISCARD_SMART_PTR_ALLOC _CONSTEXPR23 unique_ptr<_Ty> make_unique(_Types&&... _Args) { // make a unique_ptr return unique_ptr<_Ty>(new _Ty(_STD forward<_Types>(_Args)...)); } -template && extent_v<_Ty> == 0, int> = 0> +_EXPORT_STD template && extent_v<_Ty> == 0, int> = 0> _NODISCARD_SMART_PTR_ALLOC _CONSTEXPR23 unique_ptr<_Ty> make_unique(const size_t _Size) { // make a unique_ptr using _Elem = remove_extent_t<_Ty>; return unique_ptr<_Ty>(new _Elem[_Size]()); } -template != 0, int> = 0> +_EXPORT_STD template != 0, int> = 0> void make_unique(_Types&&...) = delete; #if _HAS_CXX20 -template , int> = 0> +_EXPORT_STD template , int> = 0> _NODISCARD_SMART_PTR_ALLOC _CONSTEXPR23 unique_ptr<_Ty> make_unique_for_overwrite() { // make a unique_ptr with default initialization return unique_ptr<_Ty>(new _Ty); } -template , int> = 0> +_EXPORT_STD template , int> = 0> _NODISCARD_SMART_PTR_ALLOC _CONSTEXPR23 unique_ptr<_Ty> make_unique_for_overwrite(const size_t _Size) { // make a unique_ptr with default initialization using _Elem = remove_extent_t<_Ty>; return unique_ptr<_Ty>(new _Elem[_Size]); } -template , int> = 0> +_EXPORT_STD template , int> = 0> void make_unique_for_overwrite(_Types&&...) = delete; #endif // _HAS_CXX20 -template ::value, int> = 0> +_EXPORT_STD template ::value, int> = 0> _CONSTEXPR23 void swap(unique_ptr<_Ty, _Dx>& _Left, unique_ptr<_Ty, _Dx>& _Right) noexcept { _Left.swap(_Right); } -template +_EXPORT_STD template _NODISCARD _CONSTEXPR23 bool operator==(const unique_ptr<_Ty1, _Dx1>& _Left, const unique_ptr<_Ty2, _Dx2>& _Right) { return _Left.get() == _Right.get(); } @@ -3477,7 +3477,7 @@ _NODISCARD bool operator!=(const unique_ptr<_Ty1, _Dx1>& _Left, const unique_ptr } #endif // !_HAS_CXX20 -template +_EXPORT_STD template _NODISCARD bool operator<(const unique_ptr<_Ty1, _Dx1>& _Left, const unique_ptr<_Ty2, _Dx2>& _Right) { using _Ptr1 = typename unique_ptr<_Ty1, _Dx1>::pointer; using _Ptr2 = typename unique_ptr<_Ty2, _Dx2>::pointer; @@ -3485,24 +3485,24 @@ _NODISCARD bool operator<(const unique_ptr<_Ty1, _Dx1>& _Left, const unique_ptr< return less<_Common>{}(_Left.get(), _Right.get()); } -template +_EXPORT_STD template _NODISCARD bool operator>=(const unique_ptr<_Ty1, _Dx1>& _Left, const unique_ptr<_Ty2, _Dx2>& _Right) { return !(_Left < _Right); } -template +_EXPORT_STD template _NODISCARD bool operator>(const unique_ptr<_Ty1, _Dx1>& _Left, const unique_ptr<_Ty2, _Dx2>& _Right) { return _Right < _Left; } -template +_EXPORT_STD template _NODISCARD bool operator<=(const unique_ptr<_Ty1, _Dx1>& _Left, const unique_ptr<_Ty2, _Dx2>& _Right) { return !(_Right < _Left); } #ifdef __cpp_lib_concepts // clang-format off -template +_EXPORT_STD template requires three_way_comparable_with::pointer, typename unique_ptr<_Ty2, _Dx2>::pointer> _NODISCARD compare_three_way_result_t::pointer, @@ -3513,7 +3513,7 @@ _NODISCARD compare_three_way_result_t::pointer, } #endif // __cpp_lib_concepts -template +_EXPORT_STD template _NODISCARD _CONSTEXPR23 bool operator==(const unique_ptr<_Ty, _Dx>& _Left, nullptr_t) noexcept { return !_Left; } @@ -3535,51 +3535,51 @@ _NODISCARD bool operator!=(nullptr_t _Left, const unique_ptr<_Ty, _Dx>& _Right) } #endif // !_HAS_CXX20 -template +_EXPORT_STD template _NODISCARD _CONSTEXPR23 bool operator<(const unique_ptr<_Ty, _Dx>& _Left, nullptr_t _Right) { using _Ptr = typename unique_ptr<_Ty, _Dx>::pointer; return less<_Ptr>{}(_Left.get(), _Right); } -template +_EXPORT_STD template _NODISCARD _CONSTEXPR23 bool operator<(nullptr_t _Left, const unique_ptr<_Ty, _Dx>& _Right) { using _Ptr = typename unique_ptr<_Ty, _Dx>::pointer; return less<_Ptr>{}(_Left, _Right.get()); } -template +_EXPORT_STD template _NODISCARD _CONSTEXPR23 bool operator>=(const unique_ptr<_Ty, _Dx>& _Left, nullptr_t _Right) { return !(_Left < _Right); } -template +_EXPORT_STD template _NODISCARD _CONSTEXPR23 bool operator>=(nullptr_t _Left, const unique_ptr<_Ty, _Dx>& _Right) { return !(_Left < _Right); } -template +_EXPORT_STD template _NODISCARD _CONSTEXPR23 bool operator>(const unique_ptr<_Ty, _Dx>& _Left, nullptr_t _Right) { return _Right < _Left; } -template +_EXPORT_STD template _NODISCARD _CONSTEXPR23 bool operator>(nullptr_t _Left, const unique_ptr<_Ty, _Dx>& _Right) { return _Right < _Left; } -template +_EXPORT_STD template _NODISCARD _CONSTEXPR23 bool operator<=(const unique_ptr<_Ty, _Dx>& _Left, nullptr_t _Right) { return !(_Right < _Left); } -template +_EXPORT_STD template _NODISCARD _CONSTEXPR23 bool operator<=(nullptr_t _Left, const unique_ptr<_Ty, _Dx>& _Right) { return !(_Right < _Left); } #ifdef __cpp_lib_concepts // clang-format off -template +_EXPORT_STD template requires three_way_comparable::pointer> _NODISCARD _CONSTEXPR23 compare_three_way_result_t::pointer> operator<=>( const unique_ptr<_Ty, _Dx>& _Left, nullptr_t) { @@ -3594,7 +3594,7 @@ template struct _Can_stream_unique_ptr<_OutTy, _PxTy, void_t() << _STD declval<_PxTy>().get())>> : true_type {}; -template &, const unique_ptr<_Yty, _Dx>&>::value, int> = 0> basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Out, const unique_ptr<_Yty, _Dx>& _Px) { // write contained pointer to stream @@ -3603,25 +3603,25 @@ basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Out, c } #if _HAS_GARBAGE_COLLECTION_SUPPORT_DELETED_IN_CXX23 -enum class pointer_safety { relaxed, preferred, strict }; +_EXPORT_STD enum class pointer_safety { relaxed, preferred, strict }; -inline void declare_reachable(void*) {} +_EXPORT_STD inline void declare_reachable(void*) {} -template +_EXPORT_STD template _Ty* undeclare_reachable(_Ty* _Ptr) { return _Ptr; } -inline void declare_no_pointers(char*, size_t) {} +_EXPORT_STD inline void declare_no_pointers(char*, size_t) {} -inline void undeclare_no_pointers(char*, size_t) {} +_EXPORT_STD inline void undeclare_no_pointers(char*, size_t) {} -inline pointer_safety get_pointer_safety() noexcept { +_EXPORT_STD inline pointer_safety get_pointer_safety() noexcept { return pointer_safety::relaxed; } #endif // _HAS_GARBAGE_COLLECTION_SUPPORT_DELETED_IN_CXX23 -template +_EXPORT_STD template struct owner_less; // not defined template @@ -3707,7 +3707,7 @@ struct hash> { }; #if _HAS_CXX20 -template +_EXPORT_STD template _NODISCARD_ASSUME_ALIGNED constexpr _Ty* assume_aligned(_Ty* const _Ptr) noexcept /* strengthened */ { if (_STD is_constant_evaluated()) { return _Ptr; @@ -3733,13 +3733,13 @@ struct _Shared_ptr_spin_lock { // class to manage a spin lock for shared_ptr ato } }; -template +_EXPORT_STD template _CXX20_DEPRECATE_OLD_SHARED_PTR_ATOMIC_SUPPORT _NODISCARD bool atomic_is_lock_free(const shared_ptr<_Ty>*) { // return true if atomic operations on shared_ptr<_Ty> are lock-free return false; } -template +_EXPORT_STD template _CXX20_DEPRECATE_OLD_SHARED_PTR_ATOMIC_SUPPORT _NODISCARD shared_ptr<_Ty> atomic_load_explicit( const shared_ptr<_Ty>* _Ptr, memory_order) { // load *_Ptr atomically @@ -3748,13 +3748,13 @@ _CXX20_DEPRECATE_OLD_SHARED_PTR_ATOMIC_SUPPORT _NODISCARD shared_ptr<_Ty> atomic return _Result; } -template +_EXPORT_STD template _CXX20_DEPRECATE_OLD_SHARED_PTR_ATOMIC_SUPPORT _NODISCARD shared_ptr<_Ty> atomic_load( const shared_ptr<_Ty>* _Ptr) { // load *_Ptr atomically return _STD atomic_load_explicit(_Ptr, memory_order_seq_cst); } -template +_EXPORT_STD template _CXX20_DEPRECATE_OLD_SHARED_PTR_ATOMIC_SUPPORT void atomic_store_explicit( shared_ptr<_Ty>* _Ptr, shared_ptr<_Ty> _Other, memory_order) { // store _Other to *_Ptr atomically @@ -3762,13 +3762,13 @@ _CXX20_DEPRECATE_OLD_SHARED_PTR_ATOMIC_SUPPORT void atomic_store_explicit( _Ptr->swap(_Other); } -template +_EXPORT_STD template _CXX20_DEPRECATE_OLD_SHARED_PTR_ATOMIC_SUPPORT void atomic_store( shared_ptr<_Ty>* _Ptr, shared_ptr<_Ty> _Other) { // store _Other to *_Ptr atomically _STD atomic_store_explicit(_Ptr, _STD move(_Other), memory_order_seq_cst); } -template +_EXPORT_STD template _CXX20_DEPRECATE_OLD_SHARED_PTR_ATOMIC_SUPPORT shared_ptr<_Ty> atomic_exchange_explicit( shared_ptr<_Ty>* _Ptr, shared_ptr<_Ty> _Other, memory_order) { // copy _Other to *_Ptr and return previous value of *_Ptr atomically @@ -3777,14 +3777,14 @@ _CXX20_DEPRECATE_OLD_SHARED_PTR_ATOMIC_SUPPORT shared_ptr<_Ty> atomic_exchange_e return _Other; } -template +_EXPORT_STD template _CXX20_DEPRECATE_OLD_SHARED_PTR_ATOMIC_SUPPORT shared_ptr<_Ty> atomic_exchange( shared_ptr<_Ty>* _Ptr, shared_ptr<_Ty> _Other) { // copy _Other to *_Ptr and return previous value of *_Ptr atomically return _STD atomic_exchange_explicit(_Ptr, _STD move(_Other), memory_order_seq_cst); } -template +_EXPORT_STD template _CXX20_DEPRECATE_OLD_SHARED_PTR_ATOMIC_SUPPORT bool atomic_compare_exchange_weak_explicit(shared_ptr<_Ty>* _Ptr, shared_ptr<_Ty>* _Exp, shared_ptr<_Ty> _Value, memory_order, memory_order) { // atomically compare and exchange shared_ptr<_Ty> _Old_exp; // destroyed outside spin lock @@ -3799,7 +3799,7 @@ _CXX20_DEPRECATE_OLD_SHARED_PTR_ATOMIC_SUPPORT bool atomic_compare_exchange_weak return _Success; } -template +_EXPORT_STD template _CXX20_DEPRECATE_OLD_SHARED_PTR_ATOMIC_SUPPORT bool atomic_compare_exchange_weak( shared_ptr<_Ty>* _Ptr, shared_ptr<_Ty>* _Exp, shared_ptr<_Ty> _Value) { // atomically compare and exchange @@ -3807,14 +3807,14 @@ _CXX20_DEPRECATE_OLD_SHARED_PTR_ATOMIC_SUPPORT bool atomic_compare_exchange_weak _Ptr, _Exp, _STD move(_Value), memory_order_seq_cst, memory_order_seq_cst); } -template +_EXPORT_STD template _CXX20_DEPRECATE_OLD_SHARED_PTR_ATOMIC_SUPPORT bool atomic_compare_exchange_strong_explicit(shared_ptr<_Ty>* _Ptr, shared_ptr<_Ty>* _Exp, shared_ptr<_Ty> _Value, memory_order, memory_order) { // atomically compare and exchange return _STD atomic_compare_exchange_weak_explicit( _Ptr, _Exp, _STD move(_Value), memory_order_seq_cst, memory_order_seq_cst); } -template +_EXPORT_STD template _CXX20_DEPRECATE_OLD_SHARED_PTR_ATOMIC_SUPPORT bool atomic_compare_exchange_strong( shared_ptr<_Ty>* _Ptr, shared_ptr<_Ty>* _Exp, shared_ptr<_Ty> _Value) { // atomically compare and exchange @@ -4142,7 +4142,7 @@ concept _Resettable_pointer = requires(_SmartPtr& _Smart_ptr, _Pointer _Ptr, _Ar _Smart_ptr.reset(static_cast<_Sp>(_Ptr), _STD forward<_ArgsT>(_Args)...); }; -template +_EXPORT_STD template class out_ptr_t { static_assert(!_Is_specialization_v<_SmartPtr, shared_ptr> || sizeof...(_ArgsT) != 0, "out_ptr_t with shared_ptr requires a deleter (N4892 [out.ptr.t]/3)"); @@ -4198,7 +4198,7 @@ private: _Compressed_pair, _Pointer> _Mypair; }; -template +_EXPORT_STD template _NODISCARD auto out_ptr(_SmartPtr& _Smart_ptr, _ArgsT&&... _Args) { if constexpr (is_void_v<_Pointer>) { return out_ptr_t<_SmartPtr, _Pointer_of<_SmartPtr>, _ArgsT&&...>(_Smart_ptr, _STD forward<_ArgsT>(_Args)...); @@ -4207,7 +4207,7 @@ _NODISCARD auto out_ptr(_SmartPtr& _Smart_ptr, _ArgsT&&... _Args) { } } -template +_EXPORT_STD template class inout_ptr_t { static_assert(!_Is_specialization_v<_SmartPtr, shared_ptr>, "inout_ptr_t doesn't work with shared_ptr (N4892 [inout.ptr.t]/3)"); @@ -4278,7 +4278,7 @@ private: _Compressed_pair, _Pointer> _Mypair; }; -template +_EXPORT_STD template _NODISCARD auto inout_ptr(_SmartPtr& _Smart_ptr, _ArgsT&&... _Args) { if constexpr (is_void_v<_Pointer>) { return inout_ptr_t<_SmartPtr, _Pointer_of<_SmartPtr>, _ArgsT&&...>(_Smart_ptr, _STD forward<_ArgsT>(_Args)...); diff --git a/stl/inc/memory_resource b/stl/inc/memory_resource index 743809c9bd..90a6214ada 100644 --- a/stl/inc/memory_resource +++ b/stl/inc/memory_resource @@ -35,7 +35,7 @@ namespace pmr { extern "C" _CRT_SATELLITE_1 memory_resource* __cdecl _Aligned_set_default_resource(memory_resource*) noexcept; extern "C" _CRT_SATELLITE_1 memory_resource* __cdecl _Unaligned_set_default_resource(memory_resource*) noexcept; - inline memory_resource* set_default_resource(memory_resource* const _Resource) noexcept { + _EXPORT_STD inline memory_resource* set_default_resource(memory_resource* const _Resource) noexcept { #ifdef __cpp_aligned_new return _Aligned_set_default_resource(_Resource); #else // ^^^ __cpp_aligned_new / !__cpp_aligned_new vvv @@ -43,7 +43,7 @@ namespace pmr { #endif // __cpp_aligned_new } - extern "C" _NODISCARD _CRT_SATELLITE_1 memory_resource* __cdecl null_memory_resource() noexcept; + _EXPORT_STD extern "C" _NODISCARD _CRT_SATELLITE_1 memory_resource* __cdecl null_memory_resource() noexcept; class _Identity_equal_resource : public memory_resource { protected: @@ -92,13 +92,13 @@ namespace pmr { extern "C" _CRT_SATELLITE_1 _Aligned_new_delete_resource_impl* __cdecl _Aligned_new_delete_resource() noexcept; - _NODISCARD inline memory_resource* new_delete_resource() noexcept { + _EXPORT_STD _NODISCARD inline memory_resource* new_delete_resource() noexcept { return _Aligned_new_delete_resource(); } #else // ^^^ __cpp_aligned_new / !__cpp_aligned_new vvv - _NODISCARD inline memory_resource* new_delete_resource() noexcept { + _EXPORT_STD _NODISCARD inline memory_resource* new_delete_resource() noexcept { return _Unaligned_new_delete_resource(); } #endif // __cpp_aligned_new @@ -215,7 +215,7 @@ namespace pmr { _Link_type* _Head = nullptr; }; - struct pool_options { + _EXPORT_STD struct pool_options { size_t max_blocks_per_chunk = 0; size_t largest_required_pool_block = 0; }; @@ -227,7 +227,7 @@ namespace pmr { (void) _Align; } - struct unsynchronized_pool_resource : _Identity_equal_resource { + _EXPORT_STD struct unsynchronized_pool_resource : _Identity_equal_resource { unsynchronized_pool_resource() noexcept { // initialize pool with default options and default upstream _Setup_options(); } @@ -566,7 +566,7 @@ namespace pmr { }; #ifndef _M_CEE - class synchronized_pool_resource : public unsynchronized_pool_resource { + _EXPORT_STD class synchronized_pool_resource : public unsynchronized_pool_resource { public: using unsynchronized_pool_resource::unsynchronized_pool_resource; @@ -591,7 +591,7 @@ namespace pmr { }; #endif // _M_CEE - class monotonic_buffer_resource : public _Identity_equal_resource { + _EXPORT_STD class monotonic_buffer_resource : public _Identity_equal_resource { public: explicit monotonic_buffer_resource(memory_resource* const _Upstream) noexcept // strengthened : _Resource{_Upstream} {} // initialize this resource with upstream diff --git a/stl/inc/mutex b/stl/inc/mutex index 2dcf035208..de0537c068 100644 --- a/stl/inc/mutex +++ b/stl/inc/mutex @@ -30,8 +30,8 @@ _STL_DISABLE_CLANG_WARNINGS _STD_BEGIN // mutex and recursive_mutex are not supported under /clr #ifndef _M_CEE -class condition_variable; -class condition_variable_any; +_EXPORT_STD class condition_variable; +_EXPORT_STD class condition_variable_any; class _Mutex_base { // base class for all mutex types public: @@ -83,7 +83,7 @@ private: } }; -class mutex : public _Mutex_base { // class for mutual exclusion +_EXPORT_STD class mutex : public _Mutex_base { // class for mutual exclusion public: /* constexpr */ mutex() noexcept // TRANSITION, ABI : _Mutex_base() {} @@ -92,7 +92,7 @@ public: mutex& operator=(const mutex&) = delete; }; -class recursive_mutex : public _Mutex_base { // class for recursive mutual exclusion +_EXPORT_STD class recursive_mutex : public _Mutex_base { // class for recursive mutual exclusion public: recursive_mutex() : _Mutex_base(_Mtx_recursive) {} @@ -105,23 +105,23 @@ public: }; #endif // _M_CEE -struct adopt_lock_t { // indicates adopt lock +_EXPORT_STD struct adopt_lock_t { // indicates adopt lock explicit adopt_lock_t() = default; }; -struct defer_lock_t { // indicates defer lock +_EXPORT_STD struct defer_lock_t { // indicates defer lock explicit defer_lock_t() = default; }; -struct try_to_lock_t { // indicates try to lock +_EXPORT_STD struct try_to_lock_t { // indicates try to lock explicit try_to_lock_t() = default; }; -_INLINE_VAR constexpr adopt_lock_t adopt_lock{}; -_INLINE_VAR constexpr defer_lock_t defer_lock{}; -_INLINE_VAR constexpr try_to_lock_t try_to_lock{}; +_EXPORT_STD _INLINE_VAR constexpr adopt_lock_t adopt_lock{}; +_EXPORT_STD _INLINE_VAR constexpr defer_lock_t defer_lock{}; +_EXPORT_STD _INLINE_VAR constexpr try_to_lock_t try_to_lock{}; -template +_EXPORT_STD template class unique_lock { // whizzy class with destructor that unlocks mutex public: using mutex_type = _Mutex; @@ -272,7 +272,7 @@ private: } }; -template +_EXPORT_STD template void swap(unique_lock<_Mutex>& _Left, unique_lock<_Mutex>& _Right) noexcept { _Left.swap(_Right); } @@ -346,7 +346,7 @@ int _Try_lock1(_Lock0& _Lk0, _Lock1& _Lk1) { return -1; } -template +_EXPORT_STD template _NODISCARD_TRY_CHANGE_STATE int try_lock(_Lock0& _Lk0, _Lock1& _Lk1, _LockN&... _LkN) { // try to lock multiple locks return _Try_lock1(_Lk0, _Lk1, _LkN...); } @@ -413,12 +413,12 @@ void _Lock_nonmember1(_Lock0& _Lk0, _Lock1& _Lk1) { } } -template +_EXPORT_STD template void lock(_Lock0& _Lk0, _Lock1& _Lk1, _LockN&... _LkN) { // lock multiple locks, without deadlock _Lock_nonmember1(_Lk0, _Lk1, _LkN...); } -template +_EXPORT_STD template class _NODISCARD_LOCK lock_guard { // class with destructor that unlocks a mutex public: using mutex_type = _Mutex; @@ -441,7 +441,7 @@ private: }; #if _HAS_CXX17 -template +_EXPORT_STD template class _NODISCARD_LOCK scoped_lock { // class with destructor that unlocks mutexes public: explicit scoped_lock(_Mutexes&... _Mtxes) : _MyMutexes(_Mtxes...) { // construct and lock @@ -543,7 +543,7 @@ struct _Init_once_completer { } }; -template +_EXPORT_STD template void(call_once)(once_flag& _Once, _Fn&& _Fx, _Args&&... _Ax) noexcept( noexcept(_STD invoke(_STD forward<_Fn>(_Fx), _STD forward<_Args>(_Ax)...))) /* strengthened */ { // call _Fx(_Ax...) once @@ -565,12 +565,12 @@ void(call_once)(once_flag& _Once, _Fn&& _Fx, _Args&&... _Ax) noexcept( // condition_variable, timed_mutex, and recursive_timed_mutex are not supported under /clr #ifndef _M_CEE -enum class cv_status { // names for wait returns +_EXPORT_STD enum class cv_status { // names for wait returns no_timeout, timeout }; -class condition_variable { // class for waiting for conditions +_EXPORT_STD class condition_variable { // class for waiting for conditions public: using native_handle_type = _Cnd_t; @@ -744,7 +744,7 @@ struct _UInt_is_zero { } }; -class timed_mutex { // class for timed mutual exclusion +_EXPORT_STD class timed_mutex { // class for timed mutual exclusion public: timed_mutex() noexcept : _My_locked(0) {} @@ -815,7 +815,7 @@ private: unsigned int _My_locked; }; -class recursive_timed_mutex { // class for recursive timed mutual exclusion +_EXPORT_STD class recursive_timed_mutex { // class for recursive timed mutual exclusion public: recursive_timed_mutex() noexcept : _My_locked(0) {} diff --git a/stl/inc/new b/stl/inc/new index da0f276cfd..d697a4e9f1 100644 --- a/stl/inc/new +++ b/stl/inc/new @@ -18,16 +18,78 @@ _STL_DISABLE_CLANG_WARNINGS #pragma push_macro("new") #undef new +#ifdef _BUILD_STD_MODULE +#pragma warning(push) +#pragma warning(disable : 28251) // Inconsistent annotation for 'new': this instance has no annotations. + +// Mirroring declarations: + +_STD_BEGIN +_EXPORT_STD extern "C++" struct nothrow_t; +_EXPORT_STD extern "C++" const nothrow_t nothrow; +_STD_END + +_EXPORT_STD extern "C++" _NODISCARD _VCRT_ALLOCATOR void* __CRTDECL operator new(size_t); +_EXPORT_STD extern "C++" _NODISCARD _VCRT_ALLOCATOR void* __CRTDECL operator new( + size_t, const _STD nothrow_t&) noexcept; +_EXPORT_STD extern "C++" _NODISCARD _VCRT_ALLOCATOR void* __CRTDECL operator new[](size_t); +_EXPORT_STD extern "C++" _NODISCARD _VCRT_ALLOCATOR void* __CRTDECL operator new[]( + size_t, const _STD nothrow_t&) noexcept; +_EXPORT_STD extern "C++" void __CRTDECL operator delete(void*) noexcept; +_EXPORT_STD extern "C++" void __CRTDECL operator delete(void*, size_t) noexcept; +_EXPORT_STD extern "C++" void __CRTDECL operator delete(void*, const _STD nothrow_t&) noexcept; +_EXPORT_STD extern "C++" void __CRTDECL operator delete[](void*) noexcept; +_EXPORT_STD extern "C++" void __CRTDECL operator delete[](void*, size_t) noexcept; +_EXPORT_STD extern "C++" void __CRTDECL operator delete[](void*, const _STD nothrow_t&) noexcept; + +#ifdef __cpp_aligned_new _STD_BEGIN +#ifdef __EDG__ // TRANSITION, VSO-1618988 +extern "C++" { +_EXPORT_STD enum class align_val_t : size_t; +} +#else // ^^^ workaround / no workaround vvv +_EXPORT_STD extern "C++" enum class align_val_t : size_t; +#endif // ^^^ no workaround ^^^ +_STD_END + +_EXPORT_STD extern "C++" _NODISCARD _VCRT_ALLOCATOR void* __CRTDECL operator new(size_t, _STD align_val_t); +_EXPORT_STD extern "C++" _NODISCARD _VCRT_ALLOCATOR void* __CRTDECL operator new( + size_t, _STD align_val_t, const _STD nothrow_t&) noexcept; +_EXPORT_STD extern "C++" _NODISCARD _VCRT_ALLOCATOR void* __CRTDECL operator new[](size_t, _STD align_val_t); +_EXPORT_STD extern "C++" _NODISCARD _VCRT_ALLOCATOR void* __CRTDECL operator new[]( + size_t, _STD align_val_t, const _STD nothrow_t&) noexcept; +_EXPORT_STD extern "C++" void __CRTDECL operator delete(void*, _STD align_val_t) noexcept; +_EXPORT_STD extern "C++" void __CRTDECL operator delete(void*, size_t, _STD align_val_t) noexcept; +_EXPORT_STD extern "C++" void __CRTDECL operator delete(void*, _STD align_val_t, const _STD nothrow_t&) noexcept; +_EXPORT_STD extern "C++" void __CRTDECL operator delete[](void*, _STD align_val_t) noexcept; +_EXPORT_STD extern "C++" void __CRTDECL operator delete[](void*, size_t, _STD align_val_t) noexcept; +_EXPORT_STD extern "C++" void __CRTDECL operator delete[](void*, _STD align_val_t, const _STD nothrow_t&) noexcept; +#endif // __cpp_aligned_new + +_EXPORT_STD extern "C++" _NODISCARD void* __CRTDECL operator new(size_t, void*) noexcept; +_EXPORT_STD extern "C++" _NODISCARD void* __CRTDECL operator new[](size_t, void*) noexcept; +_EXPORT_STD extern "C++" void __CRTDECL operator delete(void*, void*) noexcept; +_EXPORT_STD extern "C++" void __CRTDECL operator delete[](void*, void*) noexcept; + +#pragma warning(pop) +#endif // _BUILD_STD_MODULE + +_STD_BEGIN +#if _HAS_EXCEPTIONS +_EXPORT_STD class bad_alloc; +_EXPORT_STD class bad_array_new_length; +#else // ^^^ _HAS_EXCEPTIONS / !_HAS_EXCEPTIONS vvv +// exports bad_alloc and bad_array_new_length. +#endif // ^^^ !_HAS_EXCEPTIONS ^^^ + #if _HAS_CXX20 -struct destroying_delete_t { - explicit destroying_delete_t() = default; -}; -inline constexpr destroying_delete_t destroying_delete{}; +_EXPORT_STD struct destroying_delete_t { explicit destroying_delete_t() = default; }; +_EXPORT_STD inline constexpr destroying_delete_t destroying_delete{}; #endif // _HAS_CXX20 #if _HAS_CXX17 -template +_EXPORT_STD template _NODISCARD_LAUNDER constexpr _Ty* launder(_Ty* _Ptr) noexcept { static_assert(!is_function_v<_Ty> && !is_void_v<_Ty>, "N4727 21.6.4 [ptr.launder]/3: The program is ill-formed if T is a function type or cv void."); @@ -35,18 +97,18 @@ _NODISCARD_LAUNDER constexpr _Ty* launder(_Ty* _Ptr) noexcept { } #if defined(_M_IX86) || defined(_M_X64) || defined(_M_ARM) || defined(_M_ARM64) -inline constexpr size_t hardware_constructive_interference_size = 64; -inline constexpr size_t hardware_destructive_interference_size = 64; +_EXPORT_STD inline constexpr size_t hardware_constructive_interference_size = 64; +_EXPORT_STD inline constexpr size_t hardware_destructive_interference_size = 64; #else // ^^^ supported hardware ^^^ // vvv unsupported hardware vvv #error Unsupported architecture #endif // hardware #endif // _HAS_CXX17 -using new_handler = void(__CLRCALL_PURE_OR_CDECL*)(); +_EXPORT_STD using new_handler = void(__CLRCALL_PURE_OR_CDECL*)(); -_CRTIMP2 new_handler __cdecl set_new_handler(_In_opt_ new_handler) noexcept; -_NODISCARD _CRTIMP2 new_handler __cdecl get_new_handler() noexcept; +_EXPORT_STD extern "C++" _CRTIMP2 new_handler __cdecl set_new_handler(_In_opt_ new_handler) noexcept; +_EXPORT_STD extern "C++" _NODISCARD _CRTIMP2 new_handler __cdecl get_new_handler() noexcept; _STD_END #pragma pop_macro("new") diff --git a/stl/inc/numbers b/stl/inc/numbers index 884c349a45..af5d9e4cec 100644 --- a/stl/inc/numbers +++ b/stl/inc/numbers @@ -32,31 +32,31 @@ namespace numbers { "variable template is ill-formed. (N4835 [math.constants]/3)"); }; - template + _EXPORT_STD template inline constexpr _Ty e_v = _Invalid<_Ty>{}; - template + _EXPORT_STD template inline constexpr _Ty log2e_v = _Invalid<_Ty>{}; - template + _EXPORT_STD template inline constexpr _Ty log10e_v = _Invalid<_Ty>{}; - template + _EXPORT_STD template inline constexpr _Ty pi_v = _Invalid<_Ty>{}; - template + _EXPORT_STD template inline constexpr _Ty inv_pi_v = _Invalid<_Ty>{}; - template + _EXPORT_STD template inline constexpr _Ty inv_sqrtpi_v = _Invalid<_Ty>{}; - template + _EXPORT_STD template inline constexpr _Ty ln2_v = _Invalid<_Ty>{}; - template + _EXPORT_STD template inline constexpr _Ty ln10_v = _Invalid<_Ty>{}; - template + _EXPORT_STD template inline constexpr _Ty sqrt2_v = _Invalid<_Ty>{}; - template + _EXPORT_STD template inline constexpr _Ty sqrt3_v = _Invalid<_Ty>{}; - template + _EXPORT_STD template inline constexpr _Ty inv_sqrt3_v = _Invalid<_Ty>{}; - template + _EXPORT_STD template inline constexpr _Ty egamma_v = _Invalid<_Ty>{}; - template + _EXPORT_STD template inline constexpr _Ty phi_v = _Invalid<_Ty>{}; #ifdef __cpp_lib_concepts @@ -169,19 +169,19 @@ namespace numbers { inline constexpr long double phi_v = phi_v; #endif // ^^^ !defined(__cpp_lib_concepts) ^^^ - inline constexpr double e = e_v; - inline constexpr double log2e = log2e_v; - inline constexpr double log10e = log10e_v; - inline constexpr double pi = pi_v; - inline constexpr double inv_pi = inv_pi_v; - inline constexpr double inv_sqrtpi = inv_sqrtpi_v; - inline constexpr double ln2 = ln2_v; - inline constexpr double ln10 = ln10_v; - inline constexpr double sqrt2 = sqrt2_v; - inline constexpr double sqrt3 = sqrt3_v; - inline constexpr double inv_sqrt3 = inv_sqrt3_v; - inline constexpr double egamma = egamma_v; - inline constexpr double phi = phi_v; + _EXPORT_STD inline constexpr double e = e_v; + _EXPORT_STD inline constexpr double log2e = log2e_v; + _EXPORT_STD inline constexpr double log10e = log10e_v; + _EXPORT_STD inline constexpr double pi = pi_v; + _EXPORT_STD inline constexpr double inv_pi = inv_pi_v; + _EXPORT_STD inline constexpr double inv_sqrtpi = inv_sqrtpi_v; + _EXPORT_STD inline constexpr double ln2 = ln2_v; + _EXPORT_STD inline constexpr double ln10 = ln10_v; + _EXPORT_STD inline constexpr double sqrt2 = sqrt2_v; + _EXPORT_STD inline constexpr double sqrt3 = sqrt3_v; + _EXPORT_STD inline constexpr double inv_sqrt3 = inv_sqrt3_v; + _EXPORT_STD inline constexpr double egamma = egamma_v; + _EXPORT_STD inline constexpr double phi = phi_v; } // namespace numbers _STD_END diff --git a/stl/inc/numeric b/stl/inc/numeric index 1f2c2d65e6..3b8b9495e9 100644 --- a/stl/inc/numeric +++ b/stl/inc/numeric @@ -21,7 +21,7 @@ _STL_DISABLE_CLANG_WARNINGS #pragma push_macro("new") #undef new _STD_BEGIN -template +_EXPORT_STD template _NODISCARD _CONSTEXPR20 _Ty accumulate(const _InIt _First, const _InIt _Last, _Ty _Val, _Fn _Reduce_op) { // return noncommutative and nonassociative reduction of _Val and all in [_First, _Last), using _Reduce_op _Adl_verify_range(_First, _Last); @@ -37,7 +37,7 @@ _NODISCARD _CONSTEXPR20 _Ty accumulate(const _InIt _First, const _InIt _Last, _T return _Val; } -template +_EXPORT_STD template _NODISCARD _CONSTEXPR20 _Ty accumulate(const _InIt _First, const _InIt _Last, _Ty _Val) { // return noncommutative and nonassociative reduction of _Val and all in [_First, _Last) return _STD accumulate(_First, _Last, _Val, plus<>{}); @@ -67,7 +67,7 @@ template inline constexpr bool _Plus_on_arithmetic_ranges_reduction_v = false; #endif // _STD_VECTORIZE_WITH_FLOAT_CONTROL -template +_EXPORT_STD template _NODISCARD _CONSTEXPR20 _Ty reduce(const _InIt _First, const _InIt _Last, _Ty _Val, _BinOp _Reduce_op) { // return commutative and associative reduction of _Val and [_First, _Last), using _Reduce_op _Adl_verify_range(_First, _Last); @@ -89,30 +89,30 @@ _NODISCARD _CONSTEXPR20 _Ty reduce(const _InIt _First, const _InIt _Last, _Ty _V return _Val; } -template +_EXPORT_STD template _NODISCARD _CONSTEXPR20 _Ty reduce(const _InIt _First, const _InIt _Last, _Ty _Val) { // return commutative and associative reduction of _Val and [_First, _Last) return _STD reduce(_First, _Last, _STD move(_Val), plus{}); } -template +_EXPORT_STD template _NODISCARD _CONSTEXPR20 _Iter_value_t<_InIt> reduce(const _InIt _First, const _InIt _Last) { // return commutative and associative reduction of // iterator_traits<_InIt>::value_type{} and [_First, _Last) return _STD reduce(_First, _Last, _Iter_value_t<_InIt>{}, plus{}); } -template = 0> +_EXPORT_STD template = 0> _NODISCARD _Ty reduce(_ExPo&& _Exec, _FwdIt _First, _FwdIt _Last, _Ty _Val, _BinOp _Reduce_op) noexcept; // terminates -template = 0> +_EXPORT_STD template = 0> _NODISCARD _Ty reduce(_ExPo&& _Exec, const _FwdIt _First, const _FwdIt _Last, _Ty _Val) noexcept /* terminates */ { // return commutative and associative reduction of _Val and [_First, _Last) _REQUIRE_PARALLEL_ITERATOR(_FwdIt); return _STD reduce(_STD forward<_ExPo>(_Exec), _First, _Last, _STD move(_Val), plus{}); } -template = 0> +_EXPORT_STD template = 0> _NODISCARD _Iter_value_t<_FwdIt> reduce(_ExPo&& _Exec, const _FwdIt _First, const _FwdIt _Last) noexcept /* terminates */ { // return commutative and associative reduction of @@ -122,7 +122,7 @@ _NODISCARD _Iter_value_t<_FwdIt> reduce(_ExPo&& _Exec, const _FwdIt _First, cons } #endif // _HAS_CXX17 -template +_EXPORT_STD template _NODISCARD _CONSTEXPR20 _Ty inner_product( _InIt1 _First1, _InIt1 _Last1, _InIt2 _First2, _Ty _Val, _BinOp1 _Reduce_op, _BinOp2 _Transform_op) { // return noncommutative and nonassociative transform-reduction of sequences, using @@ -142,7 +142,7 @@ _NODISCARD _CONSTEXPR20 _Ty inner_product( return _Val; } -template +_EXPORT_STD template _NODISCARD _CONSTEXPR20 _Ty inner_product(const _InIt1 _First1, const _InIt1 _Last1, const _InIt2 _First2, _Ty _Val) { // return noncommutative and nonassociative transform-reduction of sequences return _STD inner_product(_First1, _Last1, _First2, _STD move(_Val), plus<>{}, multiplies<>{}); @@ -172,7 +172,7 @@ template inline constexpr bool _Default_ops_transform_reduce_v = false; #endif // _STD_VECTORIZE_WITH_FLOAT_CONTROL -template +_EXPORT_STD template _NODISCARD _CONSTEXPR20 _Ty transform_reduce( _InIt1 _First1, _InIt1 _Last1, _InIt2 _First2, _Ty _Val, _BinOp1 _Reduce_op, _BinOp2 _Transform_op) { // return commutative and associative transform-reduction of sequences, using @@ -198,13 +198,13 @@ _NODISCARD _CONSTEXPR20 _Ty transform_reduce( return _Val; } -template +_EXPORT_STD template _NODISCARD _CONSTEXPR20 _Ty transform_reduce(_InIt1 _First1, _InIt1 _Last1, _InIt2 _First2, _Ty _Val) { // return commutative and associative transform-reduction of sequences return _STD transform_reduce(_First1, _Last1, _First2, _STD move(_Val), plus{}, multiplies{}); } -template +_EXPORT_STD template _NODISCARD _CONSTEXPR20 _Ty transform_reduce( const _InIt _First, const _InIt _Last, _Ty _Val, _BinOp _Reduce_op, _UnaryOp _Transform_op) { // return commutative and associative reduction of transformed sequence, using @@ -219,12 +219,12 @@ _NODISCARD _CONSTEXPR20 _Ty transform_reduce( return _Val; } -template = 0> _NODISCARD _Ty transform_reduce(_ExPo&& _Exec, _FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _First2, _Ty _Val, _BinOp1 _Reduce_op, _BinOp2 _Transform_op) noexcept; // terminates -template = 0> +_EXPORT_STD template = 0> _NODISCARD _Ty transform_reduce(_ExPo&& _Exec, _FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _First2, _Ty _Val) noexcept /* terminates */ { // return commutative and associative transform-reduction of sequences @@ -234,12 +234,13 @@ _NODISCARD _Ty transform_reduce(_ExPo&& _Exec, _FwdIt1 _First1, _FwdIt1 _Last1, _STD forward<_ExPo>(_Exec), _First1, _Last1, _First2, _STD move(_Val), plus{}, multiplies{}); } -template = 0> +_EXPORT_STD template = 0> _NODISCARD _Ty transform_reduce(_ExPo&& _Exec, const _FwdIt _First1, const _FwdIt _Last1, _Ty _Val, _BinOp _Reduce_op, _UnaryOp _Transform_op) noexcept; // terminates #endif // _HAS_CXX17 -template +_EXPORT_STD template _CONSTEXPR20 _OutIt partial_sum(const _InIt _First, const _InIt _Last, _OutIt _Dest, _BinOp _Reduce_op) { // compute partial noncommutative and nonassociative reductions into _Dest, using _Reduce_op _Adl_verify_range(_First, _Last); @@ -268,14 +269,14 @@ _CONSTEXPR20 _OutIt partial_sum(const _InIt _First, const _InIt _Last, _OutIt _D return _Dest; } -template +_EXPORT_STD template _CONSTEXPR20 _OutIt partial_sum(_InIt _First, _InIt _Last, _OutIt _Dest) { // compute partial noncommutative and nonassociative reductions into _Dest return _STD partial_sum(_First, _Last, _Dest, plus<>{}); } #if _HAS_CXX17 -template +_EXPORT_STD template _CONSTEXPR20 _OutIt exclusive_scan(const _InIt _First, const _InIt _Last, _OutIt _Dest, _Ty _Val, _BinOp _Reduce_op) { // set each value in [_Dest, _Dest + (_Last - _First)) to the associative reduction of predecessors and _Val _Adl_verify_range(_First, _Last); @@ -300,24 +301,25 @@ _CONSTEXPR20 _OutIt exclusive_scan(const _InIt _First, const _InIt _Last, _OutIt return _Dest; } -template +_EXPORT_STD template _CONSTEXPR20 _OutIt exclusive_scan(const _InIt _First, const _InIt _Last, const _OutIt _Dest, _Ty _Val) { // set each value in [_Dest, _Dest + (_Last - _First)) to the associative reduction of predecessors and _Val return _STD exclusive_scan(_First, _Last, _Dest, _STD move(_Val), plus{}); } -template = 0> +_EXPORT_STD template = 0> _FwdIt2 exclusive_scan(_ExPo&& _Exec, const _FwdIt1 _First, const _FwdIt1 _Last, _FwdIt2 _Dest, _Ty _Val, _BinOp _Reduce_op) noexcept; // terminates -template = 0> +_EXPORT_STD template = 0> _FwdIt2 exclusive_scan(_ExPo&& _Exec, const _FwdIt1 _First, const _FwdIt1 _Last, const _FwdIt2 _Dest, _Ty _Val) noexcept /* terminates */ { // set each value in [_Dest, _Dest + (_Last - _First)) to the associative reduction of predecessors and _Val return _STD exclusive_scan(_STD forward<_ExPo>(_Exec), _First, _Last, _Dest, _STD move(_Val), plus{}); } -template +_EXPORT_STD template _CONSTEXPR20 _OutIt inclusive_scan(const _InIt _First, const _InIt _Last, _OutIt _Dest, _BinOp _Reduce_op, _Ty _Val) { // compute partial noncommutative and associative reductions including _Val into _Dest, using _Reduce_op _Adl_verify_range(_First, _Last); @@ -334,7 +336,7 @@ _CONSTEXPR20 _OutIt inclusive_scan(const _InIt _First, const _InIt _Last, _OutIt return _Dest; } -template +_EXPORT_STD template _CONSTEXPR20 _OutIt inclusive_scan(const _InIt _First, const _InIt _Last, _OutIt _Dest, _BinOp _Reduce_op) { // compute partial noncommutative and associative reductions into _Dest, using _Reduce_op _Adl_verify_range(_First, _Last); @@ -359,28 +361,29 @@ _CONSTEXPR20 _OutIt inclusive_scan(const _InIt _First, const _InIt _Last, _OutIt return _Dest; } -template +_EXPORT_STD template _CONSTEXPR20 _OutIt inclusive_scan(const _InIt _First, const _InIt _Last, const _OutIt _Dest) { // compute partial noncommutative and associative reductions into _Dest return _STD inclusive_scan(_First, _Last, _Dest, plus{}); } -template = 0> +_EXPORT_STD template = 0> _FwdIt2 inclusive_scan( _ExPo&& _Exec, _FwdIt1 _First, _FwdIt1 _Last, _FwdIt2 _Dest, _BinOp _Reduce_op, _Ty _Val) noexcept; // terminates -template = 0> +_EXPORT_STD template = 0> _FwdIt2 inclusive_scan( _ExPo&& _Exec, _FwdIt1 _First, _FwdIt1 _Last, _FwdIt2 _Dest, _BinOp _Reduce_op) noexcept; // terminates -template = 0> +_EXPORT_STD template = 0> _FwdIt2 inclusive_scan(_ExPo&& _Exec, const _FwdIt1 _First, const _FwdIt1 _Last, const _FwdIt2 _Dest) noexcept /* terminates */ { // compute partial noncommutative and associative reductions into _Dest return _STD inclusive_scan(_STD forward<_ExPo>(_Exec), _First, _Last, _Dest, plus{}); } -template +_EXPORT_STD template _CONSTEXPR20 _OutIt transform_exclusive_scan( const _InIt _First, const _InIt _Last, _OutIt _Dest, _Ty _Val, _BinOp _Reduce_op, _UnaryOp _Transform_op) { // set each value in [_Dest, _Dest + (_Last - _First)) to the associative reduction of transformed predecessors @@ -406,12 +409,12 @@ _CONSTEXPR20 _OutIt transform_exclusive_scan( return _Dest; } -template = 0> _OutIt transform_exclusive_scan(_ExPo&& _Exec, const _FwdIt1 _First, const _FwdIt1 _Last, _OutIt _Dest, _Ty _Val, _BinOp _Reduce_op, _UnaryOp _Transform_op) noexcept; // terminates -template +_EXPORT_STD template _CONSTEXPR20 _OutIt transform_inclusive_scan( const _InIt _First, const _InIt _Last, _OutIt _Dest, _BinOp _Reduce_op, _UnaryOp _Transform_op, _Ty _Val) { // compute partial noncommutative and associative transformed reductions including _Val into _Dest @@ -429,7 +432,7 @@ _CONSTEXPR20 _OutIt transform_inclusive_scan( return _Dest; } -template +_EXPORT_STD template _CONSTEXPR20 _OutIt transform_inclusive_scan( const _InIt _First, const _InIt _Last, _OutIt _Dest, _BinOp _Reduce_op, _UnaryOp _Transform_op) { // compute partial noncommutative and associative transformed reductions into _Dest @@ -455,18 +458,18 @@ _CONSTEXPR20 _OutIt transform_inclusive_scan( return _Dest; } -template = 0> _FwdIt2 transform_inclusive_scan(_ExPo&& _Exec, const _FwdIt1 _First, const _FwdIt1 _Last, _FwdIt2 _Dest, _BinOp _Reduce_op, _UnaryOp _Transform_op, _Ty _Val) noexcept; // terminates -template = 0> _FwdIt2 transform_inclusive_scan(_ExPo&& _Exec, const _FwdIt1 _First, const _FwdIt1 _Last, _FwdIt2 _Dest, _BinOp _Reduce_op, _UnaryOp _Transform_op) noexcept; // terminates #endif // _HAS_CXX17 -template +_EXPORT_STD template _CONSTEXPR20 _OutIt adjacent_difference(const _InIt _First, const _InIt _Last, _OutIt _Dest, _BinOp _Func) { // compute adjacent differences into _Dest _Adl_verify_range(_First, _Last); @@ -493,18 +496,18 @@ _CONSTEXPR20 _OutIt adjacent_difference(const _InIt _First, const _InIt _Last, _ return _Dest; } -template +_EXPORT_STD template _CONSTEXPR20 _OutIt adjacent_difference(const _InIt _First, const _InIt _Last, const _OutIt _Dest) { // compute adjacent differences into _Dest return _STD adjacent_difference(_First, _Last, _Dest, minus<>{}); } #if _HAS_CXX17 -template = 0> +_EXPORT_STD template = 0> _FwdIt2 adjacent_difference( _ExPo&& _Exec, const _FwdIt1 _First, const _FwdIt1 _Last, _FwdIt2 _Dest, _BinOp _Diff_op) noexcept; // terminates -template = 0> +_EXPORT_STD template = 0> _FwdIt2 adjacent_difference(_ExPo&& _Exec, const _FwdIt1 _First, const _FwdIt1 _Last, const _FwdIt2 _Dest) noexcept /* terminates */ { // compute adjacent differences into _Dest @@ -512,7 +515,7 @@ _FwdIt2 adjacent_difference(_ExPo&& _Exec, const _FwdIt1 _First, const _FwdIt1 _ } #endif // _HAS_CXX17 -template +_EXPORT_STD template _CONSTEXPR20 void iota(_FwdIt _First, _FwdIt _Last, _Ty _Val) { // compute increasing sequence into [_First, _Last) _Adl_verify_range(_First, _Last); @@ -525,7 +528,7 @@ _CONSTEXPR20 void iota(_FwdIt _First, _FwdIt _Last, _Ty _Val) { #if _HAS_CXX23 && defined(__cpp_lib_concepts) // TRANSITION, GH-395 namespace ranges { - template + _EXPORT_STD template using iota_result = out_value_result<_Out, _Ty>; class _Iota_fn : private _Not_quite_object { @@ -563,7 +566,7 @@ namespace ranges { } }; - inline constexpr _Iota_fn iota{_Not_quite_object::_Construct_tag{}}; + _EXPORT_STD inline constexpr _Iota_fn iota{_Not_quite_object::_Construct_tag{}}; } // namespace ranges #endif // _HAS_CXX23 && defined(__cpp_lib_concepts) @@ -587,7 +590,7 @@ _NODISCARD constexpr auto _Abs_u(const _Integral _Val) noexcept { } } -template +_EXPORT_STD template _NODISCARD constexpr common_type_t<_Mt, _Nt> gcd(const _Mt _Mx, const _Nt _Nx) noexcept /* strengthened */ { // calculate greatest common divisor static_assert(_Is_nonbool_integral<_Mt> && _Is_nonbool_integral<_Nt>, "GCD requires nonbool integral types"); @@ -625,7 +628,7 @@ _NODISCARD constexpr common_type_t<_Mt, _Nt> gcd(const _Mt _Mx, const _Nt _Nx) n }); } -template +_EXPORT_STD template _NODISCARD constexpr common_type_t<_Mt, _Nt> lcm(const _Mt _Mx, const _Nt _Nx) noexcept /* strengthened */ { // calculate least common multiple static_assert(_Is_nonbool_integral<_Mt> && _Is_nonbool_integral<_Nt>, "LCM requires nonbool integral types"); @@ -642,7 +645,7 @@ _NODISCARD constexpr common_type_t<_Mt, _Nt> lcm(const _Mt _Mx, const _Nt _Nx) n #endif // _HAS_CXX17 #if _HAS_CXX20 -template && !is_same_v, bool>, int> = 0> +_EXPORT_STD template && !is_same_v, bool>, int> = 0> _NODISCARD constexpr _Ty midpoint(const _Ty _Val1, const _Ty _Val2) noexcept { if constexpr (is_floating_point_v<_Ty>) { if (_STD is_constant_evaluated()) { @@ -707,7 +710,7 @@ _NODISCARD constexpr _Ty midpoint(const _Ty _Val1, const _Ty _Val2) noexcept { } } -template , int> = 0> +_EXPORT_STD template , int> = 0> _NODISCARD constexpr _Ty* midpoint(_Ty* const _Val1, _Ty* const _Val2) noexcept /* strengthened */ { if (_Val1 > _Val2) { return _Val1 - ((_Val1 - _Val2) >> 1); // shift for codegen diff --git a/stl/inc/optional b/stl/inc/optional index 9f5c788406..49173c22cd 100644 --- a/stl/inc/optional +++ b/stl/inc/optional @@ -30,13 +30,13 @@ _STL_DISABLE_CLANG_WARNINGS _STD_BEGIN -struct nullopt_t { // no-value state indicator +_EXPORT_STD struct nullopt_t { // no-value state indicator struct _Tag {}; constexpr explicit nullopt_t(_Tag) {} }; -inline constexpr nullopt_t nullopt{nullopt_t::_Tag{}}; +_EXPORT_STD inline constexpr nullopt_t nullopt{nullopt_t::_Tag{}}; -class bad_optional_access : public exception { +_EXPORT_STD class bad_optional_access : public exception { public: _NODISCARD const char* __CLR_OR_THIS_CALL what() const noexcept override { return "Bad optional access"; @@ -210,7 +210,7 @@ struct _Optional_construct_base : _Optional_destruct_base<_Ty> { } }; -template +_EXPORT_STD template class optional : private _SMF_control<_Optional_construct_base<_Ty>, _Ty> { private: using _Mybase = _SMF_control<_Optional_construct_base<_Ty>, _Ty>; @@ -615,7 +615,7 @@ public: template optional(_Ty) -> optional<_Ty>; -template +_EXPORT_STD template _NODISCARD constexpr bool operator==(const optional<_Ty1>& _Left, const optional<_Ty2>& _Right) noexcept( noexcept(_Fake_copy_init(*_Left == *_Right))) /* strengthened */ #ifdef __cpp_lib_concepts @@ -632,7 +632,7 @@ _NODISCARD constexpr bool operator==(const optional<_Ty1>& _Left, const optional return _Left_has_value == _Right_has_value; } -template +_EXPORT_STD template _NODISCARD constexpr bool operator!=(const optional<_Ty1>& _Left, const optional<_Ty2>& _Right) noexcept( noexcept(_Fake_copy_init(*_Left != *_Right))) /* strengthened */ #ifdef __cpp_lib_concepts @@ -649,7 +649,7 @@ _NODISCARD constexpr bool operator!=(const optional<_Ty1>& _Left, const optional return _Left_has_value != _Right_has_value; } -template +_EXPORT_STD template _NODISCARD constexpr bool operator<(const optional<_Ty1>& _Left, const optional<_Ty2>& _Right) noexcept( noexcept(_Fake_copy_init(*_Left < *_Right))) /* strengthened */ #ifdef __cpp_lib_concepts @@ -666,7 +666,7 @@ _NODISCARD constexpr bool operator<(const optional<_Ty1>& _Left, const optional< return _Left_has_value < _Right_has_value; } -template +_EXPORT_STD template _NODISCARD constexpr bool operator>(const optional<_Ty1>& _Left, const optional<_Ty2>& _Right) noexcept( noexcept(_Fake_copy_init(*_Left > *_Right))) /* strengthened */ #ifdef __cpp_lib_concepts @@ -683,7 +683,7 @@ _NODISCARD constexpr bool operator>(const optional<_Ty1>& _Left, const optional< return _Left_has_value > _Right_has_value; } -template +_EXPORT_STD template _NODISCARD constexpr bool operator<=(const optional<_Ty1>& _Left, const optional<_Ty2>& _Right) noexcept( noexcept(_Fake_copy_init(*_Left <= *_Right))) /* strengthened */ #ifdef __cpp_lib_concepts @@ -700,7 +700,7 @@ _NODISCARD constexpr bool operator<=(const optional<_Ty1>& _Left, const optional return _Left_has_value <= _Right_has_value; } -template +_EXPORT_STD template _NODISCARD constexpr bool operator>=(const optional<_Ty1>& _Left, const optional<_Ty2>& _Right) noexcept( noexcept(_Fake_copy_init(*_Left >= *_Right))) /* strengthened */ #ifdef __cpp_lib_concepts @@ -718,7 +718,7 @@ _NODISCARD constexpr bool operator>=(const optional<_Ty1>& _Left, const optional } #ifdef __cpp_lib_concepts -template _Ty2> +_EXPORT_STD template _Ty2> _NODISCARD constexpr compare_three_way_result_t<_Ty1, _Ty2> operator<=>(const optional<_Ty1>& _Left, const optional<_Ty2>& _Right) noexcept(noexcept(*_Left <=> *_Right)) /* strengthened */ { const bool _Left_has_value = _Left.has_value(); @@ -731,13 +731,13 @@ _NODISCARD constexpr compare_three_way_result_t<_Ty1, _Ty2> operator<=>(const op } #endif // __cpp_lib_concepts -template +_EXPORT_STD template _NODISCARD constexpr bool operator==(const optional<_Ty>& _Left, nullopt_t) noexcept { return !_Left.has_value(); } #if _HAS_CXX20 -template +_EXPORT_STD template _NODISCARD constexpr strong_ordering operator<=>(const optional<_Ty>& _Left, nullopt_t) noexcept { return _Left.has_value() <=> false; } @@ -820,7 +820,7 @@ template using _Enable_if_comparable_with_greater_equal = _Enable_if_bool_convertible() >= _STD declval())>; -template = 0> +_EXPORT_STD template = 0> _NODISCARD constexpr bool operator==(const optional<_Ty1>& _Left, const _Ty2& _Right) noexcept( noexcept(_Fake_copy_init(*_Left == _Right))) /* strengthened */ { if (_Left) { @@ -829,7 +829,7 @@ _NODISCARD constexpr bool operator==(const optional<_Ty1>& _Left, const _Ty2& _R return false; } -template = 0> +_EXPORT_STD template = 0> _NODISCARD constexpr bool operator==(const _Ty1& _Left, const optional<_Ty2>& _Right) noexcept( noexcept(_Fake_copy_init(_Left == *_Right))) /* strengthened */ { if (_Right) { @@ -838,7 +838,7 @@ _NODISCARD constexpr bool operator==(const _Ty1& _Left, const optional<_Ty2>& _R return false; } -template = 0> +_EXPORT_STD template = 0> _NODISCARD constexpr bool operator!=(const optional<_Ty1>& _Left, const _Ty2& _Right) noexcept( noexcept(_Fake_copy_init(*_Left != _Right))) /* strengthened */ { if (_Left) { @@ -846,7 +846,7 @@ _NODISCARD constexpr bool operator!=(const optional<_Ty1>& _Left, const _Ty2& _R } return true; } -template = 0> +_EXPORT_STD template = 0> _NODISCARD constexpr bool operator!=(const _Ty1& _Left, const optional<_Ty2>& _Right) noexcept( noexcept(_Fake_copy_init(_Left != *_Right))) /* strengthened */ { if (_Right) { @@ -855,7 +855,7 @@ _NODISCARD constexpr bool operator!=(const _Ty1& _Left, const optional<_Ty2>& _R return true; } -template = 0> +_EXPORT_STD template = 0> _NODISCARD constexpr bool operator<(const optional<_Ty1>& _Left, const _Ty2& _Right) noexcept( noexcept(_Fake_copy_init(*_Left < _Right))) /* strengthened */ { if (_Left) { @@ -863,7 +863,7 @@ _NODISCARD constexpr bool operator<(const optional<_Ty1>& _Left, const _Ty2& _Ri } return true; } -template = 0> +_EXPORT_STD template = 0> _NODISCARD constexpr bool operator<(const _Ty1& _Left, const optional<_Ty2>& _Right) noexcept( noexcept(_Fake_copy_init(_Left < *_Right))) /* strengthened */ { if (_Right) { @@ -872,7 +872,7 @@ _NODISCARD constexpr bool operator<(const _Ty1& _Left, const optional<_Ty2>& _Ri return false; } -template = 0> +_EXPORT_STD template = 0> _NODISCARD constexpr bool operator>(const optional<_Ty1>& _Left, const _Ty2& _Right) noexcept( noexcept(_Fake_copy_init(*_Left > _Right))) /* strengthened */ { if (_Left) { @@ -880,7 +880,7 @@ _NODISCARD constexpr bool operator>(const optional<_Ty1>& _Left, const _Ty2& _Ri } return false; } -template = 0> +_EXPORT_STD template = 0> _NODISCARD constexpr bool operator>(const _Ty1& _Left, const optional<_Ty2>& _Right) noexcept( noexcept(_Fake_copy_init(_Left > *_Right))) /* strengthened */ { if (_Right) { @@ -889,7 +889,7 @@ _NODISCARD constexpr bool operator>(const _Ty1& _Left, const optional<_Ty2>& _Ri return true; } -template = 0> +_EXPORT_STD template = 0> _NODISCARD constexpr bool operator<=(const optional<_Ty1>& _Left, const _Ty2& _Right) noexcept( noexcept(_Fake_copy_init(*_Left <= _Right))) /* strengthened */ { if (_Left) { @@ -897,7 +897,7 @@ _NODISCARD constexpr bool operator<=(const optional<_Ty1>& _Left, const _Ty2& _R } return true; } -template = 0> +_EXPORT_STD template = 0> _NODISCARD constexpr bool operator<=(const _Ty1& _Left, const optional<_Ty2>& _Right) noexcept( noexcept(_Fake_copy_init(_Left <= *_Right))) /* strengthened */ { if (_Right) { @@ -906,7 +906,7 @@ _NODISCARD constexpr bool operator<=(const _Ty1& _Left, const optional<_Ty2>& _R return false; } -template = 0> +_EXPORT_STD template = 0> _NODISCARD constexpr bool operator>=(const optional<_Ty1>& _Left, const _Ty2& _Right) noexcept( noexcept(_Fake_copy_init(*_Left >= _Right))) /* strengthened */ { if (_Left) { @@ -914,7 +914,7 @@ _NODISCARD constexpr bool operator>=(const optional<_Ty1>& _Left, const _Ty2& _R } return false; } -template = 0> +_EXPORT_STD template = 0> _NODISCARD constexpr bool operator>=(const _Ty1& _Left, const optional<_Ty2>& _Right) noexcept( noexcept(_Fake_copy_init(_Left >= *_Right))) /* strengthened */ { if (_Right) { @@ -925,7 +925,7 @@ _NODISCARD constexpr bool operator>=(const _Ty1& _Left, const optional<_Ty2>& _R #ifdef __cpp_lib_concepts // clang-format off -template +_EXPORT_STD template requires (!_Is_specialization_v<_Ty2, optional>) && three_way_comparable_with<_Ty1, _Ty2> _NODISCARD constexpr compare_three_way_result_t<_Ty1, _Ty2> @@ -940,22 +940,22 @@ _NODISCARD constexpr compare_three_way_result_t<_Ty1, _Ty2> } #endif // __cpp_lib_concepts -template && is_swappable_v<_Ty>, int> = 0> +_EXPORT_STD template && is_swappable_v<_Ty>, int> = 0> _CONSTEXPR20 void swap(optional<_Ty>& _Left, optional<_Ty>& _Right) noexcept(noexcept(_Left.swap(_Right))) { _Left.swap(_Right); } -template , _Ty>, int> = 0> // LWG-3627 +_EXPORT_STD template , _Ty>, int> = 0> // LWG-3627 _NODISCARD constexpr optional> make_optional(_Ty&& _Value) noexcept( noexcept(optional>{_STD forward<_Ty>(_Value)})) /* strengthened */ { return optional>{_STD forward<_Ty>(_Value)}; } -template , int> = 0> +_EXPORT_STD template , int> = 0> _NODISCARD constexpr optional<_Ty> make_optional(_Types&&... _Args) noexcept( noexcept(optional<_Ty>{in_place, _STD forward<_Types>(_Args)...})) /* strengthened */ { return optional<_Ty>{in_place, _STD forward<_Types>(_Args)...}; } -template &, _Types...>, int> = 0> _NODISCARD constexpr optional<_Ty> make_optional(initializer_list<_Elem> _Ilist, _Types&&... _Args) noexcept( noexcept(optional<_Ty>{in_place, _Ilist, _STD forward<_Types>(_Args)...})) /* strengthened */ { diff --git a/stl/inc/ostream b/stl/inc/ostream index fd86ddd822..86fe111745 100644 --- a/stl/inc/ostream +++ b/stl/inc/ostream @@ -20,7 +20,7 @@ _STL_DISABLE_CLANG_WARNINGS _STD_BEGIN #pragma vtordisp(push, 2) // compiler bug workaround -template +_EXPORT_STD extern "C++" template class basic_ostream : virtual public basic_ios<_Elem, _Traits> { // control insertions into a stream buffer public: using _Myios = basic_ios<_Elem, _Traits>; @@ -677,7 +677,7 @@ template class _CRTIMP2_PURE_IMPORT basic_ostream +_EXPORT_STD template basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Ostr, const char* _Val) { // insert NTBS ios_base::iostate _State = ios_base::goodbit; streamsize _Count = static_cast(_CSTD strlen(_Val)); @@ -721,7 +721,7 @@ basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Ostr, return _Ostr; } -template +_EXPORT_STD template basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Ostr, char _Ch) { // insert a character ios_base::iostate _State = ios_base::goodbit; const typename basic_ostream<_Elem, _Traits>::sentry _Ok(_Ostr); @@ -757,7 +757,7 @@ basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Ostr, return _Ostr; } -template +_EXPORT_STD template basic_ostream& operator<<(basic_ostream& _Ostr, const char* _Val) { // insert NTBS into char stream using _Elem = char; @@ -802,7 +802,7 @@ basic_ostream& operator<<(basic_ostream& _Ostr, co return _Ostr; } -template +_EXPORT_STD template basic_ostream& operator<<(basic_ostream& _Ostr, char _Ch) { // insert a char into char stream using _Elem = char; @@ -840,7 +840,7 @@ basic_ostream& operator<<(basic_ostream& _Ostr, ch return _Ostr; } -template +_EXPORT_STD template basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Ostr, const _Elem* _Val) { // insert NTCS using _Myos = basic_ostream<_Elem, _Traits>; @@ -883,7 +883,7 @@ basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Ostr, return _Ostr; } -template +_EXPORT_STD template basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Ostr, _Elem _Ch) { // insert a character using _Myos = basic_ostream<_Elem, _Traits>; @@ -919,24 +919,24 @@ basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Ostr, return _Ostr; } -template +_EXPORT_STD template basic_ostream& operator<<(basic_ostream& _Ostr, const signed char* _Val) { // insert a signed char NTBS return _Ostr << reinterpret_cast(_Val); } -template +_EXPORT_STD template basic_ostream& operator<<(basic_ostream& _Ostr, signed char _Ch) { // insert a signed char return _Ostr << static_cast(_Ch); } -template +_EXPORT_STD template basic_ostream& operator<<(basic_ostream& _Ostr, const unsigned char* _Val) { // insert an unsigned char NTBS return _Ostr << reinterpret_cast(_Val); } -template +_EXPORT_STD template basic_ostream& operator<<(basic_ostream& _Ostr, unsigned char _Ch) { // insert an unsigned char return _Ostr << static_cast(_Ch); @@ -944,45 +944,45 @@ basic_ostream& operator<<(basic_ostream& _Ostr, un #ifdef __cpp_char8_t // These deleted overloads are specified in P1423. // don't insert a UTF-8 NTBS -template +_EXPORT_STD template basic_ostream& operator<<(basic_ostream&, const char8_t*) = delete; -template +_EXPORT_STD template basic_ostream& operator<<(basic_ostream&, const char8_t*) = delete; // don't insert a UTF-8 code unit -template +_EXPORT_STD template basic_ostream& operator<<(basic_ostream&, char8_t) = delete; -template +_EXPORT_STD template basic_ostream& operator<<(basic_ostream&, char8_t) = delete; #endif // __cpp_char8_t #if !_HAS_STREAM_INSERTION_OPERATORS_DELETED_IN_CXX20 #ifdef _NATIVE_WCHAR_T_DEFINED -template +_EXPORT_STD template basic_ostream& operator<<(basic_ostream&, wchar_t) = delete; -template +_EXPORT_STD template basic_ostream& operator<<(basic_ostream&, const wchar_t*) = delete; #endif // _NATIVE_WCHAR_T_DEFINED -template +_EXPORT_STD template basic_ostream& operator<<(basic_ostream&, char16_t) = delete; -template +_EXPORT_STD template basic_ostream& operator<<(basic_ostream&, char32_t) = delete; -template +_EXPORT_STD template basic_ostream& operator<<(basic_ostream&, char16_t) = delete; -template +_EXPORT_STD template basic_ostream& operator<<(basic_ostream&, char32_t) = delete; -template +_EXPORT_STD template basic_ostream& operator<<(basic_ostream&, const char16_t*) = delete; -template +_EXPORT_STD template basic_ostream& operator<<(basic_ostream&, const char32_t*) = delete; -template +_EXPORT_STD template basic_ostream& operator<<(basic_ostream&, const char16_t*) = delete; -template +_EXPORT_STD template basic_ostream& operator<<(basic_ostream&, const char32_t*) = delete; #endif // !_HAS_STREAM_INSERTION_OPERATORS_DELETED_IN_CXX20 @@ -993,14 +993,14 @@ template struct _Can_stream_out<_Ostr, _Ty, void_t() << _STD declval())>> : true_type { }; -template , _Can_stream_out<_Ostr, _Ty>>, int> = 0> _Ostr&& operator<<(_Ostr&& _Os, const _Ty& _Val) { // insert to rvalue stream _Os << _Val; return _STD move(_Os); } -template +_EXPORT_STD template basic_ostream<_Elem, _Traits>& __CLRCALL_OR_CDECL endl( basic_ostream<_Elem, _Traits>& _Ostr) { // insert newline and flush stream _Ostr.put(_Ostr.widen('\n')); @@ -1008,13 +1008,13 @@ basic_ostream<_Elem, _Traits>& __CLRCALL_OR_CDECL endl( return _Ostr; } -template +_EXPORT_STD template basic_ostream<_Elem, _Traits>& __CLRCALL_OR_CDECL ends(basic_ostream<_Elem, _Traits>& _Ostr) { // insert null character _Ostr.put(_Elem()); return _Ostr; } -template +_EXPORT_STD template basic_ostream<_Elem, _Traits>& __CLRCALL_OR_CDECL flush(basic_ostream<_Elem, _Traits>& _Ostr) { // flush stream _Ostr.flush(); return _Ostr; @@ -1022,7 +1022,7 @@ basic_ostream<_Elem, _Traits>& __CLRCALL_OR_CDECL flush(basic_ostream<_Elem, _Tr #if _HAS_CXX20 #ifdef _CPPRTTI -template +_EXPORT_STD template basic_ostream<_Elem, _Traits>& emit_on_flush(basic_ostream<_Elem, _Traits>& _Ostr) { const auto _Sync_buf_ptr = dynamic_cast<_Basic_syncbuf_impl<_Elem, _Traits>*>(_Ostr.rdbuf()); if (_Sync_buf_ptr) { @@ -1031,7 +1031,7 @@ basic_ostream<_Elem, _Traits>& emit_on_flush(basic_ostream<_Elem, _Traits>& _Ost return _Ostr; } -template +_EXPORT_STD template basic_ostream<_Elem, _Traits>& noemit_on_flush(basic_ostream<_Elem, _Traits>& _Ostr) { const auto _Sync_buf_ptr = dynamic_cast<_Basic_syncbuf_impl<_Elem, _Traits>*>(_Ostr.rdbuf()); if (_Sync_buf_ptr) { @@ -1040,7 +1040,7 @@ basic_ostream<_Elem, _Traits>& noemit_on_flush(basic_ostream<_Elem, _Traits>& _O return _Ostr; } -template +_EXPORT_STD template basic_ostream<_Elem, _Traits>& flush_emit(basic_ostream<_Elem, _Traits>& _Ostr) { _Ostr.flush(); const auto _Sync_buf_ptr = dynamic_cast<_Basic_syncbuf_impl<_Elem, _Traits>*>(_Ostr.rdbuf()); @@ -1062,16 +1062,16 @@ basic_ostream<_Elem, _Traits>& flush_emit(basic_ostream<_Elem, _Traits>& _Ostr) return _Ostr; } #else // _CPPRTTI -template +_EXPORT_STD template basic_ostream<_Elem, _Traits>& emit_on_flush(basic_ostream<_Elem, _Traits>&) = delete; // requires /GR option -template +_EXPORT_STD template basic_ostream<_Elem, _Traits>& noemit_on_flush(basic_ostream<_Elem, _Traits>&) = delete; // requires /GR option -template +_EXPORT_STD template basic_ostream<_Elem, _Traits>& flush_emit(basic_ostream<_Elem, _Traits>&) = delete; // requires /GR option #endif // _CPPRTTI #endif // _HAS_CXX20 -template +_EXPORT_STD template basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Ostr, const error_code& _Errcode) { // display error code return _Ostr << _Errcode.category().name() << ':' << _Errcode.value(); diff --git a/stl/inc/queue b/stl/inc/queue index ffa2955de2..86abb4ee0e 100644 --- a/stl/inc/queue +++ b/stl/inc/queue @@ -24,7 +24,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new _STD_BEGIN -template > +_EXPORT_STD template > class queue { public: using value_type = typename _Container::value_type; @@ -177,45 +177,45 @@ queue(from_range_t, _Rng&&, _Alloc = _Alloc()) #endif // __cpp_lib_concepts #endif // _HAS_CXX23 -template +_EXPORT_STD template _NODISCARD bool operator==(const queue<_Ty, _Container>& _Left, const queue<_Ty, _Container>& _Right) { return _Left._Get_container() == _Right._Get_container(); } -template +_EXPORT_STD template _NODISCARD bool operator!=(const queue<_Ty, _Container>& _Left, const queue<_Ty, _Container>& _Right) { return _Left._Get_container() != _Right._Get_container(); } -template +_EXPORT_STD template _NODISCARD bool operator<(const queue<_Ty, _Container>& _Left, const queue<_Ty, _Container>& _Right) { return _Left._Get_container() < _Right._Get_container(); } -template +_EXPORT_STD template _NODISCARD bool operator>(const queue<_Ty, _Container>& _Left, const queue<_Ty, _Container>& _Right) { return _Left._Get_container() > _Right._Get_container(); } -template +_EXPORT_STD template _NODISCARD bool operator<=(const queue<_Ty, _Container>& _Left, const queue<_Ty, _Container>& _Right) { return _Left._Get_container() <= _Right._Get_container(); } -template +_EXPORT_STD template _NODISCARD bool operator>=(const queue<_Ty, _Container>& _Left, const queue<_Ty, _Container>& _Right) { return _Left._Get_container() >= _Right._Get_container(); } #ifdef __cpp_lib_concepts -template +_EXPORT_STD template _NODISCARD compare_three_way_result_t<_Container> operator<=>( const queue<_Ty, _Container>& _Left, const queue<_Ty, _Container>& _Right) { return _Left._Get_container() <=> _Right._Get_container(); } #endif // __cpp_lib_concepts -template ::value, int> = 0> +_EXPORT_STD template ::value, int> = 0> void swap(queue<_Ty, _Container>& _Left, queue<_Ty, _Container>& _Right) noexcept(noexcept(_Left.swap(_Right))) { _Left.swap(_Right); } @@ -223,7 +223,7 @@ void swap(queue<_Ty, _Container>& _Left, queue<_Ty, _Container>& _Right) noexcep template struct uses_allocator, _Alloc> : uses_allocator<_Container, _Alloc>::type {}; -template , class _Pr = less> +_EXPORT_STD template , class _Pr = less> class priority_queue { public: using value_type = typename _Container::value_type; @@ -457,7 +457,7 @@ priority_queue(from_range_t, _Rng&&, _Alloc) #endif // _HAS_CXX23 && defined(__cpp_lib_concepts) #endif // _HAS_CXX17 -template ::value && _Is_swappable<_Pr>::value, int> = 0> void swap(priority_queue<_Ty, _Container, _Pr>& _Left, priority_queue<_Ty, _Container, _Pr>& _Right) noexcept( noexcept(_Left.swap(_Right))) { diff --git a/stl/inc/random b/stl/inc/random index 32be63fa7d..b1fa1bf8d3 100644 --- a/stl/inc/random +++ b/stl/inc/random @@ -65,9 +65,9 @@ _INLINE_VAR constexpr long double _Exp1 = 2.71828182845904523536028747135266250 _INLINE_VAR constexpr long double _Two32 = 4294967296.0L; _INLINE_VAR constexpr long double _Two31 = 2147483648.0L; -_CRTIMP2_PURE float __CLRCALL_PURE_OR_CDECL _XLgamma(float); -_CRTIMP2_PURE double __CLRCALL_PURE_OR_CDECL _XLgamma(double); -_CRTIMP2_PURE long double __CLRCALL_PURE_OR_CDECL _XLgamma(long double); +extern "C++" _CRTIMP2_PURE float __CLRCALL_PURE_OR_CDECL _XLgamma(float); +extern "C++" _CRTIMP2_PURE double __CLRCALL_PURE_OR_CDECL _XLgamma(double); +extern "C++" _CRTIMP2_PURE long double __CLRCALL_PURE_OR_CDECL _XLgamma(long double); _INLINE_VAR constexpr int _Nwords = 4; @@ -147,7 +147,7 @@ private: basic_istream<_Elem, _Traits>& _Str; }; -class seed_seq { // standard sequence of seed values +_EXPORT_STD class seed_seq { // standard sequence of seed values public: using result_type = unsigned int; @@ -268,7 +268,7 @@ _NODISCARD constexpr int _Generate_canonical_iterations(const int _Bits, const u return _Ceil; } -template +_EXPORT_STD template _NODISCARD _Real generate_canonical(_Gen& _Gx) { // build a floating-point value from random sequence _RNG_REQUIRE_REALTYPE(generate_canonical, _Real); @@ -335,10 +335,10 @@ _NODISCARD _Real _Nrand_impl(_Gen& _Gx) { // build a floating-point value from r _INLINE_VAR constexpr int _MP_len = 5; using _MP_arr = uint64_t[_MP_len]; -_NODISCARD _CRTIMP2_PURE uint64_t __CLRCALL_PURE_OR_CDECL _MP_Get(_MP_arr) noexcept; -_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL _MP_Add(_MP_arr, uint64_t) noexcept; -_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL _MP_Mul(_MP_arr, uint64_t, uint64_t) noexcept; -_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL _MP_Rem(_MP_arr, uint64_t) noexcept; +extern "C++" _NODISCARD _CRTIMP2_PURE uint64_t __CLRCALL_PURE_OR_CDECL _MP_Get(_MP_arr) noexcept; +extern "C++" _CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL _MP_Add(_MP_arr, uint64_t) noexcept; +extern "C++" _CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL _MP_Mul(_MP_arr, uint64_t, uint64_t) noexcept; +extern "C++" _CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL _MP_Rem(_MP_arr, uint64_t) noexcept; template _NODISCARD _Uint _Next_linear_congruential_value(_Uint _Prev) noexcept { @@ -427,7 +427,7 @@ _NODISCARD _Uint _Get_linear_congruential_seed_from_seq(_Seed_seq& _Seq) { // N4 return _Get_linear_congruential_seed<_Uint, _Cx, _Mx>(_Sx); } -template +_EXPORT_STD template class linear_congruential_engine { // a linear congruential generator random engine public: _RNG_REQUIRE_UINTTYPE(linear_congruential_engine, _Uint); @@ -894,7 +894,7 @@ public: subtract_with_carry(_Gen& _Gx) : _Mybase(_Gx) {} }; -template +_EXPORT_STD template class subtract_with_carry_engine : public subtract_with_carry<_Ty, (_Ty{1} << (_Wx - 1)) << 1, _Sx, _Rx> { // subtract_with_carry generator public: @@ -1254,8 +1254,8 @@ protected: static constexpr int _M_mod_n = _Mx % _Nx; }; -template +_EXPORT_STD template class mersenne_twister_engine : public mersenne_twister<_Ty, _Wx, _Nx, _Mx, _Rx, _Px, _Ux, _Sx, _Bx, _Tx, _Cx, _Lx> { public: static constexpr unsigned long long _Max = (((1ULL << (_Wx - 1)) - 1) << 1) + 1; @@ -1429,7 +1429,7 @@ private: int _Nx; }; -template +_EXPORT_STD template class discard_block_engine : public discard_block<_Engine, _Px, _Rx> { // discard_block_engine compound engine public: static_assert(0 < _Rx && _Rx <= _Px, "invalid template argument for discard_block_engine"); @@ -1457,7 +1457,7 @@ public: } }; -template +_EXPORT_STD template class independent_bits_engine { // independent_bits_engine compound engine public: _RNG_REQUIRE_UINTTYPE(independent_bits_engine, _UIntType); @@ -1608,7 +1608,7 @@ private: _Eres _Yx1; // max value for larger packing word }; -template +_EXPORT_STD template class shuffle_order_engine { // shuffle_order_engine compound engine public: static_assert(0 < _Kx, "invalid template argument for shuffle_order_engine"); @@ -1877,7 +1877,7 @@ private: param_type _Par; }; -template +_EXPORT_STD template class uniform_int_distribution : public uniform_int<_Ty> { // uniform integer distribution public: _RNG_REQUIRE_INTTYPE(uniform_int_distribution, _Ty); @@ -1914,7 +1914,7 @@ public: #endif // !_HAS_CXX20 }; -class bernoulli_distribution { // class for bernoulli distribution +_EXPORT_STD class bernoulli_distribution { // class for bernoulli distribution public: using result_type = bool; @@ -2063,7 +2063,7 @@ _NODISCARD _Flt _Float_upper_bound(_Ty _Val) { } } -template +_EXPORT_STD template class geometric_distribution { // geometric distribution public: using _Ty1 = double; @@ -2212,7 +2212,7 @@ private: _Ty1 _Gx0; }; -template +_EXPORT_STD template class poisson_distribution { // poisson distribution public: using _Ty1 = double; @@ -2360,7 +2360,7 @@ private: param_type _Par; }; -template +_EXPORT_STD template class binomial_distribution { // binomial distribution public: using _Ty1 = double; @@ -2683,7 +2683,7 @@ private: param_type _Par; }; -template +_EXPORT_STD template class uniform_real_distribution : public uniform_real<_Ty> { // uniform real distribution public: _RNG_REQUIRE_REALTYPE(uniform_real_distribution, _Ty); @@ -2719,7 +2719,7 @@ public: #endif // !_HAS_CXX20 }; -template +_EXPORT_STD template class exponential_distribution { // exponential distribution public: _RNG_REQUIRE_REALTYPE(exponential_distribution, _Ty); @@ -2832,7 +2832,7 @@ private: param_type _Par; }; -template +_EXPORT_STD template class normal_distribution { // normal distribution public: _RNG_REQUIRE_REALTYPE(normal_distribution, _Ty); @@ -3020,7 +3020,7 @@ private: _Ty _Xx2; }; -template +_EXPORT_STD template class gamma_distribution { // gamma distribution public: _RNG_REQUIRE_REALTYPE(gamma_distribution, _Ty); @@ -3207,7 +3207,7 @@ private: param_type _Par; }; -template +_EXPORT_STD template class weibull_distribution { // weibull distribution public: _RNG_REQUIRE_REALTYPE(weibull_distribution, _Ty); @@ -3335,7 +3335,7 @@ private: param_type _Par; }; -template +_EXPORT_STD template class extreme_value_distribution { // extreme value distribution public: _RNG_REQUIRE_REALTYPE(extreme_value_distribution, _Ty); @@ -3464,7 +3464,7 @@ private: param_type _Par; }; -template +_EXPORT_STD template class lognormal_distribution { // lognormal_distribution public: _RNG_REQUIRE_REALTYPE(lognormal_distribution, _Ty); @@ -3591,7 +3591,7 @@ private: param_type _Par; }; -template +_EXPORT_STD template class chi_squared_distribution { // chi squared distribution public: _RNG_REQUIRE_REALTYPE(chi_squared_distribution, _Ty); @@ -3704,7 +3704,7 @@ private: param_type _Par; }; -template +_EXPORT_STD template class cauchy_distribution { // Cauchy distribution public: _RNG_REQUIRE_REALTYPE(cauchy_distribution, _Ty); @@ -3890,7 +3890,7 @@ private: _Ty _Bx; }; -template +_EXPORT_STD template class fisher_f_distribution { // fisher_f distribution public: _RNG_REQUIRE_REALTYPE(fisher_f_distribution, _Ty); @@ -4029,7 +4029,7 @@ private: param_type _Par; }; -template +_EXPORT_STD template class student_t_distribution { // student_t distribution public: _RNG_REQUIRE_REALTYPE(student_t_distribution, _Ty); @@ -4157,7 +4157,7 @@ private: param_type _Par; }; -template +_EXPORT_STD template class negative_binomial_distribution { // negative binomial distribution public: _RNG_REQUIRE_INTTYPE(negative_binomial_distribution, _Ty); @@ -4292,7 +4292,7 @@ private: param_type _Par; }; -template +_EXPORT_STD template class discrete_distribution { // discrete integer distribution public: _RNG_REQUIRE_INTTYPE(discrete_distribution, _Ty); @@ -4487,7 +4487,7 @@ public: param_type _Par; }; -template +_EXPORT_STD template class piecewise_constant_distribution : public discrete_distribution { // piecewise constant floating-point distribution // TRANSITION: unused _Mypbase subobject from base class @@ -4673,7 +4673,7 @@ public: param_type _Par; }; -template +_EXPORT_STD template class piecewise_linear_distribution : public discrete_distribution { // piecewise linear floating-point distribution // TRANSITION: unused _Mypbase subobject from base class @@ -4904,11 +4904,11 @@ public: param_type _Par; }; -using minstd_rand0 = linear_congruential_engine; -using minstd_rand = linear_congruential_engine; +_EXPORT_STD using minstd_rand0 = linear_congruential_engine; +_EXPORT_STD using minstd_rand = linear_congruential_engine; -using mt19937 = mersenne_twister_engine; +_EXPORT_STD using mt19937 = mersenne_twister_engine; #if _HAS_TR1_NAMESPACE _STL_DISABLE_DEPRECATED_WARNING @@ -4923,21 +4923,21 @@ using ranlux4_01 _DEPRECATE_TR1_NAMESPACE = discard_block; -using ranlux24_base = subtract_with_carry_engine; -using ranlux48_base = subtract_with_carry_engine; -using ranlux24 = discard_block_engine; -using ranlux48 = discard_block_engine; -using knuth_b = shuffle_order_engine; +_EXPORT_STD using ranlux24_base = subtract_with_carry_engine; +_EXPORT_STD using ranlux48_base = subtract_with_carry_engine; +_EXPORT_STD using ranlux24 = discard_block_engine; +_EXPORT_STD using ranlux48 = discard_block_engine; +_EXPORT_STD using knuth_b = shuffle_order_engine; -using default_random_engine = mt19937; +_EXPORT_STD using default_random_engine = mt19937; -_CRTIMP2_PURE unsigned int __CLRCALL_PURE_OR_CDECL _Random_device(); +extern "C++" _CRTIMP2_PURE unsigned int __CLRCALL_PURE_OR_CDECL _Random_device(); -class random_device { // class to generate random numbers (from hardware where available) +_EXPORT_STD class random_device { // class to generate random numbers (from hardware where available) public: using result_type = unsigned int; diff --git a/stl/inc/ranges b/stl/inc/ranges index 9e9b9b1c6f..d922bbae01 100644 --- a/stl/inc/ranges +++ b/stl/inc/ranges @@ -34,7 +34,7 @@ namespace ranges { inline constexpr bool _Is_initializer_list = _Is_specialization_v, initializer_list>; // clang-format off - template + _EXPORT_STD template concept viewable_range = range<_Rng> && ((view> && constructible_from, _Rng>) || (!view> @@ -123,7 +123,7 @@ namespace ranges { template _Pipeline(_Ty1, _Ty2) -> _Pipeline<_Ty1, _Ty2>; - template + _EXPORT_STD template requires _Range_adaptor_closure_object<_Left> // && _Range_adaptor_closure_object<_Right> // && constructible_from, _Left> // @@ -133,7 +133,7 @@ namespace ranges { return _Pipeline{static_cast<_Left&&>(__l), static_cast<_Right&&>(__r)}; } - template + _EXPORT_STD template requires _Range_adaptor_closure_object<_Right> && range<_Left> // _NODISCARD constexpr auto operator|(_Left&& __l, _Right&& __r) noexcept( noexcept(_STD forward<_Right>(__r)(_STD forward<_Left>(__l)))) // @@ -795,7 +795,7 @@ namespace ranges { }; #if _HAS_CXX23 - template + _EXPORT_STD template requires is_class_v<_Derived> && same_as<_Derived, remove_cv_t<_Derived>> class range_adaptor_closure : public _Pipe::_Base<_Derived> { }; @@ -867,7 +867,7 @@ namespace ranges { tuple<_Types...> _Captures; }; - template + _EXPORT_STD template requires is_object_v<_Ty> class empty_view : public view_interface> { public: @@ -896,11 +896,11 @@ namespace ranges { inline constexpr bool enable_borrowed_range> = true; namespace views { - template + _EXPORT_STD template inline constexpr empty_view<_Ty> empty; } // namespace views - template <_Valid_movable_box_object _Ty> + _EXPORT_STD template <_Valid_movable_box_object _Ty> class single_view : public view_interface> { public: // clang-format off @@ -964,7 +964,7 @@ namespace ranges { // clang-format on }; - inline constexpr _Single_fn single; + _EXPORT_STD inline constexpr _Single_fn single; } // namespace views template @@ -1224,7 +1224,7 @@ namespace ranges { } }; - template + _EXPORT_STD template requires _Weakly_equality_comparable_with<_Wi, _Bo> && copyable<_Wi> class iota_view : public view_interface> { private: @@ -1327,7 +1327,7 @@ namespace ranges { { return iota_view(static_cast<_Ty1&&>(_Val1), static_cast<_Ty2&&>(_Val2)); } }; - inline constexpr _Iota_fn iota; + _EXPORT_STD inline constexpr _Iota_fn iota; } // namespace views template @@ -1335,7 +1335,7 @@ namespace ranges { __is >> __t; }; - template > + _EXPORT_STD template > requires default_initializable<_Ty> && _Stream_extractable<_Ty, _Elem, _Traits> class basic_istream_view : public view_interface> { private: @@ -1406,9 +1406,9 @@ namespace ranges { } }; - template + _EXPORT_STD template using istream_view = basic_istream_view<_Ty, char>; - template + _EXPORT_STD template using wistream_view = basic_istream_view<_Ty, wchar_t>; namespace views { @@ -1425,11 +1425,11 @@ namespace ranges { } }; - template + _EXPORT_STD template inline constexpr _Istream_fn<_Ty> istream; } // namespace views - template + _EXPORT_STD template requires is_object_v<_Rng> class ref_view : public view_interface> { private: @@ -1484,7 +1484,7 @@ namespace ranges { inline constexpr bool enable_borrowed_range> = true; // clang-format off - template + _EXPORT_STD template requires (movable<_Rng> && !_Is_initializer_list<_Rng>) class owning_view : public view_interface> { // clang-format on @@ -1617,14 +1617,14 @@ namespace ranges { } }; - inline constexpr _All_fn all; + _EXPORT_STD inline constexpr _All_fn all; - template + _EXPORT_STD template using all_t = decltype(all(_STD declval<_Rng>())); } // namespace views #if _HAS_CXX23 - template + _EXPORT_STD template requires view<_Vw> class as_rvalue_view : public view_interface> { private: @@ -1737,11 +1737,11 @@ namespace ranges { } }; - inline constexpr _As_rvalue_fn as_rvalue; + _EXPORT_STD inline constexpr _As_rvalue_fn as_rvalue; } // namespace views #endif // _HAS_CXX23 - template > _Pr> + _EXPORT_STD template > _Pr> requires view<_Vw> && is_object_v<_Pr> class filter_view : public _Cached_position_t, _Vw, filter_view<_Vw, _Pr>> { private: @@ -1991,7 +1991,7 @@ namespace ranges { } }; - inline constexpr _Filter_fn filter; + _EXPORT_STD inline constexpr _Filter_fn filter; } // namespace views // clang-format off @@ -2004,7 +2004,7 @@ namespace ranges { #define _NOEXCEPT_IDL0(...) #endif // _ITERATOR_DEBUG_LEVEL == 0 - template + _EXPORT_STD template requires view<_Vw> && regular_invocable<_Fn&, range_reference_t<_Vw>> && _Can_reference>> @@ -2444,10 +2444,10 @@ namespace ranges { } }; - inline constexpr _Transform_fn transform; + _EXPORT_STD inline constexpr _Transform_fn transform; } // namespace views - template + _EXPORT_STD template class take_view : public view_interface> { private: /* [[no_unique_address]] */ _Vw _Range{}; @@ -2701,10 +2701,10 @@ namespace ranges { } }; - inline constexpr _Take_fn take; + _EXPORT_STD inline constexpr _Take_fn take; } // namespace views - template + _EXPORT_STD template requires input_range<_Vw> && is_object_v<_Pr> && indirect_unary_predicate> class take_while_view : public view_interface> { private: @@ -2870,10 +2870,10 @@ namespace ranges { } }; - inline constexpr _Take_while_fn take_while; + _EXPORT_STD inline constexpr _Take_while_fn take_while; } // namespace views - template + _EXPORT_STD template class drop_view : public _Cached_position_t && !(random_access_range<_Vw> && sized_range<_Vw>), _Vw, drop_view<_Vw>> { private: @@ -3073,10 +3073,10 @@ namespace ranges { } }; - inline constexpr _Drop_fn drop; + _EXPORT_STD inline constexpr _Drop_fn drop; } // namespace views - template + _EXPORT_STD template requires input_range<_Vw> && is_object_v<_Pr> && indirect_unary_predicate> class drop_while_view : public _Cached_position_t, _Vw, drop_while_view<_Vw, _Pr>> { private: @@ -3156,10 +3156,10 @@ namespace ranges { } }; - inline constexpr _Drop_while_fn drop_while; + _EXPORT_STD inline constexpr _Drop_while_fn drop_while; } // namespace views - template + _EXPORT_STD template requires view<_Vw> && input_range> class join_view; @@ -3187,7 +3187,7 @@ namespace ranges { requires is_reference_v> class _Join_view_base<_Vw> : public view_interface> {}; - template + _EXPORT_STD template requires view<_Vw> && input_range> class join_view : public _Join_view_base<_Vw> { // clang-format on @@ -3547,7 +3547,7 @@ namespace ranges { } }; - inline constexpr _Join_fn join; + _EXPORT_STD inline constexpr _Join_fn join; } // namespace views #if _HAS_CXX23 @@ -3560,7 +3560,7 @@ namespace ranges { concept _Can_const_join_with = input_range && forward_range && is_reference_v>; - template + _EXPORT_STD template requires view<_Vw> && input_range> && view<_Pat> // && _Compatible_joinable_ranges, _Pat> class join_with_view; @@ -3586,7 +3586,7 @@ namespace ranges { class _Join_with_view_base<_Vw, _Pat> : public view_interface> { }; - template + _EXPORT_STD template requires view<_Vw> && input_range> && view<_Pat> // && _Compatible_joinable_ranges, _Pat> class join_with_view : public _Join_with_view_base<_Vw, _Pat> { @@ -4019,7 +4019,7 @@ namespace ranges { } }; - inline constexpr _Join_with_fn join_with; + _EXPORT_STD inline constexpr _Join_with_fn join_with; } // namespace views #endif // _HAS_CXX23 @@ -4032,7 +4032,7 @@ namespace ranges { && requires { typename _Require_constant::size()>; } && (remove_reference_t<_Ty>::size() <= 1); - template + _EXPORT_STD template requires (view<_Vw> && view<_Pat> && indirectly_comparable, iterator_t<_Pat>, _RANGES equal_to> && (forward_range<_Vw> || _Tiny_range<_Pat>)) @@ -4049,7 +4049,7 @@ namespace ranges { class _Lazy_split_view_base<_Vw, _Pat> : public view_interface> {}; // clang-format off - template + _EXPORT_STD template requires (view<_Vw> && view<_Pat> && indirectly_comparable, iterator_t<_Pat>, _RANGES equal_to> && (forward_range<_Vw> || _Tiny_range<_Pat>)) @@ -4437,10 +4437,10 @@ namespace ranges { } }; - inline constexpr _Lazy_split_fn lazy_split; + _EXPORT_STD inline constexpr _Lazy_split_fn lazy_split; } // namespace views - template + _EXPORT_STD template requires view<_Vw> && view<_Pat> && indirectly_comparable, iterator_t<_Pat>, _RANGES equal_to> class split_view : public view_interface> { private: @@ -4636,7 +4636,7 @@ namespace ranges { } }; - inline constexpr _Split_fn split; + _EXPORT_STD inline constexpr _Split_fn split; class _Counted_fn { private: @@ -4684,11 +4684,11 @@ namespace ranges { } }; - inline constexpr _Counted_fn counted; + _EXPORT_STD inline constexpr _Counted_fn counted; } // namespace views // clang-format off - template + _EXPORT_STD template requires (!common_range<_Vw> && copyable>) class common_view : public view_interface> { // clang-format on @@ -4799,10 +4799,10 @@ namespace ranges { } }; - inline constexpr _Common_fn common; + _EXPORT_STD inline constexpr _Common_fn common; } // namespace views - template + _EXPORT_STD template requires bidirectional_range<_Vw> class reverse_view : public _Cached_position_t, _Vw, reverse_view<_Vw>> { private: @@ -4948,7 +4948,7 @@ namespace ranges { } }; - inline constexpr _Reverse_fn reverse; + _EXPORT_STD inline constexpr _Reverse_fn reverse; } // namespace views template @@ -4965,7 +4965,7 @@ namespace ranges { concept _Returnable_element = is_reference_v<_Tuple> || move_constructible>; // clang-format off - template + _EXPORT_STD template requires view<_Vw> && _Has_tuple_element, _Index> && _Has_tuple_element>, _Index> && _Returnable_element, _Index> @@ -5332,9 +5332,9 @@ namespace ranges { template inline constexpr bool enable_borrowed_range> = enable_borrowed_range<_Rng>; - template + _EXPORT_STD template using keys_view = elements_view<_Rng, 0>; - template + _EXPORT_STD template using values_view = elements_view<_Rng, 1>; namespace views { @@ -5349,10 +5349,10 @@ namespace ranges { { return elements_view, _Index>{_STD forward<_Rng>(_Range)}; } }; - template + _EXPORT_STD template inline constexpr _Elements_fn<_Index> elements; - inline constexpr auto keys = elements<0>; - inline constexpr auto values = elements<1>; + _EXPORT_STD inline constexpr auto keys = elements<0>; + _EXPORT_STD inline constexpr auto values = elements<1>; } // namespace views #if _HAS_CXX23 @@ -5365,7 +5365,7 @@ namespace ranges { return _Result; } - template + _EXPORT_STD template requires input_range<_Vw> class chunk_view : public view_interface> { private: @@ -5916,7 +5916,7 @@ namespace ranges { } }; - inline constexpr _Chunk_fn chunk; + _EXPORT_STD inline constexpr _Chunk_fn chunk; } // namespace views template @@ -5928,7 +5928,7 @@ namespace ranges { template concept _Slide_caches_first = !_Slide_caches_nothing<_Vw> && !_Slide_caches_last<_Vw>; - template + _EXPORT_STD template requires view<_Vw> class slide_view : public _Cached_position_t, _Vw, slide_view<_Vw>> { private: @@ -6282,7 +6282,7 @@ namespace ranges { } }; - inline constexpr _Slide_fn slide; + _EXPORT_STD inline constexpr _Slide_fn slide; } // namespace views template @@ -6305,7 +6305,7 @@ namespace ranges { _Pr& _Pred; }; - template , iterator_t<_Vw>> _Pr> + _EXPORT_STD template , iterator_t<_Vw>> _Pr> requires view<_Vw> && is_object_v<_Pr> class chunk_by_view : public _Cached_position<_Vw, chunk_by_view<_Vw, _Pr>> { private: @@ -6478,10 +6478,10 @@ namespace ranges { } }; - inline constexpr _Chunk_by_fn chunk_by; + _EXPORT_STD inline constexpr _Chunk_by_fn chunk_by; } // namespace views - template + _EXPORT_STD template requires view<_Vw> class stride_view : public view_interface> { private: @@ -6839,7 +6839,7 @@ namespace ranges { } }; - inline constexpr _Stride_fn stride; + _EXPORT_STD inline constexpr _Stride_fn stride; } // namespace views #ifdef __cpp_lib_ranges_to_container @@ -6898,7 +6898,7 @@ namespace ranges { } // clang-format off - template + _EXPORT_STD template requires (!view<_Container>) _NODISCARD constexpr _Container to(_Rng&& _Range, _Types&&... _Args) { // clang-format on @@ -6937,7 +6937,7 @@ namespace ranges { }; // clang-format off - template + _EXPORT_STD template requires (!view<_Container>) _NODISCARD constexpr auto to(_Types&&... _Args) { return _Range_closure<_To_class_fn<_Container>, decay_t<_Types>...>{_STD forward<_Types>(_Args)...}; @@ -6976,7 +6976,7 @@ namespace ranges { } } - template