Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
This commit is contained in:
Daniel Marshall 2021-08-06 03:33:09 +01:00 коммит произвёл GitHub
Родитель c76042bb32
Коммит 472161105d
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
141 изменённых файлов: 18 добавлений и 2145 удалений

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -31,7 +31,6 @@ _STL_DISABLE_CLANG_WARNINGS
_STD_BEGIN
// CLASS bad_any_cast
class bad_any_cast : public bad_cast { // thrown by failed any_cast
public:
_NODISCARD const char* __CLR_OR_THIS_CALL what() const noexcept override {
@ -108,7 +107,6 @@ template <class _Ty>
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
class any { // storage for any (CopyConstructible) type
public:
// Construction and destruction [any.cons]

Просмотреть файл

@ -18,7 +18,6 @@ _STL_DISABLE_CLANG_WARNINGS
#undef new
_STD_BEGIN
// CLASS TEMPLATE _Array_const_iterator
#if _ITERATOR_DEBUG_LEVEL != 0
struct _Iterator_base12_compatible { // TRANSITION, for binary compatibility
_Container_proxy* _Myproxy{};
@ -327,7 +326,6 @@ struct pointer_traits<_Array_const_iterator<_Ty, _Size>> {
};
#endif // _HAS_CXX20
// CLASS TEMPLATE _Array_iterator
template <class _Ty, size_t _Size>
class _Array_iterator : public _Array_const_iterator<_Ty, _Size> {
public:
@ -433,7 +431,6 @@ struct pointer_traits<_Array_iterator<_Ty, _Size>> {
};
#endif // _HAS_CXX20
// CLASS TEMPLATE array
template <class _Ty, size_t _Size>
class array { // fixed size array of values
public:
@ -850,7 +847,6 @@ _NODISCARD _CONSTEXPR20 bool operator>=(const array<_Ty, _Size>& _Left, const ar
#endif // ^^^ !defined(__cpp_lib_concepts) ^^^
#if _HAS_CXX20
// FUNCTION TEMPLATE to_array
template <class _Ty, size_t _Size, size_t... _Idx>
_NODISCARD constexpr array<remove_cv_t<_Ty>, _Size> _To_array_lvalue_impl(
_Ty (&_Array)[_Size], index_sequence<_Idx...>) {
@ -882,7 +878,6 @@ _NODISCARD constexpr array<remove_cv_t<_Ty>, _Size> to_array(_Ty(&&_Array)[_Size
}
#endif // _HAS_CXX20
// TUPLE INTERFACE TO array
template <size_t _Idx, class _Ty, size_t _Size>
_NODISCARD constexpr _Ty& get(array<_Ty, _Size>& _Arr) noexcept {
static_assert(_Idx < _Size, "array index out of bounds");

Просмотреть файл

@ -49,7 +49,6 @@ _STL_DISABLE_CLANG_WARNINGS
#endif // _DEBUG
#endif // _INVALID_MEMORY_ORDER
// MACRO _STD_COMPARE_EXCHANGE_128
#ifdef _WIN64
#if _STD_ATOMIC_ALWAYS_USE_CMPXCHG16B == 1
#define _STD_COMPARE_EXCHANGE_128 _InterlockedCompareExchange128
@ -67,7 +66,6 @@ extern "C" _NODISCARD char __stdcall __std_atomic_has_cmpxchg16b() noexcept;
#endif // _STD_ATOMIC_ALWAYS_USE_CMPXCHG16B == 1
#endif // _WIN64
// MACRO _ATOMIC_HAS_DCAS
// Controls whether atomic::is_always_lock_free triggers for sizeof(void *) or 2 * sizeof(void *)
#if _STD_ATOMIC_ALWAYS_USE_CMPXCHG16B == 1 || !defined(_M_X64) || defined(_M_ARM64EC)
#define _ATOMIC_HAS_DCAS 1
@ -75,7 +73,6 @@ extern "C" _NODISCARD char __stdcall __std_atomic_has_cmpxchg16b() noexcept;
#define _ATOMIC_HAS_DCAS 0
#endif // _STD_ATOMIC_ALWAYS_USE_CMPXCHG16B == 1 || !defined(_M_X64) || defined(_M_ARM64EC)
// MACRO _ATOMIC_CHOOSE_INTRINSIC
#if defined(_M_IX86) || (defined(_M_X64) && !defined(_M_ARM64EC))
#define _ATOMIC_CHOOSE_INTRINSIC(_Order, _Result, _Intrinsic, ...) \
_Check_memory_order(_Order); \
@ -103,7 +100,6 @@ extern "C" _NODISCARD char __stdcall __std_atomic_has_cmpxchg16b() noexcept;
}
#endif // hardware
// LOCK-FREE PROPERTY
#define ATOMIC_BOOL_LOCK_FREE 2
#define ATOMIC_CHAR_LOCK_FREE 2
#ifdef __cpp_lib_char8_t
@ -131,7 +127,6 @@ _END_EXTERN_C
#endif
_STD_BEGIN
// STRUCT TEMPLATE _Storage_for
#if _CMPXCHG_MASK_OUT_PADDING_BITS
struct _Form_mask_t {};
_INLINE_VAR constexpr _Form_mask_t _Form_mask{};
@ -168,7 +163,6 @@ 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
// FENCES
extern "C" inline void atomic_thread_fence(const memory_order _Order) noexcept {
if (_Order == memory_order_relaxed) {
return;
@ -201,13 +195,11 @@ extern "C" inline void atomic_signal_fence(const memory_order _Order) noexcept {
}
}
// FUNCTION TEMPLATE kill_dependency
template <class _Ty>
_Ty kill_dependency(_Ty _Arg) noexcept { // "magic" template that kills dependency ordering when called
return _Arg;
}
// FUNCTION _Check_memory_order
inline void _Check_memory_order(const memory_order _Order) noexcept {
// check that _Order is a valid memory_order
if (static_cast<unsigned int>(_Order) > static_cast<unsigned int>(memory_order_seq_cst)) {
@ -215,7 +207,6 @@ inline void _Check_memory_order(const memory_order _Order) noexcept {
}
}
// FUNCTION _Check_store_memory_order
inline void _Check_store_memory_order(const memory_order _Order) noexcept {
switch (_Order) {
case memory_order_relaxed:
@ -232,7 +223,6 @@ inline void _Check_store_memory_order(const memory_order _Order) noexcept {
}
}
// FUNCTION _Check_load_memory_order
inline void _Check_load_memory_order(const memory_order _Order) noexcept {
switch (_Order) {
case memory_order_relaxed:
@ -249,7 +239,6 @@ inline void _Check_load_memory_order(const memory_order _Order) noexcept {
}
}
// FUNCTION _Combine_cas_memory_orders
_NODISCARD inline memory_order _Combine_cas_memory_orders(
const memory_order _Success, const memory_order _Failure) noexcept {
// Finds upper bound of a compare/exchange memory order
@ -282,7 +271,6 @@ _NODISCARD inline memory_order _Combine_cas_memory_orders(
return _Combined_memory_orders[static_cast<int>(_Success)][static_cast<int>(_Failure)];
}
// FUNCTION TEMPLATE _Atomic_reinterpret_as
template <class _Integral, class _Ty>
_NODISCARD _Integral _Atomic_reinterpret_as(const _Ty& _Source) noexcept {
// interprets _Source as the supplied integral type
@ -298,7 +286,6 @@ _NODISCARD _Integral _Atomic_reinterpret_as(const _Ty& _Source) noexcept {
}
}
// FUNCTION _Load_barrier
inline void _Load_barrier(const memory_order _Order) noexcept { // implement memory barrier for atomic load functions
switch (_Order) {
case memory_order_relaxed:
@ -324,7 +311,6 @@ struct _Atomic_padded {
};
#else // ^^^ don't break ABI / break ABI vvv
// STRUCT TEMPLATE _Atomic_storage_traits
template <class _Ty>
struct _Atomic_storage_traits { // properties for how _Ty is stored in an atomic
static constexpr size_t _Storage_size = sizeof(_Ty) == 1 ? 1
@ -346,7 +332,6 @@ struct _Atomic_storage_traits<_Ty&> { // properties for how _Ty is stored in an
static constexpr bool _Uses_padding = false;
};
// STRUCT TEMPLATE _Atomic_padded
template <class _Ty, bool = _Atomic_storage_traits<_Ty>::_Uses_padding>
struct _Atomic_padded { // aggregate to allow explicit constexpr zeroing of padding
alignas(_Atomic_storage_traits<_Ty>::_Storage_size) mutable _Ty _Value;
@ -377,7 +362,6 @@ struct _Atomic_storage_types<_Ty&> {
using _Spinlock = _Smtx_t*; // POINTER TO mutex
};
// STRUCT TEMPLATE _Atomic_storage
#if 1 // TRANSITION, ABI
template <class _Ty, size_t = sizeof(remove_reference_t<_Ty>)>
#else // ^^^ don't break ABI / break ABI vvv
@ -1325,7 +1309,6 @@ struct _Atomic_storage<_Ty&, 16> { // lock-free using 16-byte intrinsics
};
#endif // _WIN64
// STRUCT TEMPLATE _Atomic_integral
template <class _Ty, size_t = sizeof(_Ty)>
struct _Atomic_integral; // not defined
@ -1659,7 +1642,6 @@ _INLINE_VAR constexpr bool _Deprecate_non_lock_free_volatile = true;
template <class _Ty>
_CXX20_DEPRECATE_VOLATILE _INLINE_VAR constexpr bool _Deprecate_non_lock_free_volatile<_Ty, false> = true;
// STRUCT TEMPLATE _Atomic_integral_facade
template <class _Ty>
struct _Atomic_integral_facade : _Atomic_integral<_Ty> {
// provides operator overloads and other support for atomic integral specializations
@ -1793,7 +1775,6 @@ struct _Atomic_integral_facade : _Atomic_integral<_Ty> {
}
};
// STRUCT TEMPLATE _Atomic_integral_facade
template <class _Ty>
struct _Atomic_integral_facade<_Ty&> : _Atomic_integral<_Ty&> {
// provides operator overloads and other support for atomic integral specializations
@ -1989,7 +1970,6 @@ struct _Atomic_floating<_Ty&> : _Atomic_storage<_Ty&> {
};
#endif // _HAS_CXX20
// STRUCT TEMPLATE _Atomic_pointer
template <class _Ty>
struct _Atomic_pointer : _Atomic_storage<_Ty> {
using _Base = _Atomic_storage<_Ty>;
@ -2092,7 +2072,6 @@ struct _Atomic_pointer : _Atomic_storage<_Ty> {
};
// STRUCT TEMPLATE _Atomic_pointer
template <class _Ty>
struct _Atomic_pointer<_Ty&> : _Atomic_storage<_Ty&> {
using _Base = _Atomic_storage<_Ty&>;
@ -2153,7 +2132,6 @@ struct _Atomic_pointer<_Ty&> : _Atomic_storage<_Ty&> {
};
// STRUCT TEMPLATE atomic
#define ATOMIC_VAR_INIT(_Value) \
{ _Value }
@ -2466,7 +2444,6 @@ private:
};
#endif // _HAS_CXX20
// NONMEMBER OPERATIONS ON ATOMIC TYPES
template <class _Ty>
_NODISCARD bool atomic_is_lock_free(const volatile atomic<_Ty>* _Mem) noexcept {
return _Mem->is_lock_free();
@ -2777,7 +2754,6 @@ void atomic_notify_all(atomic<_Ty>* const _Mem) noexcept /* strengthened */ {
}
#endif // _HAS_CXX20
// ATOMIC TYPEDEFS
using atomic_bool = atomic<bool>;
using atomic_char = atomic<char>;
@ -2840,7 +2816,6 @@ using atomic_signed_lock_free = atomic_intptr_t;
using atomic_unsigned_lock_free = atomic_uintptr_t;
#endif // _HAS_CXX20
// STRUCT atomic_flag
#define ATOMIC_FLAG_INIT \
{}
struct atomic_flag { // flag with test-and-set semantics
@ -2906,7 +2881,6 @@ struct atomic_flag { // flag with test-and-set semantics
};
// atomic_flag NONMEMBERS
#if _HAS_CXX20
_NODISCARD inline bool atomic_flag_test(const volatile atomic_flag* const _Flag) noexcept {
return _Flag->test();

Просмотреть файл

@ -19,7 +19,6 @@ _STL_DISABLE_CLANG_WARNINGS
#undef new
_STD_BEGIN
// CLASS TEMPLATE bitset
template <size_t _Bits>
class bitset { // store fixed-length sequence of Boolean elements
public:
@ -28,7 +27,6 @@ public:
using _Ty = conditional_t<_Bits <= sizeof(unsigned long) * CHAR_BIT, unsigned long, unsigned long long>;
#pragma warning(pop)
// CLASS reference
class reference { // proxy for an element
friend bitset<_Bits>;
@ -508,7 +506,6 @@ 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 operator>>
template <class _Elem, class _Tr, size_t _Bits>
basic_istream<_Elem, _Tr>& operator>>(basic_istream<_Elem, _Tr>& _Istr, bitset<_Bits>& _Right) {
using _Istr_t = basic_istream<_Elem, _Tr>;
@ -556,7 +553,6 @@ basic_istream<_Elem, _Tr>& operator>>(basic_istream<_Elem, _Tr>& _Istr, bitset<_
return _Istr;
}
// STRUCT TEMPLATE SPECIALIZATION hash
template <size_t _Bits>
struct hash<bitset<_Bits>> {
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef bitset<_Bits> _ARGUMENT_TYPE_NAME;

Просмотреть файл

@ -33,7 +33,6 @@ inline constexpr char _Charconv_digits[] = {'0', '1', '2', '3', '4', '5', '6', '
'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'};
static_assert(_STD size(_Charconv_digits) == 36);
// FUNCTION to_chars (INTEGER TO STRING)
template <class _RawTy>
_NODISCARD to_chars_result _Integer_to_chars(
char* _First, char* const _Last, const _RawTy _Raw_value, const int _Base) noexcept {
@ -205,7 +204,6 @@ inline to_chars_result to_chars(char* const _First, char* const _Last, const uns
to_chars_result to_chars(char* _First, char* _Last, bool _Value, int _Base = 10) = delete;
// STRUCT from_chars_result
struct from_chars_result {
const char* ptr;
errc ec;
@ -214,7 +212,6 @@ struct from_chars_result {
#endif // _HAS_CXX20
};
// FUNCTION from_chars (STRING TO INTEGER)
_NODISCARD inline unsigned char _Digit_from_char(const char _Ch) noexcept {
// convert ['0', '9'] ['A', 'Z'] ['a', 'z'] to [0, 35], everything else to 255
static constexpr unsigned char _Digit_from_byte[] = {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
@ -1643,9 +1640,6 @@ _NODISCARD errc _Convert_hexadecimal_string_to_floating_type(
// ^^^^^^^^^^ DERIVED FROM corecrt_internal_strtox.h ^^^^^^^^^^
// FUNCTION from_chars (STRING TO FLOATING-POINT)
// C11 6.4.2.1 "General"
// digit: one of
// 0 1 2 3 4 5 6 7 8 9
@ -2060,7 +2054,6 @@ inline from_chars_result from_chars(const char* const _First, const char* const
return _Result;
}
// FUNCTION to_chars (FLOATING-POINT TO STRING)
template <class _Floating>
_NODISCARD to_chars_result _Floating_to_chars_hex_precision(
char* _First, char* const _Last, const _Floating _Value, int _Precision) noexcept {

Просмотреть файл

@ -50,14 +50,12 @@ _STL_DISABLE_CLANG_WARNINGS
_STD_BEGIN
namespace chrono {
// STRUCT TEMPLATE treat_as_floating_point
template <class _Rep>
struct treat_as_floating_point : is_floating_point<_Rep> {}; // tests for floating-point type
template <class _Rep>
_INLINE_VAR constexpr bool treat_as_floating_point_v = treat_as_floating_point<_Rep>::value;
// STRUCT TEMPLATE duration_values
template <class _Rep>
struct duration_values { // gets arithmetic properties of a type
_NODISCARD static constexpr _Rep zero() noexcept {
@ -92,11 +90,9 @@ namespace chrono {
inline constexpr bool is_clock_v = _Is_clock_v<_Clock>;
#endif // _HAS_CXX20
// CLASS TEMPLATE duration
template <class _Rep, class _Period = ratio<1>>
class duration;
// VARIABLE TEMPLATE _Is_duration_v
template <class _Ty>
_INLINE_VAR constexpr bool _Is_duration_v = _Is_specialization_v<_Ty, duration>;
@ -286,11 +282,9 @@ template <class _Clock, class _Duration>
_INLINE_VAR constexpr bool _Is_trivially_swappable_v<chrono::time_point<_Clock, _Duration>> =
_Is_trivially_swappable_v<_Duration>;
// STRUCT TEMPLATE _Lcm (LEAST COMMON MULTIPLE)
template <intmax_t _Ax, intmax_t _Bx>
struct _Lcm : integral_constant<intmax_t, (_Ax / _Gcd<_Ax, _Bx>::value) * _Bx> {}; // compute LCM of _Ax and _Bx
// STRUCT TEMPLATE common_type SPECIALIZATIONS
template <class _Rep1, class _Period1, class _Rep2, class _Period2>
struct common_type<_CHRONO duration<_Rep1, _Period1>,
_CHRONO duration<_Rep2, _Period2>> { // common type of two durations
@ -305,7 +299,6 @@ struct common_type<_CHRONO time_point<_Clock, _Duration1>,
};
namespace chrono {
// duration ARITHMETIC
template <class _Rep1, class _Period1, class _Rep2, class _Period2>
_NODISCARD constexpr common_type_t<duration<_Rep1, _Period1>, duration<_Rep2, _Period2>>
operator+(const duration<_Rep1, _Period1>& _Left, const duration<_Rep2, _Period2>& _Right) noexcept(
@ -390,7 +383,6 @@ namespace chrono {
return _CD(_CD(_Left).count() % _CD(_Right).count());
}
// duration COMPARISONS
template <class _Rep1, class _Period1, class _Rep2, class _Period2>
_NODISCARD constexpr bool
operator==(const duration<_Rep1, _Period1>& _Left, const duration<_Rep2, _Period2>& _Right) noexcept(
@ -450,7 +442,6 @@ namespace chrono {
}
#endif // defined(__cpp_lib_concepts)
// FUNCTION TEMPLATE duration_cast
template <class _To, class _Rep, class _Period, enable_if_t<_Is_duration_v<_To>, int> _Enabled>
_NODISCARD constexpr _To duration_cast(const duration<_Rep, _Period>& _Dur) noexcept(
is_arithmetic_v<_Rep>&& is_arithmetic_v<typename _To::rep>) /* strengthened */ {
@ -481,7 +472,6 @@ namespace chrono {
}
}
// FUNCTION TEMPLATE floor
template <class _To, class _Rep, class _Period, enable_if_t<_Is_duration_v<_To>, int> = 0>
_NODISCARD constexpr _To floor(const duration<_Rep, _Period>& _Dur) noexcept(
is_arithmetic_v<_Rep>&& is_arithmetic_v<typename _To::rep>) /* strengthened */ {
@ -495,7 +485,6 @@ namespace chrono {
return _Casted;
}
// FUNCTION TEMPLATE ceil
template <class _To, class _Rep, class _Period, enable_if_t<_Is_duration_v<_To>, int> = 0>
_NODISCARD constexpr _To ceil(const duration<_Rep, _Period>& _Dur) noexcept(
is_arithmetic_v<_Rep>&& is_arithmetic_v<typename _To::rep>) /* strengthened */ {
@ -509,7 +498,6 @@ namespace chrono {
return _Casted;
}
// FUNCTION TEMPLATE round
template <class _Rep>
constexpr bool _Is_even(_Rep _Val) noexcept(is_arithmetic_v<_Rep>) /* strengthened */ {
// Tests whether _Val is even
@ -533,7 +521,6 @@ namespace chrono {
return _Ceiled;
}
// FUNCTION TEMPLATE abs
template <class _Rep, class _Period, enable_if_t<numeric_limits<_Rep>::is_signed, int> = 0>
_NODISCARD constexpr duration<_Rep, _Period> abs(const duration<_Rep, _Period> _Dur) noexcept(
is_arithmetic_v<_Rep>) /* strengthened */ {
@ -541,7 +528,6 @@ namespace chrono {
return _Dur < duration<_Rep, _Period>::zero() ? duration<_Rep, _Period>::zero() - _Dur : _Dur;
}
// duration TYPES
using nanoseconds = duration<long long, nano>;
using microseconds = duration<long long, micro>;
using milliseconds = duration<long long, milli>;
@ -555,7 +541,6 @@ namespace chrono {
using months = duration<int, ratio_divide<years::period, ratio<12>>>;
#endif // _HAS_CXX20
// time_point ARITHMETIC
template <class _Clock, class _Duration, class _Rep, class _Period>
_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(
@ -586,7 +571,6 @@ namespace chrono {
return _Left.time_since_epoch() - _Right.time_since_epoch();
}
// time_point COMPARISONS
template <class _Clock, class _Duration1, class _Duration2>
_NODISCARD constexpr bool
operator==(const time_point<_Clock, _Duration1>& _Left, const time_point<_Clock, _Duration2>& _Right) noexcept(
@ -640,7 +624,6 @@ namespace chrono {
}
#endif // defined(__cpp_lib_concepts)
// FUNCTION TEMPLATE time_point_cast
template <class _To, class _Clock, class _Duration, enable_if_t<_Is_duration_v<_To>, int> = 0>
_NODISCARD constexpr time_point<_Clock, _To> time_point_cast(const time_point<_Clock, _Duration>& _Time) noexcept(
is_arithmetic_v<typename _Duration::rep>&& is_arithmetic_v<typename _To::rep>) /* strengthened */ {
@ -648,7 +631,6 @@ namespace chrono {
return time_point<_Clock, _To>(_CHRONO duration_cast<_To>(_Time.time_since_epoch()));
}
// FUNCTION TEMPLATE floor (for time_point instances)
template <class _To, class _Clock, class _Duration, enable_if_t<_Is_duration_v<_To>, int> = 0>
_NODISCARD constexpr time_point<_Clock, _To> floor(const time_point<_Clock, _Duration>& _Time) noexcept(
is_arithmetic_v<typename _Duration::rep>&& is_arithmetic_v<typename _To::rep>) /* strengthened */ {
@ -656,7 +638,6 @@ namespace chrono {
return time_point<_Clock, _To>(_CHRONO floor<_To>(_Time.time_since_epoch()));
}
// FUNCTION TEMPLATE ceil (for time_point instances)
template <class _To, class _Clock, class _Duration, enable_if_t<_Is_duration_v<_To>, int> = 0>
_NODISCARD constexpr time_point<_Clock, _To> ceil(const time_point<_Clock, _Duration>& _Time) noexcept(
is_arithmetic_v<typename _Duration::rep>&& is_arithmetic_v<typename _To::rep>) /* strengthened */ {
@ -664,7 +645,6 @@ namespace chrono {
return time_point<_Clock, _To>(_CHRONO ceil<_To>(_Time.time_since_epoch()));
}
// FUNCTION TEMPLATE round (for time_point instances)
template <class _To, class _Clock, class _Duration,
enable_if_t<_Is_duration_v<_To> && !treat_as_floating_point_v<typename _To::rep>, int> = 0>
_NODISCARD constexpr time_point<_Clock, _To> round(const time_point<_Clock, _Duration>& _Time) noexcept(
@ -673,7 +653,6 @@ namespace chrono {
return time_point<_Clock, _To>(_CHRONO round<_To>(_Time.time_since_epoch()));
}
// CLOCKS
struct system_clock { // wraps GetSystemTimePreciseAsFileTime/GetSystemTimeAsFileTime
using rep = long long;
using period = ratio<1, 10'000'000>; // 100 nanoseconds
@ -695,7 +674,6 @@ namespace chrono {
};
#if _HAS_CXX20
// sys_time ALIASES
template <class _Duration>
using sys_time = time_point<system_clock, _Duration>;
using sys_seconds = sys_time<seconds>;
@ -2257,7 +2235,6 @@ namespace chrono {
// [time.zone.info]
// STRUCT sys_info
struct sys_info {
sys_seconds begin;
sys_seconds end;
@ -2266,7 +2243,6 @@ namespace chrono {
string abbrev;
};
// STRUCT local_info
struct local_info {
static constexpr int unique = 0;
static constexpr int nonexistent = 1;
@ -2277,7 +2253,6 @@ namespace chrono {
sys_info second;
};
// CLASS nonexistent_local_time
class nonexistent_local_time : public runtime_error {
public:
template <class _Duration>
@ -2296,7 +2271,6 @@ namespace chrono {
#endif // ^^^ workaround ^^^
};
// CLASS ambiguous_local_time
class ambiguous_local_time : public runtime_error {
public:
template <class _Duration>
@ -2317,10 +2291,8 @@ namespace chrono {
// [time.zone.timezone]
// ENUM CLASS choose
enum class choose { earliest, latest };
// CLASS time_zone
class time_zone {
public:
explicit time_zone(string_view _Name_) : _Name(_Name_) {}
@ -2484,7 +2456,6 @@ namespace chrono {
// [time.zone.leap]
// CLASS leap_second
class leap_second {
public:
leap_second(const leap_second&) = default;
@ -2578,7 +2549,6 @@ namespace chrono {
// [time.zone.link]
// CLASS time_zone_link
class time_zone_link {
public:
explicit time_zone_link(string_view _Name_, string_view _Target_) : _Name(_Name_), _Target(_Target_) {}
@ -2631,7 +2601,6 @@ namespace chrono {
return _Result == _Vec.end() ? nullptr : &*_Result;
}
// STRUCT tzdb
struct tzdb {
string version;
vector<time_zone> zones;
@ -2765,7 +2734,6 @@ namespace chrono {
return _STD move(_Icu_version) + "." + _STD to_string(_Num_leap_seconds);
}
// CLASS tzdb_list
class tzdb_list {
private:
using _ListType = forward_list<tzdb, _Crt_allocator<tzdb>>;
@ -2875,7 +2843,6 @@ namespace chrono {
inline atomic<tzdb_list*> _Global_tzdb_list;
// FUNCTION get_tzdb_list
_NODISCARD inline tzdb_list& get_tzdb_list() {
auto* _Tzdb_ptr = _Global_tzdb_list.load();
if (_Tzdb_ptr != nullptr) {
@ -2909,22 +2876,18 @@ namespace chrono {
return *_Tzdb_ptr;
}
// FUNCTION get_tzdb
_NODISCARD inline const tzdb& get_tzdb() {
return _CHRONO get_tzdb_list().front();
}
// FUNCTION locate_zone
_NODISCARD inline const time_zone* locate_zone(string_view _Tz_name) {
return _CHRONO get_tzdb().locate_zone(_Tz_name);
}
// FUNCTION current_zone
_NODISCARD inline const time_zone* current_zone() {
return _CHRONO get_tzdb().current_zone();
}
// FUNCTION reload_tzdb
inline const tzdb& reload_tzdb() {
_TRY_BEGIN
return _CHRONO get_tzdb_list()._Reload();
@ -2937,7 +2900,6 @@ namespace chrono {
_CATCH_END
}
// FUNCTION remote_version
_NODISCARD inline string remote_version() {
const auto& _Tzdb = _CHRONO get_tzdb();
const auto& _Version = _Tzdb.version;
@ -2947,11 +2909,9 @@ namespace chrono {
// [time.zone.zonedtraits]
// STRUCT TEMPLATE zoned_traits
template <class _Ty>
struct zoned_traits {};
// STRUCT zoned_traits<const time_zone*>
template <>
struct zoned_traits<const time_zone*> {
_NODISCARD static const time_zone* default_zone() {
@ -2965,7 +2925,6 @@ namespace chrono {
// [time.zone.zonedtime]
// CLASS TEMPLATE zoned_time
template <class _Duration, class _TimeZonePtr = const time_zone*>
class zoned_time {
private:
@ -3148,13 +3107,11 @@ namespace chrono {
using utc_time = time_point<utc_clock, _Duration>;
using utc_seconds = utc_time<seconds>;
// STRUCT leap_second_info
struct leap_second_info {
bool is_leap_second;
seconds elapsed;
};
// FUNCTION TEMPLATE get_leap_second_info
template <class _Duration>
_NODISCARD leap_second_info get_leap_second_info(const utc_time<_Duration>& _Time) {
const utc_seconds _Time_floor = _CHRONO floor<seconds>(_Time);
@ -3228,7 +3185,6 @@ namespace chrono {
}
}
// CLASS utc_clock
class utc_clock {
public:
using rep = system_clock::rep;
@ -3279,7 +3235,6 @@ namespace chrono {
using tai_time = time_point<tai_clock, _Duration>;
using tai_seconds = tai_time<seconds>;
// CLASS tai_clock
class tai_clock {
public:
using rep = system_clock::rep;
@ -3315,7 +3270,6 @@ namespace chrono {
using gps_time = time_point<gps_clock, _Duration>;
using gps_seconds = gps_time<seconds>;
// CLASS gps_clock
class gps_clock {
public:
using rep = system_clock::rep;
@ -3353,7 +3307,6 @@ namespace filesystem {
} // namespace filesystem
namespace chrono {
// ALIAS file_clock
using file_clock = filesystem::_File_time_clock;
template <class _Duration>
@ -3422,7 +3375,6 @@ namespace chrono {
#if _HAS_CXX20
// [time.clock.conv]
// STRUCT TEMPLATE clock_time_conversion
template <class _DestClock, class _SourceClock>
struct clock_time_conversion {};
@ -3610,7 +3562,6 @@ namespace chrono {
template <class _DestClock, class _SourceClock, class _Duration>
inline constexpr auto _Clock_cast_choice = _Choose_clock_cast<_DestClock, _SourceClock, _Duration>();
// FUNCTION TEMPLATE clock_cast
template <class _DestClock, class _SourceClock, class _Duration,
enable_if_t<_Clock_cast_choice<_DestClock, _SourceClock, _Duration> != _Clock_cast_strategy::_None, int> = 0>
_NODISCARD auto clock_cast(const time_point<_SourceClock, _Duration>& _Time) {
@ -5005,7 +4956,6 @@ namespace chrono {
}
};
// FUNCTION TEMPLATE from_stream
template <class _CharT, class _Traits, class _Rep, class _Period, class _Alloc = allocator<_CharT>>
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,
@ -5193,7 +5143,6 @@ namespace chrono {
minutes* _Offset;
};
// FUNCTION TEMPLATE parse
template <class _CharT, class _Traits, class _Alloc, class _Parsable,
class = void_t<decltype(_CHRONO from_stream(_STD declval<basic_istream<_CharT, _Traits>&>(),
_STD declval<const _CharT*>(), _STD declval<_Parsable&>()))>>
@ -6539,7 +6488,6 @@ namespace chrono {
#endif // __cpp_lib_format
// HELPERS
template <class _Rep, class _Period>
_NODISCARD bool _To_xtime_10_day_clamped(_CSTD xtime& _Xt, const _CHRONO duration<_Rep, _Period>& _Rel_time) noexcept(
is_arithmetic_v<_Rep>) {
@ -6564,7 +6512,6 @@ _NODISCARD bool _To_xtime_10_day_clamped(_CSTD xtime& _Xt, const _CHRONO duratio
return _Clamped;
}
// duration LITERALS
inline namespace literals {
inline namespace chrono_literals {
_NODISCARD constexpr _CHRONO hours operator"" h(unsigned long long _Val) noexcept /* strengthened */ {

Просмотреть файл

@ -561,13 +561,11 @@ using _Common_float_type_t = conditional_t<is_same_v<_Ty1, long double> || is_sa
double>>; // find type for two-argument math function
_STD_END
// FUNCTION TEMPLATE frexp
template <class _Ty, _STD enable_if_t<_STD is_integral_v<_Ty>, int> = 0>
double frexp(_Ty _Value, _Out_ int* const _Exp) noexcept /* strengthened */ {
return _CSTD frexp(static_cast<double>(_Value), _Exp);
}
// FUNCTION TEMPLATE fma
template <class _Ty1, class _Ty2, class _Ty3,
_STD enable_if_t<_STD is_arithmetic_v<_Ty1> && _STD is_arithmetic_v<_Ty2> && _STD is_arithmetic_v<_Ty3>, int> = 0>
_NODISCARD _STD _Common_float_type_t<_Ty1, _STD _Common_float_type_t<_Ty2, _Ty3>> fma(
@ -582,7 +580,6 @@ _NODISCARD _STD _Common_float_type_t<_Ty1, _STD _Common_float_type_t<_Ty2, _Ty3>
}
}
// FUNCTION TEMPLATE remquo
template <class _Ty1, class _Ty2, _STD enable_if_t<_STD is_arithmetic_v<_Ty1> && _STD is_arithmetic_v<_Ty2>, int> = 0>
_STD _Common_float_type_t<_Ty1, _Ty2> remquo(_Ty1 _Left, _Ty2 _Right, int* _Pquo) noexcept /* strengthened */ {
using _Common = _STD _Common_float_type_t<_Ty1, _Ty2>;
@ -956,325 +953,261 @@ _NODISCARD _CRT_SATELLITE_2 float __stdcall __std_smf_hypot3f(float, float, floa
_END_EXTERN_C
_STD_BEGIN
// FUNCTION assoc_laguerre
_NODISCARD inline double assoc_laguerre(const unsigned int _Degree, const unsigned int _Order, const double _Value) {
return __std_smf_assoc_laguerre(_Degree, _Order, _Value);
}
// FUNCTION assoc_laguerref
_NODISCARD inline float assoc_laguerref(const unsigned int _Degree, const unsigned int _Order, const float _Value) {
return __std_smf_assoc_laguerref(_Degree, _Order, _Value);
}
// FUNCTION assoc_laguerrel
_NODISCARD inline long double assoc_laguerrel(
const unsigned int _Degree, const unsigned int _Order, const long double _Value) {
return __std_smf_assoc_laguerre(_Degree, _Order, static_cast<double>(_Value));
}
// FUNCTION assoc_legendre
_NODISCARD inline double assoc_legendre(const unsigned int _Degree, const unsigned int _Order, const double _Value) {
return __std_smf_assoc_legendre(_Degree, _Order, _Value);
}
// FUNCTION assoc_legendref
_NODISCARD inline float assoc_legendref(const unsigned int _Degree, const unsigned int _Order, const float _Value) {
return __std_smf_assoc_legendref(_Degree, _Order, _Value);
}
// FUNCTION assoc_legendrel
_NODISCARD inline long double assoc_legendrel(
const unsigned int _Degree, const unsigned int _Order, const long double _Value) {
return __std_smf_assoc_legendre(_Degree, _Order, static_cast<double>(_Value));
}
// FUNCTION beta
_NODISCARD inline double beta(const double _Arg1, const double _Arg2) {
return __std_smf_beta(_Arg1, _Arg2);
}
// FUNCTION betaf
_NODISCARD inline float betaf(const float _Arg1, const float _Arg2) {
return __std_smf_betaf(_Arg1, _Arg2);
}
// FUNCTION betal
_NODISCARD inline long double betal(const long double _Arg1, const long double _Arg2) {
return __std_smf_beta(static_cast<double>(_Arg1), static_cast<double>(_Arg2));
}
// FUNCTION comp_ellint_1
_NODISCARD inline double comp_ellint_1(const double _Arg) {
return __std_smf_comp_ellint_1(_Arg);
}
// FUNCTION comp_ellint_1f
_NODISCARD inline float comp_ellint_1f(const float _Arg) {
return __std_smf_comp_ellint_1f(_Arg);
}
// FUNCTION comp_ellint_1l
_NODISCARD inline long double comp_ellint_1l(const long double _Arg) {
return __std_smf_comp_ellint_1(static_cast<double>(_Arg));
}
// FUNCTION comp_ellint_2
_NODISCARD inline double comp_ellint_2(const double _Arg) {
return __std_smf_comp_ellint_2(_Arg);
}
// FUNCTION comp_ellint_2f
_NODISCARD inline float comp_ellint_2f(const float _Arg) {
return __std_smf_comp_ellint_2f(_Arg);
}
// FUNCTION comp_ellint_2l
_NODISCARD inline long double comp_ellint_2l(const long double _Arg) {
return __std_smf_comp_ellint_2(static_cast<double>(_Arg));
}
// FUNCTION comp_ellint_3
_NODISCARD inline double comp_ellint_3(const double _Arg1, const double _Arg2) {
return __std_smf_comp_ellint_3(_Arg1, _Arg2);
}
// FUNCTION comp_ellint_3f
_NODISCARD inline float comp_ellint_3f(const float _Arg1, const float _Arg2) {
return __std_smf_comp_ellint_3f(_Arg1, _Arg2);
}
// FUNCTION comp_ellint_3l
_NODISCARD inline long double comp_ellint_3l(const long double _Arg1, const long double _Arg2) {
return __std_smf_comp_ellint_3(static_cast<double>(_Arg1), static_cast<double>(_Arg2));
}
// FUNCTION cyl_bessel_i
_NODISCARD inline double cyl_bessel_i(const double _Arg1, const double _Arg2) {
return __std_smf_cyl_bessel_i(_Arg1, _Arg2);
}
// FUNCTION cyl_bessel_if
_NODISCARD inline float cyl_bessel_if(const float _Arg1, const float _Arg2) {
return __std_smf_cyl_bessel_if(_Arg1, _Arg2);
}
// FUNCTION cyl_bessel_il
_NODISCARD inline long double cyl_bessel_il(const long double _Arg1, const long double _Arg2) {
return __std_smf_cyl_bessel_i(static_cast<double>(_Arg1), static_cast<double>(_Arg2));
}
// FUNCTION cyl_bessel_j
_NODISCARD inline double cyl_bessel_j(const double _Arg1, const double _Arg2) {
return __std_smf_cyl_bessel_j(_Arg1, _Arg2);
}
// FUNCTION cyl_bessel_jf
_NODISCARD inline float cyl_bessel_jf(const float _Arg1, const float _Arg2) {
return __std_smf_cyl_bessel_jf(_Arg1, _Arg2);
}
// FUNCTION cyl_bessel_jl
_NODISCARD inline long double cyl_bessel_jl(const long double _Arg1, const long double _Arg2) {
return __std_smf_cyl_bessel_j(static_cast<double>(_Arg1), static_cast<double>(_Arg2));
}
// FUNCTION cyl_bessel_k
_NODISCARD inline double cyl_bessel_k(const double _Arg1, const double _Arg2) {
return __std_smf_cyl_bessel_k(_Arg1, _Arg2);
}
// FUNCTION cyl_bessel_kf
_NODISCARD inline float cyl_bessel_kf(const float _Arg1, const float _Arg2) {
return __std_smf_cyl_bessel_kf(_Arg1, _Arg2);
}
// FUNCTION cyl_bessel_kl
_NODISCARD inline long double cyl_bessel_kl(const long double _Arg1, const long double _Arg2) {
return __std_smf_cyl_bessel_k(static_cast<double>(_Arg1), static_cast<double>(_Arg2));
}
// FUNCTION cyl_neumann
_NODISCARD inline double cyl_neumann(const double _Arg1, const double _Arg2) {
return __std_smf_cyl_neumann(_Arg1, _Arg2);
}
// FUNCTION cyl_neumannf
_NODISCARD inline float cyl_neumannf(const float _Arg1, const float _Arg2) {
return __std_smf_cyl_neumannf(_Arg1, _Arg2);
}
// FUNCTION cyl_neumannl
_NODISCARD inline long double cyl_neumannl(const long double _Arg1, const long double _Arg2) {
return __std_smf_cyl_neumann(static_cast<double>(_Arg1), static_cast<double>(_Arg2));
}
// FUNCTION ellint_1
_NODISCARD inline double ellint_1(const double _Arg1, const double _Arg2) {
return __std_smf_ellint_1(_Arg1, _Arg2);
}
// FUNCTION ellint_1f
_NODISCARD inline float ellint_1f(const float _Arg1, const float _Arg2) {
return __std_smf_ellint_1f(_Arg1, _Arg2);
}
// FUNCTION ellint_1l
_NODISCARD inline long double ellint_1l(const long double _Arg1, const long double _Arg2) {
return __std_smf_ellint_1(static_cast<double>(_Arg1), static_cast<double>(_Arg2));
}
// FUNCTION ellint_2
_NODISCARD inline double ellint_2(const double _Arg1, const double _Arg2) {
return __std_smf_ellint_2(_Arg1, _Arg2);
}
// FUNCTION ellint_2f
_NODISCARD inline float ellint_2f(const float _Arg1, const float _Arg2) {
return __std_smf_ellint_2f(_Arg1, _Arg2);
}
// FUNCTION ellint_2l
_NODISCARD inline long double ellint_2l(const long double _Arg1, const long double _Arg2) {
return __std_smf_ellint_2(static_cast<double>(_Arg1), static_cast<double>(_Arg2));
}
// FUNCTION ellint_3
_NODISCARD inline double ellint_3(const double _Arg1, const double _Arg2, const double _Arg3) {
return __std_smf_ellint_3(_Arg1, _Arg2, _Arg3);
}
// FUNCTION ellint_3f
_NODISCARD inline float ellint_3f(const float _Arg1, const float _Arg2, const float _Arg3) {
return __std_smf_ellint_3f(_Arg1, _Arg2, _Arg3);
}
// FUNCTION ellint_3l
_NODISCARD inline long double ellint_3l(const long double _Arg1, const long double _Arg2, const long double _Arg3) {
return __std_smf_ellint_3(static_cast<double>(_Arg1), static_cast<double>(_Arg2), static_cast<double>(_Arg3));
}
// FUNCTION expint
_NODISCARD inline double expint(const double _Arg) {
return __std_smf_expint(_Arg);
}
// FUNCTION expintf
_NODISCARD inline float expintf(const float _Arg) {
return __std_smf_expintf(_Arg);
}
// FUNCTION expintl
_NODISCARD inline long double expintl(const long double _Arg) {
return __std_smf_expint(static_cast<double>(_Arg));
}
// FUNCTION hermite
_NODISCARD inline double hermite(const unsigned int _Arg1, const double _Arg2) {
return __std_smf_hermite(_Arg1, _Arg2);
}
// FUNCTION hermitef
_NODISCARD inline float hermitef(const unsigned int _Arg1, const float _Arg2) {
return __std_smf_hermitef(_Arg1, _Arg2);
}
// FUNCTION hermitel
_NODISCARD inline long double hermitel(const unsigned int _Arg1, const long double _Arg2) {
return __std_smf_hermite(_Arg1, static_cast<double>(_Arg2));
}
// FUNCTION laguerre
_NODISCARD inline double laguerre(const unsigned int _Arg1, const double _Arg2) {
return __std_smf_laguerre(_Arg1, _Arg2);
}
// FUNCTION laguerref
_NODISCARD inline float laguerref(const unsigned int _Arg1, const float _Arg2) {
return __std_smf_laguerref(_Arg1, _Arg2);
}
// FUNCTION laguerrel
_NODISCARD inline long double laguerrel(const unsigned int _Arg1, const long double _Arg2) {
return __std_smf_laguerre(_Arg1, static_cast<double>(_Arg2));
}
// FUNCTION legendre
_NODISCARD inline double legendre(const unsigned int _Degree, const double _Value) {
return __std_smf_legendre(_Degree, _Value);
}
// FUNCTION legendref
_NODISCARD inline float legendref(const unsigned int _Degree, const float _Value) {
return __std_smf_legendref(_Degree, _Value);
}
// FUNCTION legendrel
_NODISCARD inline long double legendrel(const unsigned int _Degree, const long double _Value) {
return __std_smf_legendre(_Degree, static_cast<double>(_Value));
}
// FUNCTION riemann_zeta
_NODISCARD inline double riemann_zeta(const double _Arg) {
return __std_smf_riemann_zeta(_Arg);
}
// FUNCTION riemann_zetaf
_NODISCARD inline float riemann_zetaf(const float _Arg) {
return __std_smf_riemann_zetaf(_Arg);
}
// FUNCTION riemann_zetal
_NODISCARD inline long double riemann_zetal(const long double _Arg) {
return __std_smf_riemann_zeta(static_cast<double>(_Arg));
}
// FUNCTION sph_bessel
_NODISCARD inline double sph_bessel(const unsigned int _Arg1, const double _Arg2) {
return __std_smf_sph_bessel(_Arg1, _Arg2);
}
// FUNCTION sph_besself
_NODISCARD inline float sph_besself(const unsigned int _Arg1, const float _Arg2) {
return __std_smf_sph_besself(_Arg1, _Arg2);
}
// FUNCTION sph_bessell
_NODISCARD inline long double sph_bessell(const unsigned int _Arg1, const long double _Arg2) {
return __std_smf_sph_bessel(_Arg1, static_cast<double>(_Arg2));
}
// FUNCTION sph_legendre
_NODISCARD inline double sph_legendre(const unsigned int _Arg1, const unsigned int _Arg2, const double _Theta) {
return __std_smf_sph_legendre(_Arg1, _Arg2, _Theta);
}
// FUNCTION sph_legendref
_NODISCARD inline float sph_legendref(const unsigned int _Arg1, const unsigned int _Arg2, const float _Theta) {
return __std_smf_sph_legendref(_Arg1, _Arg2, _Theta);
}
// FUNCTION sph_legendrel
_NODISCARD inline long double sph_legendrel(
const unsigned int _Arg1, const unsigned int _Arg2, const long double _Theta) {
return __std_smf_sph_legendre(_Arg1, _Arg2, static_cast<double>(_Theta));
}
// FUNCTION sph_neumann
_NODISCARD inline double sph_neumann(const unsigned int _Arg1, const double _Arg2) {
return __std_smf_sph_neumann(_Arg1, _Arg2);
}
// FUNCTION sph_neumannf
_NODISCARD inline float sph_neumannf(const unsigned int _Arg1, const float _Arg2) {
return __std_smf_sph_neumannf(_Arg1, _Arg2);
}
// FUNCTION sph_neumannl
_NODISCARD inline long double sph_neumannl(const unsigned int _Arg1, const long double _Arg2) {
return __std_smf_sph_neumann(_Arg1, static_cast<double>(_Arg2));
}
// FUNCTION hypot (3-argument overloads)
_NODISCARD inline double hypot(const double _Dx, const double _Dy, const double _Dz) {
return __std_smf_hypot3(_Dx, _Dy, _Dz);
}
@ -1299,7 +1232,6 @@ _NODISCARD auto hypot(const _Ty1 _Dx, const _Ty2 _Dy, const _Ty3 _Dz) {
}
#if _HAS_CXX20
// FUNCTION lerp
template <class _Ty>
_NODISCARD constexpr _Ty _Common_lerp(const _Ty _ArgA, const _Ty _ArgB, const _Ty _ArgT) noexcept {
// on a line intersecting {(0.0, _ArgA), (1.0, _ArgB)}, return the Y value for X == _ArgT

Просмотреть файл

@ -29,7 +29,6 @@ enum _CXX17_DEPRECATE_CODECVT_HEADER codecvt_mode { consume_header = 4, generate
using _Statype = _CSTD mbstate_t;
_STL_DISABLE_DEPRECATED_WARNING
// CLASS TEMPLATE codecvt_utf8
template <class _Elem, unsigned long _Mymax = 0x10ffff, codecvt_mode _Mymode = codecvt_mode{}>
class _CXX17_DEPRECATE_CODECVT_HEADER codecvt_utf8 : public codecvt<_Elem, char, _Statype> {
// facet for converting between _Elem and UTF-8 byte sequences
@ -214,7 +213,6 @@ protected:
}
};
// CLASS TEMPLATE codecvt_utf16
template <class _Elem, unsigned long _Mymax = 0x10ffff, codecvt_mode _Mymode = codecvt_mode{}>
class _CXX17_DEPRECATE_CODECVT_HEADER codecvt_utf16 : public codecvt<_Elem, char, _Statype> {
// facet for converting between _Elem and UTF-16 multibyte sequences
@ -422,7 +420,6 @@ protected:
}
};
// CLASS codecvt_utf8_utf16
template <class _Elem, unsigned long _Mymax = 0x10ffff, codecvt_mode _Mymode = codecvt_mode{}>
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

Просмотреть файл

@ -35,7 +35,6 @@ 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 };
// CLASS partial_ordering
struct partial_ordering {
static const partial_ordering less;
static const partial_ordering equivalent;
@ -102,7 +101,6 @@ 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)};
// CLASS weak_ordering
struct weak_ordering {
static const weak_ordering less;
static const weak_ordering equivalent;
@ -165,7 +163,6 @@ 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)};
// CLASS strong_ordering
struct strong_ordering {
static const strong_ordering less;
static const strong_ordering equal;
@ -234,37 +231,30 @@ 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)};
// FUNCTION is_eq
_NODISCARD constexpr bool is_eq(const partial_ordering _Comp) noexcept {
return _Comp == 0;
}
// FUNCTION is_neq
_NODISCARD constexpr bool is_neq(const partial_ordering _Comp) noexcept {
return _Comp != 0;
}
// FUNCTION is_lt
_NODISCARD constexpr bool is_lt(const partial_ordering _Comp) noexcept {
return _Comp < 0;
}
// FUNCTION is_lteq
_NODISCARD constexpr bool is_lteq(const partial_ordering _Comp) noexcept {
return _Comp <= 0;
}
// FUNCTION is_gt
_NODISCARD constexpr bool is_gt(const partial_ordering _Comp) noexcept {
return _Comp > 0;
}
// FUNCTION is_gteq
_NODISCARD constexpr bool is_gteq(const partial_ordering _Comp) noexcept {
return _Comp >= 0;
}
// ALIAS TEMPLATE common_comparison_category_t
enum _Comparison_category : unsigned char {
_Comparison_category_none = 1,
_Comparison_category_partial = 2,
@ -342,7 +332,6 @@ struct compare_three_way {
};
// clang-format on
// STRUCT _Synth_three_way
struct _Synth_three_way {
// clang-format off
template <class _Ty1, class _Ty2>
@ -367,13 +356,11 @@ struct _Synth_three_way {
}
};
// ALIAS TEMPLATE _Synth_three_way_result
template <class _Ty1, class _Ty2 = _Ty1>
using _Synth_three_way_result = decltype(_Synth_three_way{}(_STD declval<_Ty1&>(), _STD declval<_Ty2&>()));
// Note: The following CPOs are passing arguments as lvalues; see GH-1374.
// CUSTOMIZATION POINT OBJECT strong_order
namespace _Strong_order {
void strong_order(); // Block unqualified name lookup; see GH-1374.
@ -469,7 +456,6 @@ inline namespace _Cpos {
inline constexpr _Strong_order::_Cpo strong_order;
}
// CUSTOMIZATION POINT OBJECT weak_order
namespace _Weak_order {
void weak_order(); // Block unqualified name lookup; see GH-1374.
@ -590,7 +576,6 @@ inline namespace _Cpos {
inline constexpr _Weak_order::_Cpo weak_order;
}
// CUSTOMIZATION POINT OBJECT partial_order
namespace _Partial_order {
void partial_order(); // Block unqualified name lookup; see GH-1374.
@ -676,7 +661,6 @@ concept _Can_fallback_eq_lt = requires(_Ty1& _Left, _Ty2& _Right) {
};
// clang-format on
// CUSTOMIZATION POINT OBJECT compare_strong_order_fallback
namespace _Compare_strong_order_fallback {
template <class _Ty1, class _Ty2>
concept _Can_strong_order = requires(_Ty1 & _Left, _Ty2 & _Right) {
@ -731,7 +715,6 @@ inline namespace _Cpos {
inline constexpr _Compare_strong_order_fallback::_Cpo compare_strong_order_fallback;
}
// CUSTOMIZATION POINT OBJECT compare_weak_order_fallback
namespace _Compare_weak_order_fallback {
template <class _Ty1, class _Ty2>
concept _Can_weak_order = requires(_Ty1& _Left, _Ty2& _Right) {
@ -786,7 +769,6 @@ inline namespace _Cpos {
inline constexpr _Compare_weak_order_fallback::_Cpo compare_weak_order_fallback;
}
// CUSTOMIZATION POINT OBJECT compare_partial_order_fallback
namespace _Compare_partial_order_fallback {
template <class _Ty1, class _Ty2>
concept _Can_partial_order = requires(_Ty1& _Left, _Ty2& _Right) {

Просмотреть файл

@ -54,7 +54,7 @@ struct _C_ldouble_complex {
};
#endif // _C_COMPLEX_T
// COMPLEX _Val OFFSETS
// complex _Val offsets
#define _RE 0
#define _IM 1
@ -363,7 +363,6 @@ class complex<double>;
template <>
class complex<long double>;
// CLASS TEMPLATE _Ctraits
template <class _Ty>
class _Ctraits {
public:
@ -499,7 +498,6 @@ public:
}
};
// CLASS _Ctraits<long double>
template <>
class _Ctraits<long double> {
public:
@ -643,7 +641,6 @@ public:
}
};
// CLASS _Ctraits<double>
template <>
class _Ctraits<double> {
public:
@ -782,7 +779,6 @@ public:
}
};
// CLASS _Ctraits<float>
template <>
class _Ctraits<float> {
public:
@ -918,14 +914,12 @@ public:
}
};
// STRUCT TEMPLATE _Complex_value
template <class _Ty>
struct _Complex_value {
enum { _Re = 0, _Im = 1 };
_Ty _Val[2];
};
// CLASS TEMPLATE _Complex_base
template <class _Ty, class _Valbase>
class _Complex_base : public _Valbase {
public:
@ -1015,7 +1009,6 @@ protected:
}
};
// CLASS complex<float>
template <>
class complex<float> : public _Complex_base<float, _Fcomplex_value> {
public:
@ -1107,7 +1100,6 @@ public:
}
};
// CLASS complex<double>
template <>
class complex<double> : public _Complex_base<double, _Dcomplex_value> {
public:
@ -1199,7 +1191,6 @@ public:
}
};
// CLASS complex<long double>
template <>
class complex<long double> : public _Complex_base<long double, _Lcomplex_value> {
public:
@ -1291,7 +1282,6 @@ public:
}
};
// CONSTRUCTORS FOR complex SPECIALIZATIONS
constexpr complex<float>::complex(const complex<double>& _Right)
: _Complex_base<float, _Fcomplex_value>(static_cast<_Ty>(_Right.real()), static_cast<_Ty>(_Right.imag())) {}
@ -1310,7 +1300,6 @@ constexpr complex<long double>::complex(const complex<float>& _Right)
constexpr complex<long double>::complex(const complex<double>& _Right)
: _Complex_base<long double, _Lcomplex_value>(_Right.real(), _Right.imag()) {}
// CLASS TEMPLATE complex
template <class _Ty>
class complex : public _Complex_base<_Ty, _Complex_value<_Ty>> {
public:
@ -1402,7 +1391,6 @@ public:
}
};
// FUNCTION TEMPLATE operator+
template <class _Ty>
_NODISCARD _CONSTEXPR20 complex<_Ty> operator+(const complex<_Ty>& _Left, const complex<_Ty>& _Right) {
complex<_Ty> _Tmp(_Left);
@ -1424,7 +1412,6 @@ _NODISCARD _CONSTEXPR20 complex<_Ty> operator+(const _Ty& _Left, const complex<_
return _Tmp;
}
// FUNCTION TEMPLATE operator-
template <class _Ty>
_NODISCARD _CONSTEXPR20 complex<_Ty> operator-(const complex<_Ty>& _Left, const complex<_Ty>& _Right) {
complex<_Ty> _Tmp(_Left);
@ -1446,7 +1433,6 @@ _NODISCARD _CONSTEXPR20 complex<_Ty> operator-(const _Ty& _Left, const complex<_
return _Tmp;
}
// FUNCTION TEMPLATE operator*
template <class _Ty>
_NODISCARD _CONSTEXPR20 complex<_Ty> operator*(const complex<_Ty>& _Left, const complex<_Ty>& _Right) {
complex<_Ty> _Tmp(_Left);
@ -1469,7 +1455,6 @@ _NODISCARD _CONSTEXPR20 complex<_Ty> operator*(const _Ty& _Left, const complex<_
return _Tmp;
}
// FUNCTION TEMPLATE operator/
template <class _Ty>
_NODISCARD _CONSTEXPR20 complex<_Ty> operator/(const complex<_Ty>& _Left, const complex<_Ty>& _Right) {
complex<_Ty> _Tmp(_Left);
@ -1492,19 +1477,16 @@ _NODISCARD _CONSTEXPR20 complex<_Ty> operator/(const _Ty& _Left, const complex<_
return _Tmp;
}
// FUNCTION TEMPLATE UNARY operator+
template <class _Ty>
_NODISCARD _CONSTEXPR20 complex<_Ty> operator+(const complex<_Ty>& _Left) {
return _Left;
}
// FUNCTION TEMPLATE UNARY operator-
template <class _Ty>
_NODISCARD _CONSTEXPR20 complex<_Ty> operator-(const complex<_Ty>& _Left) {
return complex<_Ty>(-_Left.real(), -_Left.imag());
}
// FUNCTION TEMPLATE operator==
template <class _Ty>
_NODISCARD constexpr bool operator==(const complex<_Ty>& _Left, const complex<_Ty>& _Right) {
return _Left.real() == _Right.real() && _Left.imag() == _Right.imag();
@ -1522,7 +1504,6 @@ _NODISCARD constexpr bool operator==(const _Ty& _Left, const complex<_Ty>& _Righ
}
#endif // !_HAS_CXX20
// FUNCTION TEMPLATE operator!=
#if !_HAS_CXX20
template <class _Ty>
_NODISCARD constexpr bool operator!=(const complex<_Ty>& _Left, const complex<_Ty>& _Right) {
@ -1540,13 +1521,11 @@ _NODISCARD constexpr bool operator!=(const _Ty& _Left, const complex<_Ty>& _Righ
}
#endif // !_HAS_CXX20
// FUNCTION TEMPLATE imag
template <class _Ty>
_NODISCARD constexpr _Ty imag(const complex<_Ty>& _Left) {
return _Left.imag();
}
// FUNCTION TEMPLATE real
template <class _Ty>
_NODISCARD constexpr _Ty real(const complex<_Ty>& _Left) {
return _Left.real();
@ -1555,13 +1534,11 @@ _NODISCARD constexpr _Ty real(const complex<_Ty>& _Left) {
template <class _Ty>
_NODISCARD complex<_Ty> sqrt(const complex<_Ty>& _Left);
// FUNCTION TEMPLATE abs
template <class _Ty>
_NODISCARD _Ty abs(const complex<_Ty>& _Left) {
return _Ctraits<_Ty>::hypot(_Left.real(), _Left.imag());
}
// FUNCTION TEMPLATE acos
template <class _Ty>
_NODISCARD complex<_Ty> acos(const complex<_Ty>& _Left) {
const _Ty _Arcbig = static_cast<_Ty>(0.25) * _Ctraits<_Ty>::sqrt(_Ctraits<_Ty>::_Flt_max());
@ -1629,7 +1606,6 @@ _NODISCARD complex<_Ty> acos(const complex<_Ty>& _Left) {
return complex<_Ty>(_Ux, _Vx);
}
// FUNCTION TEMPLATE acosh
template <class _Ty>
_NODISCARD complex<_Ty> acosh(const complex<_Ty>& _Left) {
const _Ty _Arcbig = static_cast<_Ty>(0.25) * _Ctraits<_Ty>::sqrt(_Ctraits<_Ty>::_Flt_max());
@ -1700,7 +1676,6 @@ _NODISCARD complex<_Ty> acosh(const complex<_Ty>& _Left) {
return complex<_Ty>(_Ux, _Vx);
}
// FUNCTION TEMPLATE asinh
template <class _Ty>
_NODISCARD complex<_Ty> asinh(const complex<_Ty>& _Left) {
const _Ty _Arcbig = static_cast<_Ty>(0.25) * _Ctraits<_Ty>::sqrt(_Ctraits<_Ty>::_Flt_max());
@ -1766,7 +1741,6 @@ _NODISCARD complex<_Ty> asinh(const complex<_Ty>& _Left) {
return complex<_Ty>(_Ux, _Vx);
}
// FUNCTION TEMPLATE asin
template <class _Ty>
_NODISCARD complex<_Ty> asin(const complex<_Ty>& _Left) {
complex<_Ty> _Asinh = _STD asinh(complex<_Ty>(-imag(_Left), real(_Left)));
@ -1774,7 +1748,6 @@ _NODISCARD complex<_Ty> asin(const complex<_Ty>& _Left) {
return complex<_Ty>(imag(_Asinh), -real(_Asinh));
}
// FUNCTION TEMPLATE atanh
template <class _Ty>
_NODISCARD complex<_Ty> atanh(const complex<_Ty>& _Left) {
const _Ty _Arcbig = static_cast<_Ty>(0.25) * _Ctraits<_Ty>::sqrt(_Ctraits<_Ty>::_Flt_max());
@ -1827,7 +1800,6 @@ _NODISCARD complex<_Ty> atanh(const complex<_Ty>& _Left) {
return complex<_Ty>(_Ux, _Vx);
}
// FUNCTION TEMPLATE atan
template <class _Ty>
_NODISCARD complex<_Ty> atan(const complex<_Ty>& _Left) {
complex<_Ty> _Atanh = _STD atanh(complex<_Ty>(-imag(_Left), real(_Left)));
@ -1835,14 +1807,12 @@ _NODISCARD complex<_Ty> atan(const complex<_Ty>& _Left) {
return complex<_Ty>(imag(_Atanh), -real(_Atanh));
}
// FUNCTION TEMPLATE cosh
template <class _Ty>
_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))));
}
// FUNCTION TEMPLATE exp
template <class _Ty>
_NODISCARD complex<_Ty> exp(const complex<_Ty>& _Left) {
_Ty _Real(real(_Left)), _Imag(real(_Left));
@ -1851,7 +1821,6 @@ _NODISCARD complex<_Ty> exp(const complex<_Ty>& _Left) {
return complex<_Ty>(_Real, _Imag);
}
// FUNCTION TEMPLATE _Fabs
template <class _Ty>
_Ty _Fabs(const complex<_Ty>& _Left, int* _Pexp) { // Used by sqrt(), return magnitude and scale factor.
// Returns a non-zero even integer in *_Pexp when _Left is finite
@ -1917,7 +1886,6 @@ _Ty _Fabs(const complex<_Ty>& _Left, int* _Pexp) { // Used by sqrt(), return mag
}
}
// FUNCTION TEMPLATE log
template <class _Ty>
_NODISCARD _Ty _Log_abs(const complex<_Ty>& _Left) noexcept { // for double, long double, and non-floating-point types
return static_cast<_Ty>(
@ -1935,7 +1903,6 @@ _NODISCARD complex<_Ty> log(const complex<_Ty>& _Left) {
return complex<_Ty>(_Log_abs_v, _Theta);
}
// FUNCTION TEMPLATE pow
template <class _Ty>
complex<_Ty> _Pow(const _Ty& _Left, const _Ty& _Right) {
if (0 <= _Left) {
@ -1980,14 +1947,12 @@ _NODISCARD complex<_Ty> pow(const complex<_Ty>& _Left, const complex<_Ty>& _Righ
}
}
// FUNCTION TEMPLATE sinh
template <class _Ty>
_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))));
}
// FUNCTION TEMPLATE sqrt
template <class _Ty>
_NODISCARD complex<_Ty> sqrt(const complex<_Ty>& _Left) {
int _Leftexp;
@ -2032,7 +1997,6 @@ _NODISCARD complex<_Ty> sqrt(const complex<_Ty>& _Left) {
}
}
// FUNCTION TEMPLATE tanh
template <class _Ty>
_NODISCARD complex<_Ty> tanh(const complex<_Ty>& _Left) {
_Ty _Tv = _Ctraits<_Ty>::tan(imag(_Left));
@ -2055,19 +2019,16 @@ _NODISCARD complex<_Ty> tanh(const complex<_Ty>& _Left) {
return complex<_Ty>((_Ctraits<_Ty>::sqrt(_Ty{1} + _Sv * _Sv)) * _Bv / _Dv, _Tv / _Dv);
}
// FUNCTION TEMPLATE arg
template <class _Ty>
_NODISCARD _Ty arg(const complex<_Ty>& _Left) { // return phase angle of complex as real
return _Ctraits<_Ty>::atan2(imag(_Left), real(_Left));
}
// FUNCTION TEMPLATE conj
template <class _Ty>
_NODISCARD _CONSTEXPR20 complex<_Ty> conj(const complex<_Ty>& _Left) { // return complex conjugate
return complex<_Ty>(real(_Left), -imag(_Left));
}
// FUNCTION TEMPLATE proj
template <class _Ty>
_NODISCARD complex<_Ty> proj(const complex<_Ty>& _Left) { // return complex projection
if (_Ctraits<_Ty>::_Isinf(real(_Left)) || _Ctraits<_Ty>::_Isinf(imag(_Left))) {
@ -2078,26 +2039,22 @@ _NODISCARD complex<_Ty> proj(const complex<_Ty>& _Left) { // return complex proj
return _Left;
}
// FUNCTION TEMPLATE cos
template <class _Ty>
_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))));
}
// FUNCTION TEMPLATE log10
template <class _Ty>
_NODISCARD complex<_Ty> log10(const complex<_Ty>& _Left) {
return log(_Left) * static_cast<_Ty>(0.43429448190325182765112891891660508L);
}
// FUNCTION TEMPLATE norm
template <class _Ty>
_NODISCARD _CONSTEXPR20 _Ty norm(const complex<_Ty>& _Left) { // return squared magnitude
return real(_Left) * real(_Left) + imag(_Left) * imag(_Left);
}
// FUNCTION TEMPLATE polar
template <class _Ty>
_NODISCARD complex<_Ty> polar(const _Ty& _Rho, const _Ty& _Theta) { // return _Rho * exp(i * _Theta) as complex
return complex<_Ty>(_Rho * _Ctraits<_Ty>::cos(_Theta), _Rho * _Ctraits<_Ty>::sin(_Theta));
@ -2108,21 +2065,18 @@ _NODISCARD complex<_Ty> polar(const _Ty& _Rho) { // return _Rho * exp(i * 0) as
return complex<_Ty>(_Rho, _Ty{0});
}
// FUNCTION TEMPLATE sin
template <class _Ty>
_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))));
}
// FUNCTION TEMPLATE tan
template <class _Ty>
_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));
}
// ADDITIONAL OVERLOADS
template <class _Ty>
using _Upgrade_to_double = conditional_t<is_integral_v<_Ty>, double, _Ty>;
@ -2177,7 +2131,6 @@ _NODISCARD complex<_Upgrade_to_double<_Ty>> proj(_Ty _Left) {
return complex<_Upgraded>(_Val, 0);
}
// FUNCTION TEMPLATE pow
template <class _Ty1, class _Ty2>
_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>>;
@ -2198,7 +2151,6 @@ _NODISCARD complex<_Common_float_type_t<_Ty1, _Ty2>> pow(const _Ty1& _Left, cons
return _STD pow(_Type(static_cast<_Promoted>(_Left)), _Type(_Right));
}
// FUNCTION TEMPLATE operator>>
template <class _Ty, class _Elem, class _Tr>
basic_istream<_Elem, _Tr>& operator>>(basic_istream<_Elem, _Tr>& _Istr, complex<_Ty>& _Right) {
const ctype<_Elem>& _Ctype_fac = _STD use_facet<ctype<_Elem>>(_Istr.getloc());
@ -2229,7 +2181,6 @@ basic_istream<_Elem, _Tr>& operator>>(basic_istream<_Elem, _Tr>& _Istr, complex<
return _Istr;
}
// FUNCTION TEMPLATE operator<<
template <class _Ty, class _Elem, class _Tr>
basic_ostream<_Elem, _Tr>& operator<<(basic_ostream<_Elem, _Tr>& _Ostr, const complex<_Ty>& _Right) {
const ctype<_Elem>& _Ctype_fac = _STD use_facet<ctype<_Elem>>(_Ostr.getloc());
@ -2243,7 +2194,6 @@ basic_ostream<_Elem, _Tr>& operator<<(basic_ostream<_Elem, _Tr>& _Ostr, const co
return _Ostr << _Sstr.str();
}
// complex LITERALS
inline namespace literals {
inline namespace complex_literals {
_NODISCARD constexpr complex<long double> operator""il(long double _Val) {

Просмотреть файл

@ -24,7 +24,6 @@ _STL_DISABLE_CLANG_WARNINGS
_STD_BEGIN
// clang-format off
// CONCEPT same_as
template <class _Ty1, class _Ty2>
concept _Same_impl = // Must be a distinct concept to provide symmetric subsumption for same_as
#ifdef __clang__
@ -36,23 +35,19 @@ concept _Same_impl = // Must be a distinct concept to provide symmetric subsumpt
template <class _Ty1, class _Ty2>
concept same_as = _Same_impl<_Ty1, _Ty2> && _Same_impl<_Ty2, _Ty1>;
// CONCEPT derived_from
template <class _Derived, class _Base>
concept derived_from = __is_base_of(_Base, _Derived)
&& __is_convertible_to(const volatile _Derived*, const volatile _Base*);
// CONCEPT convertible_to
template <class _From, class _To>
concept convertible_to = __is_convertible_to(_From, _To)
&& requires(add_rvalue_reference_t<_From> (&_Fn)()) {
static_cast<_To>(_Fn());
};
// CONCEPT _Implicitly_convertible_to
template <class _From, class _To>
concept _Implicitly_convertible_to = is_convertible_v<_From, _To>;
// CONCEPT common_reference_with
template <class _Ty1, class _Ty2>
concept common_reference_with =
requires {
@ -63,7 +58,6 @@ concept common_reference_with =
&& convertible_to<_Ty1, common_reference_t<_Ty1, _Ty2>>
&& convertible_to<_Ty2, common_reference_t<_Ty1, _Ty2>>;
// CONCEPT common_with
template <class _Ty1, class _Ty2>
concept common_with =
requires {
@ -77,23 +71,18 @@ concept common_with =
&& common_reference_with<add_lvalue_reference_t<common_type_t<_Ty1, _Ty2>>,
common_reference_t<add_lvalue_reference_t<const _Ty1>, add_lvalue_reference_t<const _Ty2>>>;
// CONCEPT integral
template <class _Ty>
concept integral = is_integral_v<_Ty>;
// CONCEPT signed_integral
template <class _Ty>
concept signed_integral = integral<_Ty> && static_cast<_Ty>(-1) < static_cast<_Ty>(0);
// CONCEPT unsigned_integral
template <class _Ty>
concept unsigned_integral = integral<_Ty> && !signed_integral<_Ty>;
// CONCEPT floating_point
template <class _Ty>
concept floating_point = is_floating_point_v<_Ty>;
// CONCEPT assignable_from
template <class _LTy, class _RTy>
concept assignable_from = is_lvalue_reference_v<_LTy>
&& common_reference_with<const remove_reference_t<_LTy>&, const remove_reference_t<_RTy>&>
@ -103,16 +92,13 @@ concept assignable_from = is_lvalue_reference_v<_LTy>
// swappable and swappable_with are defined below, since they depend on move_constructible.
// CONCEPT destructible
template <class _Ty>
concept destructible = __is_nothrow_destructible(_Ty);
// CONCEPT constructible_from
template <class _Ty, class... _ArgTys>
concept constructible_from = destructible<_Ty>
&& __is_constructible(_Ty, _ArgTys...);
// CONCEPT default_initializable
template <class _Ty>
concept default_initializable = constructible_from<_Ty>
&& requires {
@ -120,16 +106,13 @@ concept default_initializable = constructible_from<_Ty>
::new (static_cast<void*>(nullptr)) _Ty; // is-default-initializable<_Ty>
};
// CONCEPT move_constructible
template <class _Ty>
concept move_constructible = constructible_from<_Ty, _Ty> && convertible_to<_Ty, _Ty>;
// CONCEPT _Has_class_or_enum_type
template <class _Ty>
concept _Has_class_or_enum_type = __is_class(remove_reference_t<_Ty>) || __is_enum(remove_reference_t<_Ty>)
|| __is_union(remove_reference_t<_Ty>);
// CUSTOMIZATION POINT OBJECT ranges::swap
namespace ranges {
namespace _Swap {
template <class _Ty>
@ -174,13 +157,11 @@ namespace ranges {
}
} // namespace ranges
// CONCEPT swappable
template <class _Ty>
concept swappable = requires(_Ty& __x, _Ty& __y) {
_RANGES swap(__x, __y);
};
// CONCEPT swappable_with
template <class _Ty1, class _Ty2>
concept swappable_with = common_reference_with<_Ty1, _Ty2>
&& requires(_Ty1&& __t, _Ty2&& __u) {
@ -190,14 +171,12 @@ concept swappable_with = common_reference_with<_Ty1, _Ty2>
_RANGES swap(static_cast<_Ty2&&>(__u), static_cast<_Ty1&&>(__t));
};
// CONCEPT copy_constructible
template <class _Ty>
concept copy_constructible = move_constructible<_Ty>
&& constructible_from<_Ty, _Ty&> && convertible_to<_Ty&, _Ty>
&& constructible_from<_Ty, const _Ty&> && convertible_to<const _Ty&, _Ty>
&& constructible_from<_Ty, const _Ty> && convertible_to<const _Ty, _Ty>;
// CONCEPT _Boolean_testable
template <class _Ty>
concept _Boolean_testable_impl = convertible_to<_Ty, bool>;
@ -207,7 +186,6 @@ concept _Boolean_testable = _Boolean_testable_impl<_Ty>
{ !static_cast<_Ty&&>(__t) } -> _Boolean_testable_impl;
};
// CONCEPT _Weakly_equality_comparable_with
template <class _Ty1, class _Ty2>
concept _Half_equality_comparable =
requires(const remove_reference_t<_Ty1>& __x, const remove_reference_t<_Ty2>& __y) {
@ -219,18 +197,15 @@ template <class _Ty1, class _Ty2>
concept _Weakly_equality_comparable_with =
_Half_equality_comparable<_Ty1, _Ty2> && _Half_equality_comparable<_Ty2, _Ty1>;
// CONCEPT equality_comparable
template <class _Ty>
concept equality_comparable = _Half_equality_comparable<_Ty, _Ty>;
// CONCEPT equality_comparable_with
template <class _Ty1, class _Ty2>
concept equality_comparable_with = equality_comparable<_Ty1> && equality_comparable<_Ty2>
&& common_reference_with<const remove_reference_t<_Ty1>&, const remove_reference_t<_Ty2>&>
&& equality_comparable<common_reference_t<const remove_reference_t<_Ty1>&, const remove_reference_t<_Ty2>&>>
&& _Weakly_equality_comparable_with<_Ty1, _Ty2>;
// CONCEPT _Partially_ordered_with
template <class _Ty1, class _Ty2>
concept _Half_ordered = requires(const remove_reference_t<_Ty1>& __t, const remove_reference_t<_Ty2>& __u) {
{ __t < __u } -> _Boolean_testable;
@ -242,25 +217,21 @@ concept _Half_ordered = requires(const remove_reference_t<_Ty1>& __t, const remo
template <class _Ty1, class _Ty2>
concept _Partially_ordered_with = _Half_ordered<_Ty1, _Ty2> && _Half_ordered<_Ty2, _Ty1>;
// CONCEPT totally_ordered
template <class _Ty>
concept totally_ordered = equality_comparable<_Ty> && _Half_ordered<_Ty, _Ty>;
// CONCEPT totally_ordered_with
template <class _Ty1, class _Ty2>
concept totally_ordered_with = totally_ordered<_Ty1> && totally_ordered<_Ty2>
&& equality_comparable_with<_Ty1, _Ty2>
&& totally_ordered<common_reference_t<const remove_reference_t<_Ty1>&, const remove_reference_t<_Ty2>&>>
&& _Partially_ordered_with<_Ty1, _Ty2>;
// CONCEPT movable
template <class _Ty>
concept movable = is_object_v<_Ty>
&& move_constructible<_Ty>
&& assignable_from<_Ty&, _Ty>
&& swappable<_Ty>;
// CONCEPT copyable
template <class _Ty>
concept copyable = copy_constructible<_Ty>
&& movable<_Ty>
@ -268,30 +239,24 @@ concept copyable = copy_constructible<_Ty>
&& assignable_from<_Ty&, const _Ty&>
&& assignable_from<_Ty&, const _Ty>;
// CONCEPT semiregular
template <class _Ty>
concept semiregular = copyable<_Ty> && default_initializable<_Ty>;
// CONCEPT regular
template <class _Ty>
concept regular = semiregular<_Ty> && equality_comparable<_Ty>;
// CONCEPT invocable
template <class _FTy, class... _ArgTys>
concept invocable = requires(_FTy&& _Fn, _ArgTys&&... _Args) {
_STD invoke(static_cast<_FTy&&>(_Fn), static_cast<_ArgTys&&>(_Args)...);
};
// CONCEPT regular_invocable
template <class _FTy, class... _ArgTys>
concept regular_invocable = invocable<_FTy, _ArgTys...>;
// CONCEPT predicate
template <class _FTy, class... _ArgTys>
concept predicate = regular_invocable<_FTy, _ArgTys...>
&& _Boolean_testable<invoke_result_t<_FTy, _ArgTys...>>;
// CONCEPT relation
template <class _FTy, class _Ty1, class _Ty2>
concept relation =
predicate<_FTy, _Ty1, _Ty1>
@ -299,17 +264,14 @@ concept relation =
&& predicate<_FTy, _Ty1, _Ty2>
&& predicate<_FTy, _Ty2, _Ty1>;
// CONCEPT equivalence_relation
template <class _FTy, class _Ty1, class _Ty2>
concept equivalence_relation = relation<_FTy, _Ty1, _Ty2>;
// CONCEPT strict_weak_order
template <class _FTy, class _Ty1, class _Ty2>
concept strict_weak_order = relation<_FTy, _Ty1, _Ty2>;
// clang-format on
// STRUCT TEMPLATE _Choice_t
template <class _Ty>
struct _Choice_t {
_Ty _Strategy = _Ty{};

Просмотреть файл

@ -35,7 +35,6 @@ _STL_DISABLE_CLANG_WARNINGS
_STD_BEGIN
// STRUCT TEMPLATE coroutine_traits
template <class _Ret, class = void>
struct _Coroutine_traits {};
@ -47,7 +46,6 @@ struct _Coroutine_traits<_Ret, void_t<typename _Ret::promise_type>> {
template <class _Ret, class...>
struct coroutine_traits : _Coroutine_traits<_Ret> {};
// STRUCT TEMPLATE coroutine_handle
template <class = void>
struct coroutine_handle;
@ -197,10 +195,8 @@ struct hash<coroutine_handle<_Promise>> {
}
};
// STRUCT noop_coroutine_promise
struct noop_coroutine_promise {};
// STRUCT coroutine_handle<noop_coroutine_promise>
template <>
struct coroutine_handle<noop_coroutine_promise> {
friend coroutine_handle noop_coroutine() noexcept;
@ -235,16 +231,13 @@ private:
void* _Ptr = __builtin_coro_noop();
};
// ALIAS noop_coroutine_handle
using noop_coroutine_handle = coroutine_handle<noop_coroutine_promise>;
// FUNCTION noop_coroutine
_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
struct suspend_never {
_NODISCARD constexpr bool await_ready() const noexcept {
return true;
@ -254,7 +247,6 @@ struct suspend_never {
constexpr void await_resume() const noexcept {}
};
// STRUCT suspend_always
struct suspend_always {
_NODISCARD constexpr bool await_ready() const noexcept {
return false;

Просмотреть файл

@ -25,7 +25,6 @@ using _CSTD size_t;
using max_align_t = double; // most aligned type
#ifdef __cpp_lib_byte
// ENUM CLASS byte
enum class byte : unsigned char {};
template <class _IntType, enable_if_t<is_integral_v<_IntType>, int> = 0>

Просмотреть файл

@ -22,7 +22,6 @@ namespace stdext {
namespace cvt {
using _Statype = _CSTD mbstate_t;
// CLASS TEMPLATE codecvt_ebcdic
template <class _Elem, unsigned char _Maxcode = 0xff>
class codecvt_ebcdic
: public _STD

Просмотреть файл

@ -22,7 +22,6 @@ namespace stdext {
namespace cvt {
using _Statype = _CSTD mbstate_t;
// CLASS TEMPLATE codecvt_euc_0208
template <class _Elem, unsigned long _Maxcode = 0x7e7e>
class codecvt_euc_0208
: public _STD codecvt<_Elem, char, _Statype> { // facet for converting between JIS-X0208 _Elem and EUC bytes

Просмотреть файл

@ -24,7 +24,6 @@ namespace stdext {
#define _ESC_CODE 0x1b
// CLASS TEMPLATE codecvt_jis_0208
template <class _Elem, unsigned long _Maxcode = 0x7e7e>
class codecvt_jis_0208
: public _STD codecvt<_Elem, char, _Statype> { // facet for converting between JIS-X0208 _Elem and JIS bytes

Просмотреть файл

@ -25,7 +25,6 @@ namespace stdext {
using _Statype = _CSTD mbstate_t;
_STL_DISABLE_DEPRECATED_WARNING
// CLASS TEMPLATE codecvt_one_one
template <class _Elem, unsigned long _Maxcode = 0xffffffff, _STD codecvt_mode _Mode = _STD codecvt_mode{},
size_t _Bytes_per_word = sizeof(_Elem)>
class codecvt_one_one

Просмотреть файл

@ -23,7 +23,6 @@ namespace stdext {
using _Statype = _CSTD mbstate_t;
// CLASS TEMPLATE codecvt_sjis_0208
template <class _Elem, unsigned long _Maxcode = 0x7e7e>
class codecvt_sjis_0208
: public _STD codecvt<_Elem, char, _Statype> { // facet for converting between JIS-X0208 _Elem and EUC bytes

Просмотреть файл

@ -24,7 +24,6 @@ namespace stdext {
using _Statype = _CSTD mbstate_t;
_STL_DISABLE_DEPRECATED_WARNING
// CLASS TEMPLATE codecvt_utf16
template <class _Elem, unsigned long _Maxcode = 0x10ffff, _STD codecvt_mode _Mode = _STD codecvt_mode{}>
class codecvt_utf16
: public _STD

Просмотреть файл

@ -25,7 +25,6 @@ namespace stdext {
using _Statype = _CSTD mbstate_t;
_STL_DISABLE_DEPRECATED_WARNING
// CLASS TEMPLATE codecvt_utf8
template <class _Elem, unsigned long _Maxcode = 0xffffffff, _STD codecvt_mode _Mode = _STD codecvt_mode{}>
class codecvt_utf8
: public _STD

Просмотреть файл

@ -25,7 +25,6 @@ namespace stdext {
using _Mbstatype = _CSTD mbstate_t;
_STL_DISABLE_DEPRECATED_WARNING
// CLASS codecvt_utf8_utf16
template <class _Elem, unsigned long _Maxcode = 0x10ffff, _STD codecvt_mode _Mode = _STD codecvt_mode{},
class _Statype = _Mbstatype>
class codecvt_utf8_utf16

Просмотреть файл

@ -26,7 +26,6 @@ _STL_DISABLE_CLANG_WARNINGS
namespace stdext {
namespace cvt {
// CLASS TEMPLATE wbuffer_convert
template <class _Codecvt, class _Elem = wchar_t, class _Traits = _STD char_traits<_Elem>>
class wbuffer_convert
: public _STD basic_streambuf<_Elem, _Traits> { // stream buffer associated with a codecvt facet

Просмотреть файл

@ -23,7 +23,6 @@ _STL_DISABLE_CLANG_WARNINGS
namespace stdext {
namespace cvt {
// CLASS TEMPLATE wstring_convert
template <class _Codecvt, class _Elem = wchar_t>
class wstring_convert { // converts between _Elem (wide) and char (byte) strings
enum { _BUF_INC = 8, _BUF_MAX = 16 };

Просмотреть файл

@ -29,7 +29,6 @@ namespace stdext {
#define _ESC_CODE 0x1b
// CLASS TEMPLATE codecvt_jis
template <class _Elem, unsigned long _Maxcode = 0xffff>
class codecvt_jis
: public _STD

Просмотреть файл

@ -23,7 +23,6 @@ namespace stdext {
using _Statype = _CSTD mbstate_t;
// CLASS TEMPLATE _Cvt_one_byte
template <class _Elem, class _Table, unsigned long _Maxcode = 0xffff>
class _Cvt_one_byte
: public _STD codecvt<_Elem, char, _Statype> { // facet for converting between _Elem and one-byte sequences

Просмотреть файл

@ -23,7 +23,6 @@ namespace stdext {
using _Statype = _CSTD mbstate_t;
// CLASS TEMPLATE _Cvt_two_byte
template <class _Elem, class _Table, unsigned long _Maxcode = 0xffff>
class _Cvt_two_byte
: public _STD

Просмотреть файл

@ -22,7 +22,6 @@ _STL_DISABLE_CLANG_WARNINGS
#undef new
_STD_BEGIN
// CLASS TEMPLATE _Deque_unchecked_const_iterator
template <class _Mydeque>
class _Deque_unchecked_const_iterator {
private:
@ -151,7 +150,6 @@ _NODISCARD _Deque_unchecked_const_iterator<_Mydeque> operator+(
return _Next;
}
// CLASS TEMPLATE _Deque_unchecked_iterator
template <class _Mydeque>
class _Deque_unchecked_iterator : public _Deque_unchecked_const_iterator<_Mydeque> {
private:
@ -237,7 +235,6 @@ _NODISCARD _Deque_unchecked_iterator<_Mydeque> operator+(
return _Next;
}
// CLASS TEMPLATE _Deque_const_iterator
template <class _Mydeque>
class _Deque_const_iterator : public _Iterator_base12 {
private:
@ -440,7 +437,6 @@ _NODISCARD _Deque_const_iterator<_Mydeque> operator+(
return _Next;
}
// CLASS TEMPLATE _Deque_iterator
template <class _Mydeque>
class _Deque_iterator : public _Deque_const_iterator<_Mydeque> {
private:
@ -530,7 +526,6 @@ _NODISCARD _Deque_iterator<_Mydeque> operator+(
return _Next;
}
// deque TYPE WRAPPERS
template <class _Value_type, class _Size_type, class _Difference_type, class _Pointer, class _Const_pointer,
class _Reference, class _Const_reference, class _Mapptr_type>
struct _Deque_iter_types {
@ -547,7 +542,6 @@ struct _Deque_simple_types : _Simple_types<_Ty> {
using _Mapptr = _Ty**;
};
// CLASS TEMPLATE _Deque_val
template <class _Val_types>
class _Deque_val : public _Container_base12 {
public:
@ -583,7 +577,6 @@ public:
size_type _Mysize; // current length of sequence
};
// CLASS TEMPLATE deque
template <class _Ty, class _Alloc = allocator<_Ty>>
class deque {
private:

Просмотреть файл

@ -62,7 +62,6 @@ _STD_END
#else // _HAS_EXCEPTIONS
// CLASS exception
_STDEXT_BEGIN
class exception;
_STDEXT_END
@ -119,7 +118,6 @@ protected:
const char* _Ptr; // the message pointer
};
// CLASS bad_exception
class bad_exception : public exception { // base of all bad exceptions
public:
__CLR_OR_THIS_CALL bad_exception(const char* _Message = "bad exception") noexcept : exception(_Message) {}
@ -132,7 +130,6 @@ protected:
}
};
// CLASS bad_alloc
class bad_alloc : public exception { // base of all bad allocation exceptions
public:
__CLR_OR_THIS_CALL bad_alloc() noexcept
@ -160,7 +157,6 @@ public:
_STDEXT_END
_STD_BEGIN
// DUMMY FUNCTION DECLARATIONS
using terminate_handler = void(__cdecl*)();
inline terminate_handler __CRTDECL set_terminate(terminate_handler) noexcept { // register a terminate handler
@ -316,12 +312,10 @@ _NODISCARD exception_ptr make_exception_ptr(_Ex _Except) noexcept {
return exception_ptr::_Copy_exception(_STD addressof(_Except), __GetExceptionInfo(_Except));
}
// FUNCTION _Throw_bad_array_new_length
[[noreturn]] inline void _Throw_bad_array_new_length() {
_THROW(bad_array_new_length{});
}
// CLASS nested_exception
class nested_exception { // wrap an exception_ptr
public:
nested_exception() noexcept : _Exc(_STD current_exception()) {}
@ -346,7 +340,6 @@ private:
exception_ptr _Exc;
};
// FUNCTION TEMPLATE throw_with_nested
template <class _Ty, class _Uty>
struct _With_nested : _Uty, nested_exception { // glue user exception to nested_exception
explicit _With_nested(_Ty&& _Arg)
@ -368,7 +361,6 @@ template <class _Ty>
}
#ifdef _CPPRTTI
// FUNCTION TEMPLATE rethrow_if_nested
template <class _Ty>
void _Rethrow_if_nested(const _Ty* _Ptr, true_type) { // use dynamic_cast
const auto _Nested = dynamic_cast<const nested_exception*>(_Ptr);

Просмотреть файл

@ -70,7 +70,6 @@ constexpr size_t _Oversubscription_multiplier = 32;
constexpr size_t _Oversubmission_multiplier = 4;
constexpr size_t _Still_active = static_cast<size_t>(-1);
// EXECUTION POLICIES
namespace execution {
class sequenced_policy {
// indicates support for only sequential execution, and requests termination on exceptions
@ -138,7 +137,6 @@ template <>
struct is_execution_policy<execution::unsequenced_policy> : true_type {};
#endif // _HAS_CXX20
// STRUCT _Parallelism_resources_exhausted
struct _Parallelism_resources_exhausted : exception {
_NODISCARD const char* __CLR_OR_THIS_CALL what() const noexcept override {
// return pointer to message string
@ -157,10 +155,8 @@ protected:
_THROW(_Parallelism_resources_exhausted{});
}
// ENUM CLASS _Cancellation_status
enum class _Cancellation_status : bool { _Running, _Canceled };
// STRUCT _Cancellation_token
struct _Cancellation_token {
atomic<_Cancellation_status> _Is_canceled_impl{_Cancellation_status::_Running};
@ -181,7 +177,6 @@ struct _Cancellation_token {
}
};
// CLASS _Work_ptr
class _Work_ptr {
public:
template <class _Work, enable_if_t<!is_same_v<remove_cv_t<_Work>, _Work_ptr>, int> = 0>
@ -222,14 +217,12 @@ private:
__std_PTP_WORK _Ptp_work;
};
// FUNCTION TEMPLATE _Run_available_chunked_work
template <class _Work>
void _Run_available_chunked_work(_Work& _Operation) {
while (_Operation._Process_chunk() == _Cancellation_status::_Running) { // process while there are chunks remaining
}
}
// FUNCTION TEMPLATE _Run_chunked_parallel_work
template <class _Work>
void _Run_chunked_parallel_work(const size_t _Hw_threads, _Work& _Operation) {
// process chunks of _Operation on the thread pool
@ -239,7 +232,6 @@ void _Run_chunked_parallel_work(const size_t _Hw_threads, _Work& _Operation) {
_Run_available_chunked_work(_Operation);
}
// CHUNK CALCULATION FUNCTIONS
// The parallel algorithms library below assumes that distance(first, last) fits into a size_t;
// forward iterators must refer to objects in memory and therefore must meet this requirement.
//
@ -249,7 +241,6 @@ void _Run_chunked_parallel_work(const size_t _Hw_threads, _Work& _Operation) {
// This assumption should be localized to the chunk calculation functions; the rest of
// the library assumes that chunk numbers can be static_cast into the difference_type domain.
// FUNCTION TEMPLATE _Get_chunked_work_chunk_count
template <class _Diff>
constexpr size_t _Get_chunked_work_chunk_count(const size_t _Hw_threads, const _Diff _Count) {
// get the number of chunks to break work into to parallelize
@ -258,7 +249,6 @@ constexpr size_t _Get_chunked_work_chunk_count(const size_t _Hw_threads, const _
return (_STD min) (_Hw_threads * _Oversubscription_multiplier, _Size_count);
}
// FUNCTION TEMPLATE _Get_least2_chunked_work_chunk_count
template <class _Diff>
constexpr size_t _Get_least2_chunked_work_chunk_count(const size_t _Hw_threads, const _Diff _Count) {
// get the number of chunks to break work into to parallelize, assuming chunks must be of size 2
@ -267,7 +257,6 @@ constexpr size_t _Get_least2_chunked_work_chunk_count(const size_t _Hw_threads,
return _Get_chunked_work_chunk_count(_Hw_threads, _Size_count / 2);
}
// STRUCT TEMPLATE _Parallelism_allocator
struct _Parallelism_allocate_traits {
__declspec(allocator) static void* _Allocate(const size_t _Bytes) {
void* _Result = ::operator new(_Bytes, nothrow);
@ -358,7 +347,6 @@ struct _Generalized_sum_drop { // drop off point for GENERALIZED_SUM intermediat
}
};
// VARIABLE TEMPLATE _Use_atomic_iterator
template <class _Ty>
struct _Atomic_is_usually_lock_free : bool_constant<atomic<_Ty>::is_always_lock_free> {
// deferred evaluation of atomic::is_always_lock_free
@ -368,7 +356,6 @@ template <class _FwdIt>
inline constexpr bool _Use_atomic_iterator = conjunction_v<bool_constant<_Is_random_iter_v<_FwdIt>>,
is_trivially_copyable<_FwdIt>, _Atomic_is_usually_lock_free<_FwdIt>>;
// STRUCT TEMPLATE _Parallel_choose_min_result
template <class _Ty>
struct _Parallel_choose_min_result { // parallel results collector which uses atomic<_Ty> to choose the minimum value
_Ty _Last;
@ -391,7 +378,6 @@ struct _Parallel_choose_min_result { // parallel results collector which uses at
}
};
// STRUCT TEMPLATE _Parallel_choose_max_result
template <class _Ty>
struct _Parallel_choose_max_result { // parallel results collector which uses atomic<_Ty> to choose the maximum value
_Ty _Last;
@ -418,7 +404,6 @@ struct _Parallel_choose_max_result { // parallel results collector which uses at
}
};
// STRUCT TEMPLATE _Parallel_choose_min_chunk
template <class _Ty>
struct _Parallel_choose_min_chunk {
// parallel results collector which uses atomic<chunk number> to choose the lowest chunk's result
@ -453,7 +438,6 @@ struct _Parallel_choose_min_chunk {
}
};
// STRUCT TEMPLATE _Parallel_choose_max_chunk
template <class _Ty>
struct _Parallel_choose_max_chunk {
// parallel results collector which uses atomic<chunk number> to choose the highest chunk's result
@ -488,7 +472,6 @@ struct _Parallel_choose_max_chunk {
}
};
// CLASS TEMPLATE _Work_stealing_deque
template <class _Ty>
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");
@ -674,7 +657,6 @@ private:
};
#pragma warning(pop)
// STRUCT TEMPLATE _Work_stealing_membership
enum class _Steal_result { _Success, _Abort, _Done };
template <class _Ty>
@ -732,7 +714,6 @@ struct _Work_stealing_membership { // thread-local "ticket" that team members us
}
};
// STRUCT TEMPLATE _Work_stealing_team
template <class _Ty>
struct _Work_stealing_team { // inter-thread communication for threads working on a single task
using _Diff = typename _Ty::difference_type;
@ -776,7 +757,6 @@ struct _Work_stealing_team { // inter-thread communication for threads working o
priority_queue<size_t, _Parallel_vector<size_t>, greater<>> _Available_queues;
};
// STRUCT TEMPLATE _Static_partition_key
template <class _Diff>
struct _Static_partition_key { // "pointer" identifying a static partition
size_t _Chunk_number; // In range [0, numeric_limits<_Diff>::max()]
@ -788,7 +768,6 @@ struct _Static_partition_key { // "pointer" identifying a static partition
}
};
// STRUCT TEMPLATE _Static_partition_team
template <class _Diff>
struct _Static_partition_team { // common data for all static partitioned ops
atomic<size_t> _Consumed_chunks;
@ -838,14 +817,12 @@ struct _Static_partition_team { // common data for all static partitioned ops
}
};
// STRUCT TEMPLATE _Iterator_range
template <class _FwdIt>
struct _Iterator_range { // record of a partition of work
_FwdIt _First;
_FwdIt _Last;
};
// STRUCT TEMPLATE _Static_partition_range
template <class _FwdIt, class _Diff = _Iter_diff_t<_FwdIt>, bool = _Is_random_iter_v<_FwdIt>>
struct _Static_partition_range;
@ -966,7 +943,6 @@ struct _Static_partition_range<_FwdIt, _Diff, false> {
}
};
// STRUCT TEMPLATE _Static_partition_range_backward
template <class _BidIt, class _Diff = _Iter_diff_t<_BidIt>, bool = _Is_random_iter_v<_BidIt>>
struct _Static_partition_range_backward;
@ -1024,7 +1000,6 @@ struct _Static_partition_range_backward<_BidIt, _Diff, false> {
}
};
// FUNCTION TEMPLATE _Distance_any
template <class _InIt1, class _InIt2>
_Common_diff_t<_InIt1, _InIt2> _Distance_any(_InIt1 _First1, _InIt1 _Last1, _InIt2 _First2, _InIt2 _Last2) {
// get the distance from 2 ranges which should have identical lengths
@ -1037,7 +1012,6 @@ _Common_diff_t<_InIt1, _InIt2> _Distance_any(_InIt1 _First1, _InIt1 _Last1, _InI
}
}
// FUNCTION TEMPLATE _Distance_min
template <class _InIt1, class _InIt2>
_Common_diff_t<_InIt1, _InIt2> _Distance_min(_InIt1 _First1, const _InIt1 _Last1, _InIt2 _First2, const _InIt2 _Last2) {
// get min(distance(_First1, _Last1), distance(_First2, _Last2))
@ -1068,7 +1042,6 @@ _Common_diff_t<_InIt1, _InIt2> _Distance_min(_InIt1 _First1, const _InIt1 _Last1
return _Result;
}
// PARALLEL FUNCTION TEMPLATE all_of
template <bool _Invert, class _FwdIt, class _Pr>
struct _Static_partitioned_all_of_family2 { // all_of/any_of/none_of task scheduled on the system thread pool
_Static_partition_team<_Iter_diff_t<_FwdIt>> _Team;
@ -1150,7 +1123,6 @@ _NODISCARD bool all_of(_ExPo&&, _FwdIt _First, _FwdIt _Last, _Pr _Pred) noexcept
}
}
// PARALLEL FUNCTION TEMPLATE any_of
template <class _ExPo, class _FwdIt, class _Pr, _Enable_if_execution_policy_t<_ExPo> /* = 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
@ -1165,7 +1137,6 @@ _NODISCARD bool any_of(_ExPo&&, const _FwdIt _First, const _FwdIt _Last, _Pr _Pr
}
}
// PARALLEL FUNCTION TEMPLATE none_of
template <class _ExPo, class _FwdIt, class _Pr, _Enable_if_execution_policy_t<_ExPo> /* = 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
@ -1180,7 +1151,6 @@ _NODISCARD bool none_of(_ExPo&&, const _FwdIt _First, const _FwdIt _Last, _Pr _P
}
}
// PARALLEL FUNCTION TEMPLATE for_each
template <class _FwdIt, class _Fn>
void _For_each_ivdep(_FwdIt _First, const _FwdIt _Last, _Fn _Func) {
// perform function for each element [_First, _Last) assuming independent loop bodies
@ -1251,7 +1221,6 @@ void for_each(_ExPo&&, _FwdIt _First, _FwdIt _Last, _Fn _Func) noexcept /* termi
}
}
// PARALLEL FUNCTION TEMPLATE for_each_n
template <class _FwdIt, class _Diff, class _Fn>
_FwdIt _For_each_n_ivdep(_FwdIt _First, _Diff _Count, _Fn _Func) {
// perform function for each element [_First, _First + _Count) assuming independent loop bodies
@ -1300,7 +1269,6 @@ _FwdIt for_each_n(_ExPo&&, _FwdIt _First, const _Diff _Count_raw, _Fn _Func) noe
return _First;
}
// PARALLEL FUNCTION TEMPLATE find
template <class _FwdIt>
using _Parallel_find_results = conditional_t<_Use_atomic_iterator<_FwdIt>, _Parallel_choose_min_result<_FwdIt>,
_Parallel_choose_min_chunk<_FwdIt>>;
@ -1378,7 +1346,6 @@ _NODISCARD _FwdIt find(_ExPo&& _Exec, _FwdIt _First, const _FwdIt _Last, const _
return _First;
}
// PARALLEL FUNCTION TEMPLATE find_if
template <class _ExPo, class _FwdIt, class _Pr, _Enable_if_execution_policy_t<_ExPo> /* = 0 */>
_NODISCARD _FwdIt find_if(_ExPo&& _Exec, _FwdIt _First, const _FwdIt _Last, _Pr _Pred) noexcept /* terminates */ {
// find first satisfying _Pred
@ -1392,7 +1359,6 @@ _NODISCARD _FwdIt find_if(_ExPo&& _Exec, _FwdIt _First, const _FwdIt _Last, _Pr
return _First;
}
// PARALLEL FUNCTION TEMPLATE find_if_not
template <class _ExPo, class _FwdIt, class _Pr, _Enable_if_execution_policy_t<_ExPo> /* = 0 */>
_NODISCARD _FwdIt find_if_not(_ExPo&& _Exec, _FwdIt _First, const _FwdIt _Last, _Pr _Pred) noexcept /* terminates */ {
// find first satisfying !_Pred
@ -1407,7 +1373,6 @@ _NODISCARD _FwdIt find_if_not(_ExPo&& _Exec, _FwdIt _First, const _FwdIt _Last,
return _First;
}
// PARALLEL FUNCTION TEMPLATE find_end
template <class _FwdIt1, class _FwdIt2>
_Iter_diff_t<_FwdIt1> _Get_find_end_forward_partition_size(
_FwdIt1 _First1, const _FwdIt1 _Last1, _FwdIt2 _First2, const _FwdIt2 _Last2) {
@ -1607,7 +1572,6 @@ _NODISCARD _FwdIt1 find_end(_ExPo&&, _FwdIt1 _First1, const _FwdIt1 _Last1, cons
return _First1;
}
// PARALLEL FUNCTION TEMPLATE find_first_of
template <class _ExPo, class _FwdIt1, class _FwdIt2, class _Pr, _Enable_if_execution_policy_t<_ExPo> /* = 0 */>
_NODISCARD _FwdIt1 find_first_of(_ExPo&& _Exec, const _FwdIt1 _First1, _FwdIt1 _Last1, const _FwdIt2 _First2,
const _FwdIt2 _Last2, _Pr _Pred) noexcept /* terminates */ {
@ -1630,7 +1594,6 @@ _NODISCARD _FwdIt1 find_first_of(_ExPo&& _Exec, const _FwdIt1 _First1, _FwdIt1 _
return _Last1;
}
// PARALLEL FUNCTION TEMPLATE adjacent_find
template <class _FwdIt, class _Pr>
struct _Static_partitioned_adjacent_find2 {
_Static_partition_team<_Iter_diff_t<_FwdIt>> _Team;
@ -1703,7 +1666,6 @@ _NODISCARD _FwdIt adjacent_find(_ExPo&&, _FwdIt _First, _FwdIt _Last, _Pr _Pred)
return _Last;
}
// PARALLEL FUNCTION TEMPLATES count AND count_if
template <class _FwdIt, class _Pr>
struct _Static_partitioned_count_if2 {
using _Diff = _Iter_diff_t<_FwdIt>;
@ -1779,7 +1741,6 @@ _NODISCARD _Iter_diff_t<_FwdIt> count(_ExPo&& _Exec, const _FwdIt _First, const
[&_Val](auto&& _Iter_val) { return _STD forward<decltype(_Iter_val)>(_Iter_val) == _Val; });
}
// PARALLEL FUNCTION TEMPLATE mismatch
template <class _FwdIt1, class _FwdIt2,
bool = _Use_atomic_iterator<_Unwrapped_t<const _FwdIt1&>>&& _Is_random_iter_v<_FwdIt2>,
bool = _Use_atomic_iterator<_Unwrapped_t<const _FwdIt2&>>&& _Is_random_iter_v<_FwdIt1>>
@ -1976,7 +1937,6 @@ _NODISCARD pair<_FwdIt1, _FwdIt2> mismatch(
return {_First1, _First2};
}
// PARALLEL FUNCTION TEMPLATE equal
template <class _FwdIt1, class _FwdIt2, class _Pr>
struct _Static_partitioned_equal2 {
using _Diff = _Common_diff_t<_FwdIt1, _FwdIt2>;
@ -2091,7 +2051,6 @@ _NODISCARD bool equal(_ExPo&&, const _FwdIt1 _First1, const _FwdIt1 _Last1, cons
return _STD equal(_UFirst1, _ULast1, _UFirst2, _ULast2, _Pass_fn(_Pred));
}
// PARALLEL FUNCTION TEMPLATE search
template <class _FwdItHaystack, class _FwdItPat, class _Pr>
struct _Static_partitioned_search2 {
_Static_partition_team<_Iter_diff_t<_FwdItHaystack>> _Team;
@ -2211,7 +2170,6 @@ _NODISCARD _FwdItHaystack search(_ExPo&&, const _FwdItHaystack _First1, _FwdItHa
return _Last1;
}
// PARALLEL FUNCTION TEMPLATE search_n
template <class _FwdIt, class _Ty, class _Pr>
struct _Static_partitioned_search_n2 {
_Static_partition_team<_Iter_diff_t<_FwdIt>> _Team;
@ -2309,7 +2267,6 @@ _NODISCARD _FwdIt search_n(_ExPo&&, const _FwdIt _First, _FwdIt _Last, const _Di
return _Last;
}
// PARALLEL FUNCTION TEMPLATE transform
template <class _FwdIt1, class _FwdIt2, class _Fn>
struct _Static_partitioned_unary_transform2 {
using _Diff = _Common_diff_t<_FwdIt1, _FwdIt2>;
@ -2466,7 +2423,6 @@ _FwdIt3 transform(_ExPo&&, const _FwdIt1 _First1, const _FwdIt1 _Last1, const _F
}
#pragma warning(pop)
// PARALLEL FUNCTION TEMPLATE replace
template <class _ExPo, class _FwdIt, class _Ty, _Enable_if_execution_policy_t<_ExPo> /* = 0 */>
void replace(_ExPo&& _Exec, const _FwdIt _First, const _FwdIt _Last, const _Ty& _Oldval, const _Ty& _Newval) noexcept
/* terminates */ {
@ -2479,7 +2435,6 @@ void replace(_ExPo&& _Exec, const _FwdIt _First, const _FwdIt _Last, const _Ty&
});
}
// PARALLEL FUNCTION TEMPLATE replace_if
template <class _ExPo, class _FwdIt, class _Pr, class _Ty, _Enable_if_execution_policy_t<_ExPo> /* = 0 */>
void replace_if(_ExPo&& _Exec, const _FwdIt _First, const _FwdIt _Last, _Pr _Pred, const _Ty& _Val) noexcept
/* terminates */ {
@ -2493,7 +2448,6 @@ void replace_if(_ExPo&& _Exec, const _FwdIt _First, const _FwdIt _Last, _Pr _Pre
});
}
// PARALLEL FUNCTION TEMPLATES remove AND remove_if
template <class _FwdIt, class _Pr>
_FwdIt _Remove_move_if_unchecked(_FwdIt _First, const _FwdIt _Last, _FwdIt _Dest, _Pr _Pred) {
// move omitting each element satisfying _Pred
@ -2640,7 +2594,6 @@ _NODISCARD _FwdIt remove(_ExPo&& _Exec, const _FwdIt _First, const _FwdIt _Last,
[&_Val](auto&& _Lhs) { return _STD forward<decltype(_Lhs)>(_Lhs) == _Val; });
}
// PARALLEL FUNCTION TEMPLATE sort
template <class _Diff>
struct _Sort_work_item_impl { // data describing an individual sort work item
using difference_type = _Diff;
@ -2780,7 +2733,6 @@ void sort(_ExPo&&, const _RanIt _First, const _RanIt _Last, _Pr _Pred) noexcept
_Sort_unchecked(_UFirst, _ULast, _Ideal, _Pass_fn(_Pred));
}
// PARALLEL FUNCTION TEMPLATE stable_sort
template <class _Ty>
struct _Static_partitioned_temporary_buffer2 {
_Optimistic_temporary_buffer<_Ty>& _Temp_buf;
@ -3043,7 +2995,6 @@ void stable_sort(_ExPo&&, const _BidIt _First, const _BidIt _Last, _Pr _Pred) no
_Stable_sort_unchecked(_UFirst, _ULast, _Count, _Temp_buf._Data, _Temp_buf._Capacity, _Pass_fn(_Pred));
}
// PARALLEL FUNCTION TEMPLATE is_sorted_until
template <class _FwdIt, class _Pr>
struct _Static_partitioned_is_sorted_until {
_Static_partition_team<_Iter_diff_t<_FwdIt>> _Team;
@ -3119,7 +3070,6 @@ _NODISCARD _FwdIt is_sorted_until(_ExPo&&, _FwdIt _First, _FwdIt _Last, _Pr _Pre
return _First;
}
// PARALLEL FUNCTION TEMPLATE is_partitioned
inline constexpr unsigned char _Contains_counterexample = 0;
inline constexpr unsigned char _Contains_true = 1;
inline constexpr unsigned char _Contains_false = 2;
@ -3272,7 +3222,6 @@ _NODISCARD bool is_partitioned(_ExPo&&, const _FwdIt _First, const _FwdIt _Last,
return _STD is_partitioned(_UFirst, _ULast, _Pass_fn(_Pred));
}
// PARALLEL FUNCTION TEMPLATE is_heap_until
template <class _RanIt, class _Pr>
struct _Static_partitioned_is_heap_until {
using _Diff = _Iter_diff_t<_RanIt>;
@ -3346,7 +3295,6 @@ _NODISCARD _RanIt is_heap_until(_ExPo&&, _RanIt _First, _RanIt _Last, _Pr _Pred)
return _First;
}
// PARALLEL FUNCTION TEMPLATE partition
template <class _FwdIt, class _Pr>
pair<_FwdIt, _Iter_diff_t<_FwdIt>> _Partition_with_count_unchecked(_FwdIt _First, _FwdIt _Last, _Pr _Pred) {
// move elements satisfying _Pred to front and track how many elements satisfy _Pred
@ -3594,7 +3542,6 @@ _FwdIt partition(_ExPo&&, _FwdIt _First, const _FwdIt _Last, _Pr _Pred) noexcept
return _First;
}
// PARALLEL FUNCTION TEMPLATE set_intersection
inline constexpr unsigned char _Local_available = 1;
inline constexpr unsigned char _Sum_available = 2;
@ -3939,7 +3886,6 @@ _FwdIt3 set_intersection(_ExPo&&, _FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _Firs
return _Dest;
}
// PARALLEL FUNCTION TEMPLATE set_difference
struct _Set_difference_per_chunk {
template <class _RanIt1, class _RanIt2, class _RanIt3, class _Pr>
_Common_diff_t<_RanIt1, _RanIt2, _RanIt3> _Update_dest(
@ -4029,7 +3975,6 @@ _FwdIt3 set_difference(_ExPo&&, _FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _First2
return _Dest;
}
// PARALLEL FUNCTION TEMPLATE reduce
template <class _InIt, class _Ty, class _BinOp>
_Ty _Reduce_move_unchecked(_InIt _First, const _InIt _Last, _Ty _Val, _BinOp _Reduce_op) {
// return reduction, choose optimization
@ -4134,7 +4079,6 @@ _NODISCARD _Ty reduce(_ExPo&&, const _FwdIt _First, const _FwdIt _Last, _Ty _Val
return _STD reduce(_UFirst, _ULast, _STD move(_Val), _Pass_fn(_Reduce_op));
}
// PARALLEL FUNCTION TEMPLATE transform_reduce
template <class _FwdIt1, class _FwdIt2, class _Ty, class _BinOp1, class _BinOp2>
struct _Static_partitioned_transform_reduce_binary2 { // transform-reduction task scheduled on the system thread pool
using _Diff = _Common_diff_t<_FwdIt1, _FwdIt2>;
@ -4333,7 +4277,6 @@ _NODISCARD _Ty transform_reduce(_ExPo&&, const _FwdIt _First, const _FwdIt _Last
return _STD transform_reduce(_UFirst, _ULast, _STD move(_Val), _Pass_fn(_Reduce_op), _Pass_fn(_Transform_op));
}
// PARALLEL FUNCTION TEMPLATE exclusive_scan
struct _No_init_tag {
explicit _No_init_tag() = default;
}; // tag to indicate that no initial value is to be used
@ -4480,7 +4423,6 @@ _FwdIt2 exclusive_scan(_ExPo&&, const _FwdIt1 _First, const _FwdIt1 _Last, _FwdI
return _Dest;
}
// PARALLEL FUNCTION TEMPLATE inclusive_scan
template <class _FwdIt1, class _FwdIt2, class _BinOp, class _Ty>
_FwdIt2 _Inclusive_scan_per_chunk(
_FwdIt1 _First, const _FwdIt1 _Last, _FwdIt2 _Dest, _BinOp _Reduce_op, _Ty& _Val, _No_init_tag) {
@ -4668,7 +4610,6 @@ _FwdIt2 inclusive_scan(_ExPo&&, _FwdIt1 _First, _FwdIt1 _Last, _FwdIt2 _Dest, _B
return _Dest;
}
// PARALLEL FUNCTION TEMPLATE transform_exclusive_scan
template <class _FwdIt1, class _FwdIt2, class _BinOp, class _UnaryOp, class _Ty>
_FwdIt2 _Transform_exclusive_scan_per_chunk(
_FwdIt1 _First, const _FwdIt1 _Last, _FwdIt2 _Dest, _BinOp _Reduce_op, _UnaryOp _Transform_op, _Ty& _Val) {
@ -4814,7 +4755,6 @@ _FwdIt2 transform_exclusive_scan(_ExPo&&, const _FwdIt1 _First, const _FwdIt1 _L
return _Dest;
}
// PARALLEL FUNCTION TEMPLATE transform_inclusive_scan
template <class _FwdIt1, class _FwdIt2, class _BinOp, class _UnaryOp, class _Ty>
_FwdIt2 _Transform_inclusive_scan_per_chunk(_FwdIt1 _First, const _FwdIt1 _Last, _FwdIt2 _Dest, _BinOp _Reduce_op,
_UnaryOp _Transform_op, _Ty& _Val, _No_init_tag) {
@ -5011,7 +4951,6 @@ _FwdIt2 transform_inclusive_scan(_ExPo&&, const _FwdIt1 _First, const _FwdIt1 _L
return _Dest;
}
// PARALLEL FUNCTION TEMPLATE adjacent_difference
template <class _FwdIt1, class _FwdIt2, class _BinOp>
struct _Static_partitioned_adjacent_difference2 {
using _Diff = _Common_diff_t<_FwdIt1, _FwdIt2>;

Просмотреть файл

@ -61,11 +61,9 @@ namespace experimental {
using promise_type = typename _Ret::promise_type;
};
// STRUCT TEMPLATE coroutine_traits
template <typename _Ret, typename... _Ts>
struct coroutine_traits : _Coroutine_traits_sfinae<_Ret> {};
// STRUCT TEMPLATE coroutine_handle
template <typename _PromiseT = void>
struct coroutine_handle;
@ -192,7 +190,6 @@ namespace experimental {
}
// STRUCT suspend_if
struct suspend_if {
bool _Ready;
@ -207,7 +204,6 @@ namespace experimental {
void await_resume() noexcept {}
};
// STRUCT suspend_always
struct suspend_always {
bool await_ready() noexcept {
return false;
@ -218,7 +214,6 @@ namespace experimental {
void await_resume() noexcept {}
};
// STRUCT suspend_never
struct suspend_never {
bool await_ready() noexcept {
return true;

Просмотреть файл

@ -22,13 +22,11 @@ _STD_BEGIN
namespace experimental {
inline namespace fundamentals_v2 {
// FUNCTION TEMPLATE erase_if
template <class _Ty, class _Alloc, class _Pr>
_DEPRECATE_EXPERIMENTAL_ERASE void erase_if(deque<_Ty, _Alloc>& _Cont, _Pr _Pred) {
_Erase_remove_if(_Cont, _Pass_fn(_Pred));
}
// FUNCTION TEMPLATE erase
template <class _Ty, class _Alloc, class _Uty>
_DEPRECATE_EXPERIMENTAL_ERASE void erase(deque<_Ty, _Alloc>& _Cont, const _Uty& _Val) {
_Erase_remove(_Cont, _Val);

Просмотреть файл

@ -62,7 +62,6 @@ using _Pchar = wchar_t; // UTF16
struct _Char8_t; // flag for UTF8
// ENUM file_type
enum class file_type { // names for file types
not_found = -1,
none,
@ -76,7 +75,6 @@ enum class file_type { // names for file types
unknown
};
// ENUM copy_options
enum class copy_options { // names for copy options
none = 0,
skip_existing = 1,
@ -93,13 +91,11 @@ enum class copy_options { // names for copy options
_BITMASK_OPS(copy_options)
// ENUM directory_options
enum class directory_options { // names for directory options
none = 0,
follow_directory_symlink
};
// ENUM perms
enum class perms { // names for permissions
none = 0,
owner_read = 0400, // S_IRUSR
@ -127,7 +123,6 @@ enum class perms { // names for permissions
_BITMASK_OPS(perms)
// CLASS file_status
class file_status { // stores file status
public:
explicit file_status(file_type _Ftype = file_type::none, perms _Prms = perms::unknown) noexcept
@ -160,14 +155,12 @@ private:
perms _Myperms;
};
// STRUCT space_info
struct space_info { // space information for a file
uintmax_t capacity;
uintmax_t free;
uintmax_t available;
};
// SYSTEM SUPPORT FUNCTIONS
// wide filenames
_FS_DLL void* __CLRCALL_PURE_OR_CDECL _Open_dir(wchar_t (&)[_MAX_FILESYS_NAME], const wchar_t*, int&, file_type&);
_FS_DLL wchar_t* __CLRCALL_PURE_OR_CDECL _Read_dir(wchar_t (&)[_MAX_FILESYS_NAME], void*, file_type&);
@ -197,7 +190,6 @@ _FS_DLL int __CLRCALL_PURE_OR_CDECL _Unlink(const wchar_t*);
_FS_DLL int __CLRCALL_PURE_OR_CDECL _Copy_file(const wchar_t*, const wchar_t*);
_FS_DLL int __CLRCALL_PURE_OR_CDECL _Chmod(const wchar_t*, perms);
// STRUCT TEMPLATE _Path_cvt
template <class _Inchar, class _Outchar, class _Outtraits = char_traits<_Outchar>,
class _Outalloc = allocator<_Outchar>>
struct _Path_cvt { // converts among {char, wchar_t, UTF8, char16_t, char32_t} paths
@ -435,7 +427,6 @@ struct _Path_cvt<char32_t, wchar_t, _Outtraits,
};
_STL_RESTORE_DEPRECATED_WARNING
// FORWARD REFERENCES
class path;
path operator/(const path&, const path&);
@ -571,7 +562,6 @@ path system_complete(const path&, error_code&);
path temp_directory_path();
path temp_directory_path(error_code&);
// CLASS TEMPLATE _Path_iterator
template <class _Path_type>
class _Path_iterator {
public:
@ -731,7 +721,6 @@ private:
size_t _Myoff; // current offset in full path
};
// CLASS path AND FRIENDS
class path { // stores a pathname
public:
using value_type = _Pchar;
@ -743,8 +732,6 @@ public:
path(const path& _Right) : _Mystr(_Right._Mystr) {}
// ARBITRARY SOURCE CONSTRUCT
template <class _InIt, enable_if_t<_Is_iterator_v<_InIt>, int> = 0>
path(_InIt _First, _InIt _Last) {
using _Valty = _Iter_value_t<_InIt>;
@ -771,8 +758,6 @@ public:
*this /= _Path_cvt<_Elem, value_type>::_Cvt(_Str_out, _Str.c_str(), _Str.size());
}
// ARBITRARY SOURCE CONSTRUCT, WITH LOCALE
template <class _InIt, enable_if_t<_Is_iterator_v<_InIt>, int> = 0>
path(_InIt _First, _InIt _Last, const locale& _Loc) {
using _Valty = _Iter_value_t<_InIt>;
@ -808,7 +793,6 @@ public:
~path() noexcept {}
// ARBITRARY SOURCE ASSIGN
path& operator=(const path& _Right) {
_Mystr = _Right._Mystr;
return *this;
@ -839,7 +823,6 @@ public:
return *this = path(_Str);
}
// ARBITRARY SOURCE APPEND
path& operator/=(const path& _Path) { // append copy
return append(_Path._Mystr);
}
@ -886,7 +869,6 @@ public:
return *this;
}
// ARBITRARY SOURCE CONCATENATE
path& operator+=(const path& _Path) { // concatenate copy
return concat(_Path._Mystr);
}
@ -935,7 +917,6 @@ public:
return *this;
}
// PATH MODIFIERS
void clear() noexcept { // clear the stored string
_Mystr.clear();
}
@ -987,7 +968,6 @@ public:
_Mystr.swap(_Right._Mystr);
}
// NATIVE FORMAT OBSERVERS
_NODISCARD const string_type& native() const noexcept {
return _Mystr;
}
@ -1036,8 +1016,6 @@ public:
}
#endif // 0
// GENERIC FORMAT OBSERVERS
string_type _Make_generic() const { // copy and convert any '\' to '/'
string_type _Str = _Mystr;
_STD replace(_Str.begin(), _Str.end(), _FS_BSLASH, _FS_SLASH);
@ -1086,7 +1064,6 @@ public:
}
#endif // 0
// PATH COMPARISON
_NODISCARD int compare(const path& _Path) const noexcept { // compare native() to _Path.native()
return _Mystr.compare(_Path._Mystr);
}
@ -1099,7 +1076,6 @@ public:
return _Mystr.compare(_Ptr);
}
// PATH DECOMPOSITION
_NODISCARD path root_name() const {
return path(_Mystr.substr(0, _Prefix_end()));
}
@ -1202,7 +1178,6 @@ public:
return !is_absolute();
}
// PATH ITERATOR SUPPORT
using iterator = _Path_iterator<path>;
using const_iterator = iterator;
@ -1298,7 +1273,6 @@ basic_istream<_Elem, _Traits>& operator>>(basic_istream<_Elem, _Traits>& _Istr,
return _Istr;
}
// FUNCTION TEMPLATE u8path
template <class _InIt, enable_if_t<_Is_iterator_v<_InIt>, int> = 0>
_NODISCARD path u8path(_InIt _First, _InIt _Last) { // make path from [_First, _Last) UTF8, given iterators
string _Str(_First, _Last);
@ -1323,7 +1297,6 @@ _NODISCARD path u8path(const basic_string<char, _Traits, _Alloc>& _Str) { // mak
return path(_Path_cvt<_Char8_t, _Pchar>::_Cvt(_Str_out, _Str.c_str(), _Str.size()));
}
// CLASS filesystem_error AND FRIENDS
class filesystem_error : public system_error { // base of all filesystem-error exceptions
public:
explicit filesystem_error(
@ -1376,7 +1349,6 @@ protected:
_THROW(filesystem_error{_Message}); // centralize construction of temporary string
}
// CLASS directory_entry AND FRIENDS
class directory_entry { // represents a directory entry
public:
using string_type = _FSPFX path::string_type;
@ -1625,7 +1597,6 @@ _NODISCARD inline directory_iterator end(const directory_iterator&) noexcept {
return {};
}
// CLASS recursive_directory_iterator
class recursive_directory_iterator {
public:
using _Myiter = _Directory_iterator<false_type>;
@ -1775,7 +1746,6 @@ _NODISCARD inline recursive_directory_iterator end(const recursive_directory_ite
return {};
}
// OPERATIONAL FUNCTIONS
inline path _Absolute(const path& _Path, const path& _Base,
error_code& _Code) { // make absolute path from _Path and directory _Base; errors in _Code
_Code.clear();

Просмотреть файл

@ -22,13 +22,11 @@ _STD_BEGIN
namespace experimental {
inline namespace fundamentals_v2 {
// FUNCTION TEMPLATE erase_if
template <class _Ty, class _Alloc, class _Pr>
_DEPRECATE_EXPERIMENTAL_ERASE void erase_if(forward_list<_Ty, _Alloc>& _Cont, _Pr _Pred) {
_Cont.remove_if(_Pass_fn(_Pred));
}
// FUNCTION TEMPLATE erase
template <class _Ty, class _Alloc, class _Uty>
_DEPRECATE_EXPERIMENTAL_ERASE void erase(forward_list<_Ty, _Alloc>& _Cont, const _Uty& _Val) {
_Cont.remove_if([&](_Ty& _Elem) { return _Elem == _Val; });

Просмотреть файл

@ -22,13 +22,11 @@ _STD_BEGIN
namespace experimental {
inline namespace fundamentals_v2 {
// FUNCTION TEMPLATE erase_if
template <class _Ty, class _Alloc, class _Pr>
_DEPRECATE_EXPERIMENTAL_ERASE void erase_if(list<_Ty, _Alloc>& _Cont, _Pr _Pred) {
_Cont.remove_if(_Pass_fn(_Pred));
}
// FUNCTION TEMPLATE erase
template <class _Ty, class _Alloc, class _Uty>
_DEPRECATE_EXPERIMENTAL_ERASE void erase(list<_Ty, _Alloc>& _Cont, const _Uty& _Val) {
_Cont.remove_if([&](_Ty& _Elem) { return _Elem == _Val; });

Просмотреть файл

@ -22,7 +22,6 @@ _STD_BEGIN
namespace experimental {
inline namespace fundamentals_v2 {
// FUNCTION TEMPLATE erase_if
template <class _Kty, class _Ty, class _Keylt, class _Alloc, class _Pr>
_DEPRECATE_EXPERIMENTAL_ERASE void erase_if(map<_Kty, _Ty, _Keylt, _Alloc>& _Cont, _Pr _Pred) {
_Erase_nodes_if(_Cont, _Pass_fn(_Pred));

Просмотреть файл

@ -31,10 +31,8 @@ _STD_BEGIN
namespace experimental {
#ifndef __EDG__
// STRUCT noop_coroutine_promise
struct noop_coroutine_promise {};
// STRUCT coroutine_handle<noop_coroutine_promise>
template <>
struct coroutine_handle<noop_coroutine_promise> : coroutine_handle<> {
friend coroutine_handle noop_coroutine() noexcept;
@ -67,10 +65,8 @@ namespace experimental {
}
};
// ALIAS noop_coroutine_handle
using noop_coroutine_handle = coroutine_handle<noop_coroutine_promise>;
// FUNCTION noop_coroutine
_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{};

Просмотреть файл

@ -22,7 +22,6 @@ _STD_BEGIN
namespace experimental {
inline namespace fundamentals_v2 {
// FUNCTION TEMPLATE erase_if
template <class _Kty, class _Keylt, class _Alloc, class _Pr>
_DEPRECATE_EXPERIMENTAL_ERASE void erase_if(set<_Kty, _Keylt, _Alloc>& _Cont, _Pr _Pred) {
_Erase_nodes_if(_Cont, _Pass_fn(_Pred));

Просмотреть файл

@ -22,13 +22,11 @@ _STD_BEGIN
namespace experimental {
inline namespace fundamentals_v2 {
// FUNCTION TEMPLATE erase_if
template <class _Elem, class _Traits, class _Alloc, class _Pr>
_DEPRECATE_EXPERIMENTAL_ERASE void erase_if(basic_string<_Elem, _Traits, _Alloc>& _Cont, _Pr _Pred) {
_Erase_remove_if(_Cont, _Pass_fn(_Pred));
}
// FUNCTION TEMPLATE erase
template <class _Elem, class _Traits, class _Alloc, class _Uty>
_DEPRECATE_EXPERIMENTAL_ERASE void erase(basic_string<_Elem, _Traits, _Alloc>& _Cont, const _Uty& _Val) {
_Erase_remove(_Cont, _Val);

Просмотреть файл

@ -22,7 +22,6 @@ _STD_BEGIN
namespace experimental {
inline namespace fundamentals_v2 {
// FUNCTION TEMPLATE erase_if
template <class _Kty, class _Ty, class _Hasher, class _Keyeq, class _Alloc, class _Pr>
_DEPRECATE_EXPERIMENTAL_ERASE void erase_if(
unordered_map<_Kty, _Ty, _Hasher, _Keyeq, _Alloc>& _Cont, _Pr _Pred) {

Просмотреть файл

@ -22,7 +22,6 @@ _STD_BEGIN
namespace experimental {
inline namespace fundamentals_v2 {
// FUNCTION TEMPLATE erase_if
template <class _Kty, class _Hasher, class _Keyeq, class _Alloc, class _Pr>
_DEPRECATE_EXPERIMENTAL_ERASE void erase_if(unordered_set<_Kty, _Hasher, _Keyeq, _Alloc>& _Cont, _Pr _Pred) {
_Erase_nodes_if(_Cont, _Pass_fn(_Pred));

Просмотреть файл

@ -22,13 +22,11 @@ _STD_BEGIN
namespace experimental {
inline namespace fundamentals_v2 {
// FUNCTION TEMPLATE erase_if
template <class _Ty, class _Alloc, class _Pr>
_DEPRECATE_EXPERIMENTAL_ERASE void erase_if(vector<_Ty, _Alloc>& _Cont, _Pr _Pred) {
_Erase_remove_if(_Cont, _Pass_fn(_Pred));
}
// FUNCTION TEMPLATE erase
template <class _Ty, class _Alloc, class _Uty>
_DEPRECATE_EXPERIMENTAL_ERASE void erase(vector<_Ty, _Alloc>& _Cont, const _Uty& _Val) {
_Erase_remove(_Cont, _Val);

Просмотреть файл

@ -409,7 +409,6 @@ namespace filesystem {
}
}
// FUNCTION TEMPLATE _Unaligned_load
template <class _Ty>
_NODISCARD _Ty _Unaligned_load(const void* _Ptr) { // load a _Ty from _Ptr
static_assert(is_trivial_v<_Ty>, "Unaligned loads require trivial types");
@ -674,7 +673,6 @@ namespace filesystem {
}
};
// CLASS path
template <class _Base_iter>
class _Path_iterator;
@ -1451,7 +1449,6 @@ namespace filesystem {
return path(_Convert_range_to_wide(_First, _Last, _Utf8_conversion{}));
}
// CLASS TEMPLATE _Path_iterator
template <class _Base_iter>
class _Path_iterator { // almost bidirectional iterator for path
public:
@ -1790,7 +1787,6 @@ namespace filesystem {
return iterator(_Text.cend(), this);
}
// CLASS filesystem_error
class filesystem_error : public system_error { // base of all filesystem-error exceptions
public:
filesystem_error(const string& _Message, const error_code _Errcode)
@ -1872,7 +1868,6 @@ namespace filesystem {
_THROW(filesystem_error(_Op, _Path1, _Path2, _Error));
}
// ENUM CLASS file_type
enum class file_type {
none,
not_found,
@ -1892,7 +1887,6 @@ namespace filesystem {
junction // implementation-defined value indicating an NT junction
};
// ENUM CLASS perms
enum class perms {
none = 0,
@ -1924,7 +1918,6 @@ namespace filesystem {
_BITMASK_OPS(perms)
// ENUM CLASS copy_options
enum class copy_options {
none = static_cast<int>(__std_fs_copy_options::_None),
@ -1949,7 +1942,6 @@ namespace filesystem {
_BITMASK_OPS(copy_options)
// CLASS file_status
class file_status {
public:
// [fs.file_status.cons], constructors and destructor
@ -2104,7 +2096,6 @@ namespace filesystem {
return _Status.type() == file_type::symlink;
}
// STRUCT _File_status_and_error
struct _File_status_and_error {
file_status _Status;
__std_win_error _Error;
@ -2123,14 +2114,12 @@ namespace filesystem {
inline constexpr auto _Symlink_status_stats_flags =
__std_fs_stats_flags::_Attributes | __std_fs_stats_flags::_Reparse_tag;
// ALIAS file_time_type
#if _HAS_CXX20
using file_time_type = _CHRONO time_point<_CHRONO file_clock>;
#else // ^^^ _HAS_CXX20 / !_HAS_CXX20 vvv
using file_time_type = _CHRONO time_point<filesystem::_File_time_clock>;
#endif // ^^^ !_HAS_CXX20
// CLASS directory_entry
class directory_entry {
public:
// [fs.dir.entry.cons], constructors and destructor
@ -2532,7 +2521,6 @@ namespace filesystem {
filesystem::path _Path;
};
// ENUM CLASS directory_options
enum class directory_options { none = 0, follow_directory_symlink = 1, skip_permission_denied = 2 };
_BITMASK_OPS(directory_options)
@ -2641,7 +2629,6 @@ namespace filesystem {
class directory_iterator;
class recursive_directory_iterator;
// STRUCT _Directory_entry_proxy
struct _Directory_entry_proxy {
_NODISCARD directory_entry operator*() && noexcept {
return _STD move(_Entry);
@ -2656,7 +2643,6 @@ namespace filesystem {
directory_entry _Entry;
};
// CLASS directory_iterator
class directory_iterator {
public:
using iterator_category = input_iterator_tag;
@ -2875,7 +2861,6 @@ namespace filesystem {
: _Dir_enum_impl(_STD move(_Create_data)), _Options(_Options_arg) {}
};
// CLASS recursive_directory_iterator
class recursive_directory_iterator {
public:
using iterator_category = input_iterator_tag;
@ -2998,7 +2983,6 @@ namespace filesystem {
return {};
}
// FUNCTION absolute
_NODISCARD inline __std_win_error _Absolute(path& _Result, const wstring& _Text) { // pre: _Result.empty()
if (_Text.empty()) {
return __std_win_error::_Success;
@ -3041,7 +3025,6 @@ namespace filesystem {
return _Result;
}
// FUNCTION canonical
_NODISCARD inline __std_win_error _Canonical(path& _Result, const wstring& _Text) { // pre: _Result.empty()
if (_Text.empty()) {
return __std_win_error::_Success;
@ -3116,7 +3099,6 @@ namespace filesystem {
return _Result;
}
// FUNCTION create_directory_symlink
_NODISCARD inline unique_ptr<wchar_t[]> _Get_cleaned_symlink_target(const path& _To) noexcept {
// transforms /s in the root-name to \s, and all other directory-separators into single \s
// example: a/\/b -> a\b
@ -3179,7 +3161,6 @@ namespace filesystem {
}
}
// FUNCTION create_hard_link
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:
@ -3195,7 +3176,6 @@ namespace filesystem {
_Ec = _Make_ec(__std_fs_create_hard_link(_New_hard_link.c_str(), _To.c_str()));
}
// FUNCTION create_symlink
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);
@ -3221,7 +3201,6 @@ namespace filesystem {
}
}
// FUNCTION read_symlink
_NODISCARD inline __std_win_error _Read_symlink_reparse_data(
const _Fs_file& _Handle, unique_ptr<char[]>& _Buffer_unique_ptr) noexcept {
constexpr auto _Buffer_size = 16 * 1024 + sizeof(wchar_t); // MAXIMUM_REPARSE_DATA_BUFFER_SIZE + sizeof(wchar_t)
@ -3286,7 +3265,6 @@ namespace filesystem {
return _Result;
}
// FUNCTION copy_symlink
_NODISCARD inline __std_win_error _Copy_symlink(const path& _Symlink, const path& _New_symlink) noexcept {
__std_win_error _Err;
unique_ptr<char[]> _Buffer_unique_ptr;
@ -3342,7 +3320,6 @@ namespace filesystem {
}
}
// FUNCTION copy_file
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
@ -3373,7 +3350,6 @@ namespace filesystem {
return _STD filesystem::copy_file(_From, _To, copy_options::none);
}
// FUNCTION equivalent
_NODISCARD inline pair<__std_win_error, bool> _Equivalent(
const wchar_t* const _Lhs, const wchar_t* const _Rhs) noexcept {
__std_fs_file_id _Left_id;
@ -3408,7 +3384,6 @@ namespace filesystem {
return _Result.second;
}
// FUNCTION exists
_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);
@ -3434,7 +3409,6 @@ namespace filesystem {
return _Result;
}
// FUNCTION file_size
_NODISCARD inline __std_win_error _File_size(const path& _Path, uintmax_t& _Result) noexcept {
__std_fs_stats _Stats;
const auto _Error = __std_fs_get_stats(
@ -3464,7 +3438,6 @@ namespace filesystem {
return _Result;
}
// FUNCTION hard_link_count
_NODISCARD inline __std_win_error _Hard_link_count(const path& _Path, uintmax_t& _Result) noexcept {
__std_fs_stats _Stats;
const auto _Error = __std_fs_get_stats(
@ -3495,7 +3468,6 @@ namespace filesystem {
return _Result;
}
// FUNCTION is_block_file
_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;
@ -3507,7 +3479,6 @@ namespace filesystem {
return false; // note status sets _Ec to an error on nonexistent input
}
// FUNCTION is_character_file
_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;
@ -3519,7 +3490,6 @@ namespace filesystem {
return false; // note status sets _Ec to an error on nonexistent input
}
// FUNCTION is_directory
_NODISCARD inline bool is_directory(const path& _Path) { // tests whether _Path is a directory
return _STD filesystem::is_directory(_STD filesystem::status(_Path));
}
@ -3529,7 +3499,6 @@ namespace filesystem {
return _STD filesystem::is_directory(_STD filesystem::status(_Path, _Ec));
}
// FUNCTION is_empty
_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
@ -3560,7 +3529,6 @@ namespace filesystem {
return _Result;
}
// FUNCTION is_fifo
_NODISCARD inline bool is_fifo(const path&) noexcept /* strengthened */ {
// tests whether the input path is a fifo (never on Windows)
return false;
@ -3572,7 +3540,6 @@ namespace filesystem {
return false; // note status sets _Ec to an error on nonexistent input
}
// FUNCTION is_other
_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));
}
@ -3582,7 +3549,6 @@ namespace filesystem {
return _STD filesystem::is_other(_STD filesystem::status(_Path, _Ec));
}
// FUNCTION is_regular_file
_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));
}
@ -3592,7 +3558,6 @@ namespace filesystem {
return _STD filesystem::is_regular_file(_STD filesystem::status(_Path, _Ec));
}
// FUNCTION is_socket
_NODISCARD inline bool is_socket(const path&) noexcept /* strengthened */ {
// tests whether the input path is a socket (never on Windows)
return false;
@ -3604,7 +3569,6 @@ namespace filesystem {
return false; // note status sets _Ec to an error on nonexistent input
}
// FUNCTION is_symlink
_NODISCARD inline bool is_symlink(const path& _Path) { // tests whether _Path is a symlink
return _STD filesystem::is_symlink(_STD filesystem::symlink_status(_Path));
}
@ -3613,7 +3577,6 @@ namespace filesystem {
return _STD filesystem::is_symlink(_STD filesystem::symlink_status(_Path, _Ec));
}
// FUNCTION remove
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
@ -3633,7 +3596,6 @@ namespace filesystem {
return _Result._Removed;
}
// FUNCTION rename
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,
@ -3651,7 +3613,6 @@ namespace filesystem {
_Ec = _Make_ec(__std_fs_rename(_Old_p.c_str(), _New_p.c_str()));
}
// FUNCTION resize_file
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);
@ -3665,7 +3626,6 @@ namespace filesystem {
_Ec = _Make_ec(__std_fs_resize_file(_Target.c_str(), _New_size));
}
// FUNCTION space
struct space_info {
uintmax_t capacity;
uintmax_t free;
@ -3694,12 +3654,10 @@ namespace filesystem {
return _Result;
}
// FUNCTION status_known
_NODISCARD inline bool status_known(const file_status _Status) noexcept {
return _Status.type() != file_type::none;
}
// FUNCTION status
_NODISCARD inline _File_status_and_error _Get_any_status(
const path& _Path, const __std_fs_stats_flags _Flags) noexcept {
_File_status_and_error _Result;
@ -3726,7 +3684,6 @@ namespace filesystem {
return _Result._Status;
}
// FUNCTION symlink_status
_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);
@ -3742,7 +3699,6 @@ namespace filesystem {
return _Result._Status;
}
// FUNCTION create_directory
inline bool create_directory(const path& _Path) {
const auto _Result = __std_fs_create_directory(_Path.c_str());
if (_Result._Error != __std_win_error::_Success) {
@ -3773,7 +3729,6 @@ namespace filesystem {
return _Result._Created;
}
// FUNCTION create_directories
inline bool create_directories(const path& _Path, error_code& _Ec) {
if (_Path.empty()) {
_Ec = _Make_ec(__std_win_error::_Path_not_found);
@ -3844,7 +3799,6 @@ namespace filesystem {
return _Result;
}
// FUNCTION remove_all
inline constexpr int _Remove_all_retry_count = 10;
inline void _Remove_all_dir(const path& _Path, error_code& _Ec, uintmax_t& _Removed_count) {
@ -3921,7 +3875,6 @@ namespace filesystem {
return _Removed_count;
}
// FUNCTION last_write_time
_NODISCARD inline __std_win_error _Last_write_time(const path& _Path, file_time_type& _Result) noexcept {
__std_fs_stats _Stats;
const auto _Error = __std_fs_get_stats(
@ -3964,7 +3917,6 @@ namespace filesystem {
_Ec = _Make_ec(__std_fs_set_last_write_time(_New_time.time_since_epoch().count(), _Target.c_str()));
}
// FUNCTION permissions
enum class perm_options { replace = 0x1, add = 0x2, remove = 0x4, nofollow = 0x8 };
_BITMASK_OPS(perm_options)
@ -4023,7 +3975,6 @@ namespace filesystem {
_STD filesystem::permissions(_Target, _Perms, perm_options::replace, _Ec);
}
// FUNCTION temp_directory_path
_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
@ -4050,7 +4001,6 @@ namespace filesystem {
return _Result;
}
// FUNCTION current_path
_NODISCARD inline __std_win_error _Current_path(path& _Result) noexcept {
_Result._Text.resize(__std_fs_max_path);
for (;;) {
@ -4090,7 +4040,6 @@ namespace filesystem {
}
}
// FUNCTION weakly_canonical
_NODISCARD inline path weakly_canonical(const path& _Input, error_code& _Ec) {
// eventually calls GetFinalPathNameByHandleW
_Ec.clear(); // for exception safety
@ -4153,7 +4102,6 @@ namespace filesystem {
return _Result;
}
// FUNCTION proximate
_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);
@ -4189,7 +4137,6 @@ namespace filesystem {
return _STD filesystem::proximate(_Path, _Base, _Ec);
}
// FUNCTION relative
_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);
@ -4225,7 +4172,6 @@ namespace filesystem {
return _STD filesystem::relative(_Path, _Base, _Ec);
}
// FUNCTION copy
inline void _Copy_impl(
const directory_entry& _From, const path& _To, const copy_options _Options, error_code& _Ec) {
// implement copy, does not clear _Ec for callers

Просмотреть файл

@ -22,7 +22,6 @@ _STL_DISABLE_CLANG_WARNINGS
#undef new
_STD_BEGIN
// CLASS TEMPLATE _Flist_unchecked_const_iterator
template <class _Mylist, class _Base = _Iterator_base0>
class _Flist_unchecked_const_iterator : public _Base {
public:
@ -82,7 +81,6 @@ public:
_Nodeptr _Ptr; // pointer to node
};
// CLASS TEMPLATE _Flist_unchecked_iterator
template <class _Mylist>
class _Flist_unchecked_iterator : public _Flist_unchecked_const_iterator<_Mylist> {
public:
@ -117,7 +115,6 @@ public:
}
};
// CLASS TEMPLATE _Flist_const_iterator
template <class _Mylist>
class _Flist_const_iterator : public _Flist_unchecked_const_iterator<_Mylist, _Iterator_base> {
public:
@ -189,7 +186,6 @@ public:
}
};
// CLASS TEMPLATE _Flist_iterator
template <class _Mylist>
class _Flist_iterator : public _Flist_const_iterator<_Mylist> {
public:
@ -230,7 +226,6 @@ public:
}
};
// forward_list TYPE WRAPPERS
template <class _Value_type, class _Size_type, class _Difference_type, class _Pointer, class _Const_pointer,
class _Reference, class _Const_reference, class _Nodeptr_type>
struct _Flist_iter_types {
@ -266,7 +261,6 @@ struct _Flist_simple_types : _Simple_types<_Ty> {
using _Nodeptr = _Node*;
};
// CLASS TEMPLATE _Flist_val
template <class _Val_types>
class _Flist_val : public _Container_base {
public:
@ -512,7 +506,6 @@ private:
pointer _Head; // Points at the first constructed node.
};
// CLASS TEMPLATE forward_list
template <class _Ty, class _Alloc = allocator<_Ty>>
class forward_list { // singly linked list
private:

Просмотреть файл

@ -67,7 +67,6 @@ extern _CRTIMP2_PURE FILE* __CLRCALL_PURE_OR_CDECL _Fiopen(const wchar_t*, ios_b
extern _CRTIMP2_PURE FILE* __CLRCALL_PURE_OR_CDECL _Fiopen(const unsigned short*, ios_base::openmode, int);
#endif // _NATIVE_WCHAR_T_DEFINED
// FUNCTION TEMPLATE _Fgetc
template <class _Elem>
bool _Fgetc(_Elem& _Ch, FILE* _File) { // get an element from a C stream
return _CSTD fread(&_Ch, sizeof(_Elem), 1, _File) == 1;
@ -108,7 +107,6 @@ inline bool _Fgetc(unsigned short& _Wchar, FILE* _File) { // get an unsigned sho
}
#endif // _NATIVE_WCHAR_T_DEFINED
// FUNCTION TEMPLATE _Fputc
template <class _Elem>
bool _Fputc(_Elem _Ch, FILE* _File) { // put an element to a C stream
return _CSTD fwrite(&_Ch, 1, sizeof(_Elem), _File) == sizeof(_Elem);
@ -131,7 +129,6 @@ inline bool _Fputc(unsigned short _Wchar, FILE* _File) { // put an unsigned shor
}
#endif // _NATIVE_WCHAR_T_DEFINED
// FUNCTION TEMPLATE _Ungetc
template <class _Elem>
bool _Ungetc(const _Elem&, FILE*) { // put back an arbitrary element to a C stream (always fail)
return false;
@ -164,7 +161,6 @@ inline bool _Ungetc(const unsigned short& _Wchar, FILE* _File) { // put back an
}
#endif // _NATIVE_WCHAR_T_DEFINED
// CLASS TEMPLATE basic_filebuf
template <class _Elem, class _Traits>
class basic_filebuf : public basic_streambuf<_Elem, _Traits> { // stream buffer associated with a C stream
public:
@ -805,7 +801,6 @@ void swap(basic_filebuf<_Elem, _Traits>& _Left, basic_filebuf<_Elem, _Traits>& _
_Left.swap(_Right);
}
// CLASS TEMPLATE basic_ifstream
template <class _Elem, class _Traits>
class basic_ifstream : public basic_istream<_Elem, _Traits> { // input stream associated with a C stream
public:
@ -990,7 +985,6 @@ void swap(basic_ifstream<_Elem, _Traits>& _Left, basic_ifstream<_Elem, _Traits>&
_Left.swap(_Right);
}
// CLASS TEMPLATE basic_ofstream
template <class _Elem, class _Traits>
class basic_ofstream : public basic_ostream<_Elem, _Traits> { // output stream associated with a C stream
public:
@ -1174,7 +1168,6 @@ void swap(basic_ofstream<_Elem, _Traits>& _Left, basic_ofstream<_Elem, _Traits>&
_Left.swap(_Right);
}
// CLASS TEMPLATE basic_fstream
template <class _Elem, class _Traits>
class basic_fstream : public basic_iostream<_Elem, _Traits> { // input/output stream associated with a C stream
public:

Просмотреть файл

@ -29,16 +29,8 @@ _STL_DISABLE_CLANG_WARNINGS
#undef new
_STD_BEGIN
// STRUCT TEMPLATE plus
// defined in <xstddef>
// plus, minus, and multiplies are defined in <xstddef>
// STRUCT TEMPLATE minus
// defined in <xstddef>
// STRUCT TEMPLATE multiplies
// defined in <xstddef>
// STRUCT TEMPLATE divides
template <class _Ty = void>
struct divides {
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ty _FIRST_ARGUMENT_TYPE_NAME;
@ -50,7 +42,6 @@ struct divides {
}
};
// STRUCT TEMPLATE modulus
template <class _Ty = void>
struct modulus {
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ty _FIRST_ARGUMENT_TYPE_NAME;
@ -62,7 +53,6 @@ struct modulus {
}
};
// STRUCT TEMPLATE negate
template <class _Ty = void>
struct negate {
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ty _ARGUMENT_TYPE_NAME;
@ -73,25 +63,8 @@ struct negate {
}
};
// STRUCT TEMPLATE equal_to
// defined in <xstddef>
// equal_to, not_equal_to, greater, less, greater_equal, and less_equal are defined in <xstddef>
// STRUCT TEMPLATE not_equal_to
// defined in <xstddef>
// STRUCT TEMPLATE greater
// defined in <xstddef>
// STRUCT TEMPLATE less
// defined in <xstddef>
// STRUCT TEMPLATE greater_equal
// defined in <xstddef>
// STRUCT TEMPLATE less_equal
// defined in <xstddef>
// STRUCT TEMPLATE logical_and
template <class _Ty = void>
struct logical_and {
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ty _FIRST_ARGUMENT_TYPE_NAME;
@ -103,7 +76,6 @@ struct logical_and {
}
};
// STRUCT TEMPLATE logical_or
template <class _Ty = void>
struct logical_or {
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ty _FIRST_ARGUMENT_TYPE_NAME;
@ -115,7 +87,6 @@ struct logical_or {
}
};
// STRUCT TEMPLATE logical_not
template <class _Ty = void>
struct logical_not {
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ty _ARGUMENT_TYPE_NAME;
@ -126,7 +97,6 @@ struct logical_not {
}
};
// STRUCT TEMPLATE bit_and
template <class _Ty = void>
struct bit_and {
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ty _FIRST_ARGUMENT_TYPE_NAME;
@ -138,7 +108,6 @@ struct bit_and {
}
};
// STRUCT TEMPLATE bit_or
template <class _Ty = void>
struct bit_or {
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ty _FIRST_ARGUMENT_TYPE_NAME;
@ -150,7 +119,6 @@ struct bit_or {
}
};
// STRUCT TEMPLATE bit_xor
template <class _Ty = void>
struct bit_xor {
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ty _FIRST_ARGUMENT_TYPE_NAME;
@ -162,7 +130,6 @@ struct bit_xor {
}
};
// STRUCT TEMPLATE bit_not
template <class _Ty = void>
struct bit_not {
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ty _ARGUMENT_TYPE_NAME;
@ -173,16 +140,8 @@ struct bit_not {
}
};
// STRUCT TEMPLATE SPECIALIZATION plus
// defined in <xstddef>
// void specializations of plus, minus, and multiplies are defined in <xstddef>
// STRUCT TEMPLATE SPECIALIZATION minus
// defined in <xstddef>
// STRUCT TEMPLATE SPECIALIZATION multiplies
// defined in <xstddef>
// STRUCT TEMPLATE SPECIALIZATION divides
template <>
struct divides<void> {
template <class _Ty1, class _Ty2>
@ -194,7 +153,6 @@ struct divides<void> {
using is_transparent = int;
};
// STRUCT TEMPLATE SPECIALIZATION modulus
template <>
struct modulus<void> {
template <class _Ty1, class _Ty2>
@ -206,7 +164,6 @@ struct modulus<void> {
using is_transparent = int;
};
// STRUCT TEMPLATE SPECIALIZATION negate
template <>
struct negate<void> {
template <class _Ty>
@ -217,25 +174,8 @@ struct negate<void> {
using is_transparent = int;
};
// STRUCT TEMPLATE SPECIALIZATION equal_to
// defined in <xstddef>
// void specializations of equal_to, not_equal_to, greater, less, greater_equal, and less_equal are defined in <xstddef>
// STRUCT TEMPLATE SPECIALIZATION not_equal_to
// defined in <xstddef>
// STRUCT TEMPLATE SPECIALIZATION greater
// defined in <xstddef>
// STRUCT TEMPLATE SPECIALIZATION less
// defined in <xstddef>
// STRUCT TEMPLATE SPECIALIZATION greater_equal
// defined in <xstddef>
// STRUCT TEMPLATE SPECIALIZATION less_equal
// defined in <xstddef>
// STRUCT TEMPLATE SPECIALIZATION logical_and
template <>
struct logical_and<void> {
template <class _Ty1, class _Ty2>
@ -247,7 +187,6 @@ struct logical_and<void> {
using is_transparent = int;
};
// STRUCT TEMPLATE SPECIALIZATION logical_or
template <>
struct logical_or<void> {
template <class _Ty1, class _Ty2>
@ -259,7 +198,6 @@ struct logical_or<void> {
using is_transparent = int;
};
// STRUCT TEMPLATE SPECIALIZATION logical_not
template <>
struct logical_not<void> {
template <class _Ty>
@ -270,7 +208,6 @@ struct logical_not<void> {
using is_transparent = int;
};
// STRUCT TEMPLATE SPECIALIZATION bit_and
template <>
struct bit_and<void> {
template <class _Ty1, class _Ty2>
@ -282,7 +219,6 @@ struct bit_and<void> {
using is_transparent = int;
};
// STRUCT TEMPLATE SPECIALIZATION bit_or
template <>
struct bit_or<void> {
template <class _Ty1, class _Ty2>
@ -294,7 +230,6 @@ struct bit_or<void> {
using is_transparent = int;
};
// STRUCT TEMPLATE SPECIALIZATION bit_xor
template <>
struct bit_xor<void> {
template <class _Ty1, class _Ty2>
@ -306,7 +241,6 @@ struct bit_xor<void> {
using is_transparent = int;
};
// STRUCT TEMPLATE SPECIALIZATION bit_not
template <>
struct bit_not<void> {
template <class _Ty>
@ -319,7 +253,6 @@ struct bit_not<void> {
#if _HAS_DEPRECATED_NEGATORS
_STL_DISABLE_DEPRECATED_WARNING
// CLASS TEMPLATE unary_negate
template <class _Fn>
class _CXX17_DEPRECATE_NEGATORS unary_negate {
public:
@ -336,13 +269,11 @@ private:
_Fn _Functor;
};
// FUNCTION TEMPLATE not1
template <class _Fn>
_CXX17_DEPRECATE_NEGATORS _NODISCARD constexpr unary_negate<_Fn> not1(const _Fn& _Func) {
return unary_negate<_Fn>(_Func);
}
// CLASS TEMPLATE binary_negate
template <class _Fn>
class _CXX17_DEPRECATE_NEGATORS binary_negate {
public:
@ -360,7 +291,6 @@ private:
_Fn _Functor;
};
// FUNCTION TEMPLATE not2
template <class _Fn>
_CXX17_DEPRECATE_NEGATORS _NODISCARD constexpr binary_negate<_Fn> not2(const _Fn& _Func) {
return binary_negate<_Fn>(_Func);
@ -370,7 +300,6 @@ _STL_RESTORE_DEPRECATED_WARNING
#if _HAS_AUTO_PTR_ETC
_STL_DISABLE_DEPRECATED_WARNING
// CLASS TEMPLATE binder1st
template <class _Fn>
class binder1st : public unary_function<typename _Fn::second_argument_type,
typename _Fn::result_type> { // functor adapter _Func(stored, right)
@ -394,14 +323,12 @@ protected:
typename _Fn::first_argument_type value; // the left operand
};
// FUNCTION TEMPLATE bind1st
template <class _Fn, class _Ty>
_NODISCARD binder1st<_Fn> bind1st(const _Fn& _Func, const _Ty& _Left) {
typename _Fn::first_argument_type _Val(_Left);
return binder1st<_Fn>(_Func, _Val);
}
// CLASS TEMPLATE binder2nd
template <class _Fn>
class binder2nd : public unary_function<typename _Fn::first_argument_type,
typename _Fn::result_type> { // functor adapter _Func(left, stored)
@ -425,7 +352,6 @@ protected:
typename _Fn::second_argument_type value; // the right operand
};
// FUNCTION TEMPLATE bind2nd
template <class _Fn, class _Ty>
_NODISCARD binder2nd<_Fn> bind2nd(const _Fn& _Func, const _Ty& _Right) {
typename _Fn::second_argument_type _Val(_Right);
@ -433,7 +359,6 @@ _NODISCARD binder2nd<_Fn> bind2nd(const _Fn& _Func, const _Ty& _Right) {
}
_STL_RESTORE_DEPRECATED_WARNING
// CLASS TEMPLATE pointer_to_unary_function
template <class _Arg, class _Result, class _Fn = _Result (*)(_Arg)>
class pointer_to_unary_function : public unary_function<_Arg, _Result> { // functor adapter (*pfunc)(left)
public:
@ -447,7 +372,6 @@ protected:
_Fn _Pfun; // the function pointer
};
// CLASS TEMPLATE pointer_to_binary_function
template <class _Arg1, class _Arg2, class _Result, class _Fn = _Result (*)(_Arg1, _Arg2)>
class pointer_to_binary_function
: public binary_function<_Arg1, _Arg2, _Result> { // functor adapter (*pfunc)(left, right)
@ -462,7 +386,6 @@ protected:
_Fn _Pfun; // the function pointer
};
// FUNCTION TEMPLATE ptr_fun
#define _PTR_FUN(CALL_OPT, X1, X2, X3) \
template <class _Arg, class _Result> \
_NODISCARD pointer_to_unary_function<_Arg, _Result, _Result(CALL_OPT*)(_Arg)> ptr_fun( \
@ -478,7 +401,6 @@ protected:
_NON_MEMBER_CALL(_PTR_FUN, X1, X2, X3)
#undef _PTR_FUN
// CLASS TEMPLATE mem_fun_t
template <class _Result, class _Ty>
class mem_fun_t : public unary_function<_Ty*, _Result> { // functor adapter (*p->*pfunc)(), non-const *pfunc
public:
@ -492,7 +414,6 @@ private:
_Result (_Ty::*_Pmemfun)(); // the member function pointer
};
// CLASS TEMPLATE mem_fun1_t
template <class _Result, class _Ty, class _Arg>
class mem_fun1_t : public binary_function<_Ty*, _Arg, _Result> { // functor adapter (*p->*pfunc)(val), non-const *pfunc
public:
@ -506,7 +427,6 @@ private:
_Result (_Ty::*_Pmemfun)(_Arg); // the member function pointer
};
// CLASS TEMPLATE const_mem_fun_t
template <class _Result, class _Ty>
class const_mem_fun_t : public unary_function<const _Ty*, _Result> { // functor adapter (*p->*pfunc)(), const *pfunc
public:
@ -520,7 +440,6 @@ private:
_Result (_Ty::*_Pmemfun)() const; // the member function pointer
};
// CLASS TEMPLATE const_mem_fun1_t
template <class _Result, class _Ty, class _Arg>
class const_mem_fun1_t
: public binary_function<const _Ty*, _Arg, _Result> { // functor adapter (*p->*pfunc)(val), const *pfunc
@ -535,7 +454,6 @@ private:
_Result (_Ty::*_Pmemfun)(_Arg) const; // the member function pointer
};
// FUNCTION TEMPLATE mem_fun
template <class _Result, class _Ty>
_NODISCARD mem_fun_t<_Result, _Ty> mem_fun(_Result (_Ty::*_Pm)()) {
return mem_fun_t<_Result, _Ty>(_Pm);
@ -556,7 +474,6 @@ _NODISCARD const_mem_fun1_t<_Result, _Ty, _Arg> mem_fun(_Result (_Ty::*_Pm)(_Arg
return const_mem_fun1_t<_Result, _Ty, _Arg>(_Pm);
}
// CLASS TEMPLATE mem_fun_ref_t
template <class _Result, class _Ty>
class mem_fun_ref_t : public unary_function<_Ty, _Result> { // functor adapter (*left.*pfunc)(), non-const *pfunc
public:
@ -570,7 +487,6 @@ private:
_Result (_Ty::*_Pmemfun)(); // the member function pointer
};
// CLASS TEMPLATE mem_fun1_ref_t
template <class _Result, class _Ty, class _Arg>
class mem_fun1_ref_t
: public binary_function<_Ty, _Arg, _Result> { // functor adapter (*left.*pfunc)(val), non-const *pfunc
@ -585,7 +501,6 @@ private:
_Result (_Ty::*_Pmemfun)(_Arg); // the member function pointer
};
// CLASS TEMPLATE const_mem_fun_ref_t
template <class _Result, class _Ty>
class const_mem_fun_ref_t : public unary_function<_Ty, _Result> { // functor adapter (*left.*pfunc)(), const *pfunc
public:
@ -599,7 +514,6 @@ private:
_Result (_Ty::*_Pmemfun)() const; // the member function pointer
};
// CLASS TEMPLATE const_mem_fun1_ref_t
template <class _Result, class _Ty, class _Arg>
class const_mem_fun1_ref_t
: public binary_function<_Ty, _Arg, _Result> { // functor adapter (*left.*pfunc)(val), const *pfunc
@ -614,7 +528,6 @@ private:
_Result (_Ty::*_Pmemfun)(_Arg) const; // the member function pointer
};
// FUNCTION TEMPLATE mem_fun_ref
template <class _Result, class _Ty>
_NODISCARD mem_fun_ref_t<_Result, _Ty> mem_fun_ref(_Result (_Ty::*_Pm)()) {
return mem_fun_ref_t<_Result, _Ty>(_Pm);
@ -636,7 +549,6 @@ _NODISCARD const_mem_fun1_ref_t<_Result, _Ty, _Arg> mem_fun_ref(_Result (_Ty::*_
}
#endif // _HAS_AUTO_PTR_ETC
// FUNCTION TEMPLATE mem_fn
template <class _Memptr>
class _Mem_fn : public _Weak_types<_Memptr> {
private:
@ -659,7 +571,6 @@ _NODISCARD _CONSTEXPR20 _Mem_fn<_Rx _Ty::*> mem_fn(_Rx _Ty::*_Pm) noexcept {
}
#if _HAS_CXX17
// FUNCTION TEMPLATE not_fn
struct _Not_fn_tag {
explicit _Not_fn_tag() = default;
};
@ -715,9 +626,6 @@ _NODISCARD _CONSTEXPR20 _Not_fn<decay_t<_Callable>> not_fn(_Callable&& _Obj) noe
}
#endif // _HAS_CXX17
// IMPLEMENT function
// CLASS bad_function_call
class bad_function_call : public exception { // exception thrown when an empty std::function is called
public:
bad_function_call() noexcept {}
@ -734,7 +642,6 @@ struct _Unforced { // tag to distinguish bind() from bind<R>()
explicit _Unforced() = default;
};
// STRUCT TEMPLATE _Invoker_ret
// helper to give INVOKE an explicit return type; avoids undesirable Expression SFINAE
template <class _Rx, bool = is_void_v<_Rx>>
struct _Invoker_ret { // selected for _Rx being cv void
@ -764,7 +671,6 @@ struct _Invoker_ret<_Unforced, false> { // selected for _Rx being _Unforced
}
};
// FUNCTION TEMPLATE _Test_callable
template <class _Fty>
class function;
@ -781,7 +687,6 @@ bool _Test_callable(const _Ty& _Arg) noexcept { // determine whether std::functi
}
}
// CLASS TEMPLATE _Func_base
template <class _Rx, class... _Types>
class __declspec(novtable) _Func_base { // abstract base for implementation types
public:
@ -806,7 +711,6 @@ private:
virtual const void* _Get() const noexcept = 0;
};
// ALIAS TEMPLATE _Is_large
constexpr size_t _Space_size = (_Small_object_num_ptrs - 1) * sizeof(void*);
template <class _Impl> // determine whether _Impl must be dynamically allocated
@ -814,7 +718,6 @@ _INLINE_VAR constexpr bool _Is_large = sizeof(_Impl) > _Space_size || alignof(_I
|| !_Impl::_Nothrow_move::value;
#if _HAS_FUNCTION_ALLOCATOR_SUPPORT
// CLASS TEMPLATE _Func_impl
template <class _Callable, class _Alloc, class _Rx, class... _Types>
class _Func_impl final : public _Func_base<_Rx, _Types...> {
// derived class for specific implementation types that use allocators
@ -884,7 +787,6 @@ private:
};
#endif // _HAS_FUNCTION_ALLOCATOR_SUPPORT
// CLASS TEMPLATE _Func_impl_no_alloc
template <class _Callable, class _Rx, class... _Types>
class _Func_impl_no_alloc final : public _Func_base<_Rx, _Types...> {
// derived class for specific implementation types that don't use allocators
@ -948,7 +850,6 @@ private:
#define _USE_FUNCTION_INT_0_SFINAE 1
#endif // __CUDACC__
// CLASS TEMPLATE _Func_class
template <class _Ret, class... _Types>
class _Func_class : public _Arg_types<_Types...> {
public:
@ -1093,7 +994,6 @@ private:
}
};
// STRUCT TEMPLATE _Get_function_impl
template <class _Tx>
struct _Get_function_impl {
static_assert(_Always_false<_Tx>, "std::function does not accept non-function types as template arguments.");
@ -1119,7 +1019,6 @@ _NON_MEMBER_CALL(_GET_FUNCTION_IMPL_NOEXCEPT, X1, X2, X3)
#undef _GET_FUNCTION_IMPL_NOEXCEPT
#endif // __cpp_noexcept_function_type
// CLASS TEMPLATE function
template <class _Fty>
class function : public _Get_function_impl<_Fty>::type { // wrapper for callable objects
private:
@ -1259,7 +1158,6 @@ public:
_NON_MEMBER_CALL(_FUNCTION_POINTER_DEDUCTION_GUIDE, X1, X2, X3)
#undef _FUNCTION_POINTER_DEDUCTION_GUIDE
// STRUCT TEMPLATE _Deduce_signature
template <class _Fx, class = void>
struct _Deduce_signature {}; // can't deduce signature when &_Fx::operator() is missing, inaccessible, or ambiguous
@ -1298,7 +1196,6 @@ _NODISCARD bool operator!=(nullptr_t, const function<_Fty>& _Other) noexcept {
}
#endif // !_HAS_CXX20
// PLACEHOLDERS
template <int _Nx>
struct _Ph { // placeholder
static_assert(_Nx > 0, "invalid placeholder index");
@ -1322,11 +1219,9 @@ struct is_placeholder<const volatile _Tx> : is_placeholder<_Tx>::type {}; // ign
template <class _Ty>
_INLINE_VAR constexpr int is_placeholder_v = is_placeholder<_Ty>::value;
// CLASS TEMPLATE _Binder FORWARD DECLARATION
template <class _Ret, class _Fx, class... _Types>
class _Binder;
// STRUCT TEMPLATE is_bind_expression
template <class _Tx>
struct is_bind_expression : false_type {}; // _Tx is not a bind expression
@ -1345,7 +1240,6 @@ struct is_bind_expression<const volatile _Tx> : is_bind_expression<_Tx>::type {}
template <class _Ty>
_INLINE_VAR constexpr bool is_bind_expression_v = is_bind_expression<_Ty>::value;
// FUNCTION TEMPLATE _Fix_arg
template <class _Cv_TiD, bool = _Is_specialization_v<remove_cv_t<_Cv_TiD>, reference_wrapper>,
bool = is_bind_expression_v<_Cv_TiD>, int = is_placeholder_v<_Cv_TiD>>
struct _Select_fixer;
@ -1404,7 +1298,6 @@ constexpr auto _Fix_arg(_Cv_TiD& _Tid, _Untuple&& _Ut) noexcept(
return _Select_fixer<_Cv_TiD>::_Fix(_Tid, _STD move(_Ut));
}
// FUNCTION TEMPLATE _Call_binder
template <class _Ret, size_t... _Ix, class _Cv_FD, class _Cv_tuple_TiD, class _Untuple>
_CONSTEXPR20 auto _Call_binder(_Invoker_ret<_Ret>, index_sequence<_Ix...>, _Cv_FD& _Obj, _Cv_tuple_TiD& _Tpl,
_Untuple&& _Ut) noexcept(noexcept(_Invoker_ret<_Ret>::_Call(_Obj,
@ -1414,7 +1307,6 @@ _CONSTEXPR20 auto _Call_binder(_Invoker_ret<_Ret>, index_sequence<_Ix...>, _Cv_F
return _Invoker_ret<_Ret>::_Call(_Obj, _Fix_arg(_STD get<_Ix>(_Tpl), _STD move(_Ut))...);
}
// CLASS TEMPLATE _Binder
template <class _Ret>
struct _Forced_result_type { // used by bind<R>()
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ret _RESULT_TYPE_NAME;
@ -1461,19 +1353,16 @@ public:
#undef _CALL_BINDER
};
// FUNCTION TEMPLATE bind (implicit return type)
template <class _Fx, class... _Types>
_NODISCARD _CONSTEXPR20 _Binder<_Unforced, _Fx, _Types...> bind(_Fx&& _Func, _Types&&... _Args) {
return _Binder<_Unforced, _Fx, _Types...>(_STD forward<_Fx>(_Func), _STD forward<_Types>(_Args)...);
}
// FUNCTION TEMPLATE bind (explicit return type)
template <class _Ret, class _Fx, class... _Types>
_NODISCARD _CONSTEXPR20 _Binder<_Ret, _Fx, _Types...> bind(_Fx&& _Func, _Types&&... _Args) {
return _Binder<_Ret, _Fx, _Types...>(_STD forward<_Fx>(_Func), _STD forward<_Types>(_Args)...);
}
// PLACEHOLDER ARGUMENTS
namespace placeholders {
_INLINE_VAR constexpr _Ph<1> _1{};
_INLINE_VAR constexpr _Ph<2> _2{};
@ -1498,7 +1387,6 @@ namespace placeholders {
} // namespace placeholders
#if _HAS_CXX20
// FUNCTION TEMPLATE _Call_front_binder
template <size_t... _Ix, class _Cv_FD, class _Cv_tuple_TiD, class... _Unbound>
constexpr auto _Call_front_binder(index_sequence<_Ix...>, _Cv_FD&& _Obj, _Cv_tuple_TiD&& _Tpl,
_Unbound&&... _Unbargs) noexcept(noexcept(_STD invoke(_STD forward<_Cv_FD>(_Obj),
@ -1509,7 +1397,6 @@ constexpr auto _Call_front_binder(index_sequence<_Ix...>, _Cv_FD&& _Obj, _Cv_tup
_STD forward<_Unbound>(_Unbargs)...);
}
// CLASS TEMPLATE _Front_binder
template <class _Fx, class... _Types>
class _Front_binder { // wrap bound callable object and arguments
private:
@ -1561,7 +1448,6 @@ public:
}
};
// FUNCTION TEMPLATE bind_front
template <class _Fx, class... _Types>
_NODISCARD constexpr auto bind_front(_Fx&& _Func, _Types&&... _Args) {
static_assert(is_constructible_v<decay_t<_Fx>, _Fx>,
@ -1578,13 +1464,11 @@ _NODISCARD constexpr auto bind_front(_Fx&& _Func, _Types&&... _Args) {
#endif // _HAS_CXX20
#if _HAS_FUNCTION_ALLOCATOR_SUPPORT
// STRUCT TEMPLATE uses_allocator
template <class _Fty, class _Alloc>
struct uses_allocator<function<_Fty>, _Alloc> : true_type {}; // true_type if container allocator enabled
#endif // _HAS_FUNCTION_ALLOCATOR_SUPPORT
#if _HAS_CXX17
// HETEROGENEOUS MEMORY BLOCK UTILITIES
inline void _Add_alloc_size(size_t& _Size, const size_t _Size_added, const size_t _Alignment) {
// moves _Size up to account for storing an object of size _Size_added with alignment _Alignment in a memory buffer
// assumes that the memory buffer will be allocated for the "worst" alignment used in the resulting buffer
@ -1626,14 +1510,12 @@ _Ty* _Decode_aligned_block(void*& _Base, const size_t _Count) {
return static_cast<_Ty*>(_Decode_aligned_block(_Base, sizeof(_Ty) * _Count, alignof(_Ty)));
}
// STRUCT _Global_delete
struct _Global_delete {
void operator()(void* const _Ptr) const {
::operator delete(_Ptr);
}
};
// CLASS TEMPLATE default_searcher
template <class _FwdItHaystack, class _FwdItPat, class _Pred_eq>
_CONSTEXPR20 pair<_FwdItHaystack, _FwdItHaystack> _Search_pair_unchecked(_FwdItHaystack _First1, _FwdItHaystack _Last1,
_FwdItPat _First2, _FwdItPat _Last2, _Pred_eq& _Eq, forward_iterator_tag, forward_iterator_tag) {
@ -1709,7 +1591,6 @@ private:
};
// STRUCT TEMPLATE _Boyer_moore_hash_delta_1_table
template <class _RanItPat, class _Hash_ty, class _Pred_eq>
struct _Boyer_moore_hash_delta_1_table { // stores the Boyer-Moore delta_1 table using a hash table
using _Value_t = _Iter_value_t<_RanItPat>;
@ -1746,7 +1627,6 @@ private:
};
// STRUCT TEMPLATE _Boyer_moore_flat_delta_1_table
template <class _RanItPat, _Iter_diff_t<_RanItPat> _Limit>
struct _Boyer_moore_flat_delta_1_table { // stores the Boyer-Moore delta_1 table using a plain array lookup
using _Value_t = _Iter_value_t<_RanItPat>;
@ -1782,7 +1662,6 @@ private:
};
// FUNCTION TEMPLATE _Build_boyer_moore_delta_2_table
template <class _RanItPat, class _Pred_eq>
void _Build_boyer_moore_delta_2_table(_Iter_diff_t<_RanItPat>* const _Shifts, const _RanItPat _Pat_first,
const _Iter_diff_t<_RanItPat> _Pat_size, _Pred_eq& _Eq) {
@ -1844,7 +1723,6 @@ void _Build_boyer_moore_delta_2_table(_Iter_diff_t<_RanItPat>* const _Shifts, co
}
// FUNCTION TEMPLATE _Boyer_moore_search
template <class _Delta1_t, class _RanItHaystack>
pair<_RanItHaystack, _RanItHaystack> _Boyer_moore_search(
const _Delta1_t& _Delta1, typename _Delta1_t::_Diff* _Delta2, _RanItHaystack _First, _RanItHaystack _Last) {
@ -1887,7 +1765,6 @@ pair<_RanItHaystack, _RanItHaystack> _Boyer_moore_search(
}
// FUNCTION TEMPLATE _Boyer_moore_horspool_search
template <class _Delta1_t, class _RanItHaystack>
pair<_RanItHaystack, _RanItHaystack> _Boyer_moore_horspool_search(
const _Delta1_t& _Delta1, _RanItHaystack _First, _RanItHaystack _Last) {
@ -1926,7 +1803,6 @@ pair<_RanItHaystack, _RanItHaystack> _Boyer_moore_horspool_search(
}
// STRUCT AND ALIAS TEMPLATES _Boyer_moore_traits
template <class _RanItPat, class _Hash_ty, class _Pred_eq, class _Delta1_t>
struct _Single_delta1_type_boyer_moore_traits {
using _Diff = _Iter_diff_t<_RanItPat>;
@ -2133,7 +2009,6 @@ using _Boyer_moore_traits =
_Boyer_moore_traits_general_mode<_RanItPat, _Hash_ty, _Pred_eq>>;
// CLASS TEMPLATE boyer_moore_searcher
template <class _RanItPat, class _Hash_ty = hash<_Iter_value_t<_RanItPat>>, class _Pred_eq = equal_to<>>
class boyer_moore_searcher {
public:
@ -2173,7 +2048,6 @@ private:
};
// CLASS TEMPLATE boyer_moore_horspool_searcher
template <class _RanItPat, class _Hash_ty = hash<_Iter_value_t<_RanItPat>>, class _Pred_eq = equal_to<>>
class boyer_moore_horspool_searcher { // equivalent to Boyer-Moore without the second table
public:
@ -2215,7 +2089,6 @@ private:
#ifdef __cpp_lib_concepts
namespace ranges {
// STRUCT ranges::not_equal_to
struct not_equal_to {
// clang-format off
template <class _Ty1, class _Ty2>
@ -2229,7 +2102,6 @@ namespace ranges {
using is_transparent = int;
};
// STRUCT ranges::greater_equal
struct greater_equal {
// clang-format off
template <class _Ty1, class _Ty2>
@ -2243,7 +2115,6 @@ namespace ranges {
using is_transparent = int;
};
// STRUCT ranges::less_equal
struct less_equal {
// clang-format off
template <class _Ty1, class _Ty2>

Просмотреть файл

@ -35,7 +35,6 @@ _STL_DISABLE_CLANG_WARNINGS
#undef new
_STD_BEGIN
// FUNCTION TEMPLATE _Make_unique_alloc
template <class _Alloc>
struct _Allocator_deleter {
_Alloc _Al;
@ -59,10 +58,8 @@ _NODISCARD _Unique_ptr_alloc<_Alloc> _Make_unique_alloc(_Alloc& _Al, _Args&&...
return _Unique_ptr_alloc<_Alloc>(_Constructor._Release(), _Allocator_deleter<_Alloc>{_Al});
}
// STRUCT _Nil
struct _Nil {}; // empty struct, for unused argument types
// ENUM future_errc
enum class future_errc { // names for futures errors
broken_promise = 1,
future_already_retrieved,
@ -70,7 +67,6 @@ enum class future_errc { // names for futures errors
no_state
};
// ENUM launch
enum class launch { // names for launch options passed to async
async = 0x1,
deferred = 0x2
@ -78,18 +74,15 @@ enum class launch { // names for launch options passed to async
_BITMASK_OPS(launch)
// ENUM future_status
enum class future_status { // names for timed wait function returns
ready,
timeout,
deferred
};
// HELPER FUNCTIONS
[[noreturn]] _CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL _Throw_future_error(const error_code& _Code);
[[noreturn]] _CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL _Rethrow_future_exception(exception_ptr _Ptr);
// STRUCT TEMPLATE SPECIALIZATION is_error_code_enum
template <>
struct is_error_code_enum<future_errc> : true_type {};
@ -103,7 +96,6 @@ _NODISCARD inline error_condition make_error_condition(future_errc _Errno) noexc
return error_condition(static_cast<int>(_Errno), _STD future_category());
}
// CLASS future_error
inline const char* _Future_error_map(int _Errcode) noexcept { // convert to name of future error
switch (static_cast<future_errc>(_Errcode)) { // switch on error code value
case future_errc::broken_promise:
@ -171,7 +163,6 @@ _NODISCARD inline const error_category& future_category() noexcept {
return _Immortalize_memcpy_image<_Future_error_category2>();
}
// STRUCT TEMPLATE _State_deleter
template <class _Ty>
class _Associated_state;
@ -193,7 +184,6 @@ struct _State_deleter : _Deleter_base<_Ty> { // manage allocator and deletion st
_Alloc _My_alloc;
};
// CLASS TEMPLATE _Associated_state
template <class _Ty>
class _Associated_state { // class for managing associated synchronous state
public:
@ -451,7 +441,6 @@ void _State_deleter<_Ty, _Derived, _Alloc>::_Delete(
_Delete_plain_internal(_Del_alloc, this);
}
// CLASS TEMPLATE _Packaged_state
template <class>
class _Packaged_state;
@ -648,7 +637,6 @@ _Pack_state* _Make_packaged_state(_Fty2&& _Fnarg, const _Alloc& _Al) {
}
#endif // _HAS_FUNCTION_ALLOCATOR_SUPPORT
// CLASS TEMPLATE _Deferred_async_state
template <class _Rx>
class _Deferred_async_state : public _Packaged_state<_Rx()> {
// class for managing associated synchronous state for deferred execution from async
@ -672,7 +660,6 @@ private:
}
};
// CLASS TEMPLATE _Task_async_state
template <class _Rx>
class _Task_async_state : public _Packaged_state<_Rx()> {
// class for managing associated synchronous state for asynchronous execution from async
@ -707,7 +694,6 @@ private:
::Concurrency::task<void> _Task;
};
// CLASS TEMPLATE _State_manager
template <class _Ty>
class _State_manager {
// class for managing possibly non-existent associated asynchronous state object
@ -867,7 +853,6 @@ private:
bool _Get_only_once;
};
// CLASS TEMPLATE future
template <class _Ty>
class shared_future;
@ -971,7 +956,6 @@ public:
future& operator=(const future&) = delete;
};
// CLASS TEMPLATE shared_future
template <class _Ty>
class shared_future : public _State_manager<_Ty> {
// class that defines a copyable asynchronous return object that holds a value
@ -1070,12 +1054,10 @@ public:
}
};
// DEFINITION OF future<void>::share()
_NODISCARD inline shared_future<void> future<void>::share() noexcept {
return shared_future<void>(_STD move(*this));
}
// CLASS TEMPLATE _Promise
template <class _Ty>
class _Promise {
public:
@ -1144,7 +1126,6 @@ private:
bool _Future_retrieved;
};
// CLASS TEMPLATE promise
template <class _Ty>
class promise { // class that defines an asynchronous provider that holds a value
public:
@ -1326,7 +1307,6 @@ void swap(promise<_Ty>& _Left, promise<_Ty>& _Right) noexcept {
_Left.swap(_Right);
}
// CLASS TEMPLATE packaged_task
template <class _Fret>
struct _P_arg_type { // type for functions returning T
using type = _Fret;
@ -1450,21 +1430,18 @@ void swap(packaged_task<_Ty>& _Left, packaged_task<_Ty>& _Right) noexcept {
_Left.swap(_Right);
}
// FUNCTION TEMPLATE _Invoke_stored_explicit
template <class... _Types, size_t... _Indices>
auto _Invoke_stored_explicit(tuple<_Types...>&& _Tuple, index_sequence<_Indices...>) -> decltype(_STD invoke(
_STD get<_Indices>(_STD move(_Tuple))...)) { // invoke() a tuple with explicit parameter ordering
return _STD invoke(_STD get<_Indices>(_STD move(_Tuple))...);
}
// FUNCTION TEMPLATE _Invoke_stored
template <class... _Types>
auto _Invoke_stored(tuple<_Types...>&& _Tuple)
-> decltype(_Invoke_stored_explicit(_STD move(_Tuple), index_sequence_for<_Types...>{})) { // invoke() a tuple
return _Invoke_stored_explicit(_STD move(_Tuple), index_sequence_for<_Types...>{});
}
// FUNCTION TEMPLATE async
template <class... _Types>
class _Fake_no_copy_callable_adapter {
// async() is built on packaged_task internals which incorrectly use

Просмотреть файл

@ -33,7 +33,6 @@ namespace stdext {
using _STD _Swap_adl;
using _STD _Xout_of_range;
// CLASS TEMPLATE _Hmap_traits
template <class _Kty, // key type
class _Ty, // mapped type
class _Tr, // comparator predicate type
@ -110,7 +109,6 @@ namespace stdext {
float _Max_buckets = 0.0F; // current maximum bucket size
};
// CLASS TEMPLATE hash_map
template <class _Kty, class _Ty, class _Tr = hash_compare<_Kty, less<_Kty>>,
class _Alloc = allocator<pair<const _Kty, _Ty>>>
class hash_map : public _Hash<_Hmap_traits<_Kty, _Ty, _Tr, _Alloc, false>> {
@ -300,7 +298,6 @@ namespace stdext {
return !(_Left == _Right);
}
// CLASS TEMPLATE hash_multimap
template <class _Kty, class _Ty, class _Tr = hash_compare<_Kty, less<_Kty>>,
class _Alloc = allocator<pair<const _Kty, _Ty>>>
class hash_multimap : public _Hash<_Hmap_traits<_Kty, _Ty, _Tr, _Alloc, true>> {

Просмотреть файл

@ -29,7 +29,6 @@ namespace stdext {
using _STD _Is_nothrow_swappable;
using _STD _Swap_adl;
// CLASS TEMPLATE _Hset_traits
template <class _Kty, // key type (same as value type)
class _Tr, // comparator predicate type
class _Alloc, // actual allocator type (should be value allocator)
@ -87,7 +86,6 @@ namespace stdext {
float _Max_buckets = 0.0F; // current maximum bucket size
};
// CLASS TEMPLATE hash_set
template <class _Kty, class _Tr = hash_compare<_Kty, less<_Kty>>, class _Alloc = allocator<_Kty>>
class hash_set : public _Hash<_Hset_traits<_Kty, _Tr, _Alloc, false>> { // hash table of key values, unique keys
public:
@ -233,7 +231,6 @@ namespace stdext {
return !(_Left == _Right);
}
// CLASS TEMPLATE hash_multiset
template <class _Kty, class _Tr = hash_compare<_Kty, less<_Kty>>, class _Alloc = allocator<_Kty>>
class hash_multiset
: public _Hash<_Hset_traits<_Kty, _Tr, _Alloc, true>> { // hash table of key values, non-unique keys

Просмотреть файл

@ -18,7 +18,6 @@ _STL_DISABLE_CLANG_WARNINGS
#undef new
_STD_BEGIN
// CLASS TEMPLATE initializer_list
template <class _Elem>
class initializer_list {
public:
@ -52,13 +51,11 @@ private:
const _Elem* _Last;
};
// FUNCTION TEMPLATE begin
template <class _Elem>
_NODISCARD constexpr const _Elem* begin(initializer_list<_Elem> _Ilist) noexcept {
return _Ilist.begin();
}
// FUNCTION TEMPLATE end
template <class _Elem>
_NODISCARD constexpr const _Elem* end(initializer_list<_Elem> _Ilist) noexcept {
return _Ilist.end();

Просмотреть файл

@ -21,7 +21,6 @@ _STL_DISABLE_CLANG_WARNINGS
#undef new
_STD_BEGIN
// STRUCT TEMPLATE _Fillobj
template <class _Elem>
struct _Fillobj { // store fill character
_Fillobj(_Elem _Ch) : _Fill(_Ch) {}
@ -29,7 +28,6 @@ struct _Fillobj { // store fill character
_Elem _Fill; // the fill character
};
// FUNCTION TEMPLATE setfill
template <class _Elem>
_NODISCARD _Fillobj<_Elem> setfill(_Elem _Ch) {
return _Fillobj<_Elem>(_Ch);
@ -53,7 +51,6 @@ basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Ostr,
return _Ostr;
}
// STRUCT TEMPLATE _Monobj
template <class _Money>
struct _Monobj { // store reference to monetary amount
_Monobj(_Money& _Val_arg, bool _Intl_arg) : _Val(_Val_arg), _Intl(_Intl_arg) {}
@ -64,7 +61,6 @@ struct _Monobj { // store reference to monetary amount
_Monobj& operator=(const _Monobj&) = delete;
};
// FUNCTION TEMPLATE get_money
template <class _Money>
_NODISCARD _Monobj<_Money> get_money(_Money& _Val_arg, bool _Intl_arg = false) {
return _Monobj<_Money>(_Val_arg, _Intl_arg);
@ -91,7 +87,6 @@ basic_istream<_Elem, _Traits>& operator>>(basic_istream<_Elem, _Traits>& _Istr,
return _Istr;
}
// FUNCTION TEMPLATE put_money
template <class _Money>
_NODISCARD _Monobj<const _Money> put_money(const _Money& _Val_arg, bool _Intl_arg = false) {
return _Monobj<const _Money>(_Val_arg, _Intl_arg);
@ -120,7 +115,6 @@ basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Ostr,
return _Ostr;
}
// STRUCT TEMPLATE _Timeobj
template <class _Elem, class _Ptr>
struct _Timeobj { // store reference to tm object and format
_Timeobj(_Ptr _Tptr_arg, const _Elem* _Fmt_arg) : _Tptr(_Tptr_arg), _Fmtfirst(_Fmt_arg) {
@ -133,7 +127,6 @@ struct _Timeobj { // store reference to tm object and format
const _Elem* _Fmtlast; // format string end
};
// FUNCTION TEMPLATE get_time
template <class _Elem>
_NODISCARD _Timeobj<_Elem, tm*> get_time(tm* _Tptr_arg, const _Elem* _Fmt_arg) {
return _Timeobj<_Elem, tm*>(_Tptr_arg, _Fmt_arg);
@ -163,7 +156,6 @@ basic_istream<_Elem, _Traits>& operator>>(basic_istream<_Elem, _Traits>& _Istr,
return _Istr;
}
// FUNCTION TEMPLATE put_time
template <class _Elem>
_NODISCARD _Timeobj<_Elem, const tm*> put_time(const tm* _Tptr_arg, const _Elem* _Fmt_arg) {
return _Timeobj<_Elem, const tm*>(_Tptr_arg, _Fmt_arg);
@ -193,7 +185,6 @@ basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Ostr,
return _Ostr;
}
// STRUCT TEMPLATE _Quote_in
template <class _Elem, class _Traits, class _Alloc>
struct _Quote_in { // store reference to string
using _Mystr = basic_string<_Elem, _Traits, _Alloc>;
@ -208,7 +199,6 @@ struct _Quote_in { // store reference to string
_Quote_in& operator=(const _Quote_in&) = delete;
};
// STRUCT TEMPLATE _Quote_out
template <class _Elem, class _Traits, class _Sizet>
struct _Quote_out { // store pointer/length for string
_Quote_out(const _Elem* _Ptr_obj, _Sizet _Size_obj, _Elem _Delim_obj, _Elem _Escape_obj)
@ -222,7 +212,6 @@ struct _Quote_out { // store pointer/length for string
_Quote_out& operator=(const _Quote_out&) = delete;
};
// FUNCTION TEMPLATE quoted
template <class _Elem>
_NODISCARD _Quote_out<_Elem, void, size_t> quoted(
const _Elem* _Ptr, _Elem _Delim = _Elem('"'), _Elem _Escape = _Elem('\\')) {
@ -256,7 +245,6 @@ _NODISCARD _Quote_in<_Elem, _Traits, _Alloc> quoted(
return _Quote_in<_Elem, _Traits, _Alloc>(_Str, _Delim, _Escape);
}
// quoted INSERTER
template <class _Elem, class _Traits, class _QuTraits, class _Sizet>
basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Ostr,
const _Quote_out<_Elem, _QuTraits, _Sizet>& _Manip) { // put quoted string to output stream
@ -352,7 +340,6 @@ basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Ostr,
return _Ostr << _STD quoted(_Ref, _Manip._Delim, _Manip._Escape);
}
// quoted EXTRACTOR
template <class _Elem, class _Traits, class _Alloc>
basic_istream<_Elem, _Traits>& operator>>(basic_istream<_Elem, _Traits>& _Istr,
const _Quote_in<_Elem, _Traits, _Alloc>& _Manip) { // get quoted string from input stream
@ -400,7 +387,6 @@ basic_istream<_Elem, _Traits>& operator>>(basic_istream<_Elem, _Traits>& _Istr,
return _Istr;
}
// STRUCT TEMPLATE _Smanip
template <class _Arg>
struct _Smanip { // store function pointer and argument value
_Smanip(void(__cdecl* _Left)(ios_base&, _Arg), _Arg _Val) : _Pfun(_Left), _Manarg(_Val) {}
@ -423,7 +409,6 @@ basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Ostr,
return _Ostr;
}
// INSTANTIATIONS
_NODISCARD _MRTIMP2 _Smanip<ios_base::fmtflags> __cdecl resetiosflags(ios_base::fmtflags);
_NODISCARD _MRTIMP2 _Smanip<ios_base::fmtflags> __cdecl setiosflags(ios_base::fmtflags);
_NODISCARD _MRTIMP2 _Smanip<int> __cdecl setbase(int);

Просмотреть файл

@ -18,7 +18,6 @@ _STL_DISABLE_CLANG_WARNINGS
#undef new
_STD_BEGIN
// CLASS TEMPLATE basic_ios
template <class _Elem, class _Traits>
class basic_ios : public ios_base { // base class for basic_istream/basic_ostream
public:
@ -182,7 +181,6 @@ template class _CRTIMP2_PURE_IMPORT basic_ios<unsigned short, char_traits<unsign
#endif // __FORCE_INSTANCE
#endif // defined(_DLL_CPPLIB)
// MANIPULATORS
inline ios_base& __CLRCALL_OR_CDECL boolalpha(ios_base& _Iosbase) { // set boolalpha
_Iosbase.setf(ios_base::boolalpha);
return _Iosbase;

Просмотреть файл

@ -22,7 +22,6 @@ _STL_DISABLE_CLANG_WARNINGS
#undef new
_STD_BEGIN
// I/O EXCEPTION MACROS
#if _HAS_EXCEPTIONS
#define _TRY_IO_BEGIN _TRY_BEGIN // begin try block
@ -44,11 +43,10 @@ _STD_BEGIN
#define _CATCH_IO_(xtype, x) } // catch block for basic_ios x
#endif // _HAS_EXCEPTIONS
// STREAM POSITIONING TYPES (from <streambuf>)
// from <streambuf>
using streamoff = long long;
using streamsize = long long;
// CLASS TEMPLATE fpos (from <streambuf>)
template <class _Statetype>
class fpos { // store arbitrary file position
public:
@ -139,7 +137,6 @@ private:
using streampos = fpos<_Mbstatet>;
using wstreampos = streampos;
// FORWARD REFERENCES
class locale;
template <class _Facet>
const _Facet& __CRTDECL use_facet(const locale&);
@ -218,7 +215,6 @@ template <class _Elem>
class collate;
#endif // defined(_DLL_CPPLIB)
// char TYPEDEFS
using ios = basic_ios<char, char_traits<char>>;
using streambuf = basic_streambuf<char, char_traits<char>>;
using istream = basic_istream<char, char_traits<char>>;
@ -237,7 +233,6 @@ using syncbuf = basic_syncbuf<char>;
using osyncstream = basic_osyncstream<char>;
#endif // _HAS_CXX20
// wchar_t TYPEDEFS
using wios = basic_ios<wchar_t, char_traits<wchar_t>>;
using wstreambuf = basic_streambuf<wchar_t, char_traits<wchar_t>>;
using wistream = basic_istream<wchar_t, char_traits<wchar_t>>;
@ -257,7 +252,6 @@ using wosyncstream = basic_osyncstream<wchar_t>;
#endif // _HAS_CXX20
#if defined(_CRTBLD)
// unsigned short TYPEDEFS
using ushistream = basic_istream<unsigned short, char_traits<unsigned short>>;
using ushostream = basic_ostream<unsigned short, char_traits<unsigned short>>;
using ushfilebuf = basic_filebuf<unsigned short, char_traits<unsigned short>>;

Просмотреть файл

@ -36,7 +36,6 @@ __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
// OBJECTS
__PURE_APPDOMAIN_GLOBAL extern _CRTDATA2_IMPORT istream cin;
__PURE_APPDOMAIN_GLOBAL extern _CRTDATA2_IMPORT ostream cout;
__PURE_APPDOMAIN_GLOBAL extern _CRTDATA2_IMPORT ostream cerr;
@ -55,7 +54,6 @@ __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;
// CLASS _Winit
class _CRTIMP2_PURE_IMPORT _Winit {
public:
__thiscall _Winit();

Просмотреть файл

@ -20,7 +20,6 @@ _STL_DISABLE_CLANG_WARNINGS
_STD_BEGIN
#pragma vtordisp(push, 2) // compiler bug workaround
// CLASS TEMPLATE basic_istream
template <class _Elem, class _Traits>
class basic_istream : virtual public basic_ios<_Elem, _Traits> { // control extractions from a stream buffer
public:
@ -75,7 +74,6 @@ public:
using pos_type = typename _Traits::pos_type;
using off_type = typename _Traits::off_type;
// CLASS TEMPLATE sentry
class _Sentry_base {
public:
__CLR_OR_THIS_CALL _Sentry_base(basic_istream& _Istr) : _Myistr(_Istr) {
@ -705,7 +703,6 @@ template class _CRTIMP2_PURE_IMPORT basic_istream<unsigned short, char_traits<un
#endif // __FORCE_INSTANCE
#endif // defined(_DLL_CPPLIB)
// CLASS TEMPLATE basic_iostream
template <class _Elem, class _Traits>
class basic_iostream : public basic_istream<_Elem, _Traits>,
public basic_ostream<_Elem, _Traits> { // control insertions and extractions from a stream buffer
@ -758,8 +755,6 @@ template class _CRTIMP2_PURE_IMPORT basic_iostream<unsigned short, char_traits<u
#endif // __FORCE_INSTANCE
#endif // defined(_DLL_CPPLIB)
// EXTRACTORS
template <class _Elem, class _Traits>
basic_istream<_Elem, _Traits>& _Istream_extract_into_buffer(
basic_istream<_Elem, _Traits>& _Istr, size_t _Size, _Elem* _Str) {
@ -890,7 +885,6 @@ _Istr&& operator>>(_Istr&& _Is, _Ty&& _Val) { // extract from rvalue stream
return _STD move(_Is);
}
// MANIPULATORS
template <class _Elem, class _Traits>
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);

Просмотреть файл

@ -19,7 +19,6 @@ _STL_DISABLE_CLANG_WARNINGS
#undef new
_STD_BEGIN
// CLASS TEMPLATE back_insert_iterator
template <class _Container>
class back_insert_iterator { // wrap pushes to back of container as output iterator
public:
@ -65,14 +64,12 @@ protected:
_Container* container;
};
// FUNCTION TEMPLATE back_inserter
template <class _Container>
_NODISCARD _CONSTEXPR20 back_insert_iterator<_Container> back_inserter(_Container& _Cont) noexcept /* strengthened */ {
// return a back_insert_iterator
return back_insert_iterator<_Container>(_Cont);
}
// CLASS TEMPLATE front_insert_iterator
template <class _Container>
class front_insert_iterator { // wrap pushes to front of container as output iterator
public:
@ -118,13 +115,11 @@ protected:
_Container* container;
};
// FUNCTION TEMPLATE front_inserter
template <class _Container>
_NODISCARD _CONSTEXPR20 front_insert_iterator<_Container> front_inserter(_Container& _Cont) {
return front_insert_iterator<_Container>(_Cont);
}
// CLASS TEMPLATE insert_iterator
template <class _Container>
class insert_iterator { // wrap inserts into container as output iterator
public:
@ -175,14 +170,12 @@ protected:
_Wrapped_iter iter;
};
// FUNCTION TEMPLATE inserter
template <class _Container>
_NODISCARD _CONSTEXPR20 insert_iterator<_Container> inserter(_Container& _Cont, typename _Container::iterator _Where) {
return insert_iterator<_Container>(_Cont, _Where);
}
#ifdef __cpp_lib_concepts
// CLASS TEMPLATE move_sentinel
template <semiregular _Se>
class move_sentinel {
public:
@ -220,7 +213,6 @@ private:
};
#endif // __cpp_lib_concepts
// CLASS TEMPLATE istream_iterator
template <class _Ty, class _Elem = char, class _Traits = char_traits<_Elem>, class _Diff = ptrdiff_t>
class istream_iterator {
public:
@ -305,7 +297,6 @@ _NODISCARD bool operator!=(const istream_iterator<_Ty, _Elem, _Traits, _Diff>& _
}
#endif // !_HAS_CXX20
// CLASS TEMPLATE ostream_iterator
template <class _Ty, class _Elem = char, class _Traits = char_traits<_Elem>>
class ostream_iterator {
public:
@ -351,7 +342,6 @@ private:
ostream_type* _Myostr; // pointer to output stream
};
// CLASS TEMPLATE istreambuf_iterator
template <class _Elem, class _Traits>
class istreambuf_iterator {
public:
@ -489,7 +479,6 @@ _NODISCARD bool operator!=(
}
#endif // !_HAS_CXX20
// CLASS TEMPLATE ostreambuf_iterator
template <class _Elem, class _Traits>
class ostreambuf_iterator {
public:
@ -541,7 +530,6 @@ private:
};
#ifdef __cpp_lib_concepts
// CLASS TEMPLATE common_iterator
enum class _Variantish_state : unsigned char { _Nothing, _Holds_iter, _Holds_sentinel };
struct _Common_iterator_construct_tag {
@ -1039,7 +1027,6 @@ struct iterator_traits<common_iterator<_Iter, _Se>> {
using reference = iter_reference_t<_Iter>;
};
// CLASS TEMPLATE counted_iterator
template <class _Iter>
struct _Counted_iterator_value_type_base {};
@ -1372,7 +1359,6 @@ _STDEXT_BEGIN
using _STD iterator_traits;
using _STD size_t;
// CLASS TEMPLATE checked_array_iterator
template <class _Ptr>
class checked_array_iterator { // wrap a pointer with checking
static_assert(_STD is_pointer_v<_Ptr>, "checked_array_iterator requires pointers");
@ -1575,7 +1561,6 @@ _NODISCARD constexpr checked_array_iterator<_Ptr> make_checked_array_iterator(
return checked_array_iterator<_Ptr>(_Array, _Size, _Index);
}
// CLASS TEMPLATE unchecked_array_iterator
template <class _Ptr>
class unchecked_array_iterator { // wrap a pointer without checking, to silence warnings
static_assert(_STD is_pointer_v<_Ptr>, "unchecked_array_iterator requires pointers");

Просмотреть файл

@ -23,14 +23,12 @@ _STL_DISABLE_CLANG_WARNINGS
#undef new
_STD_BEGIN
// ENUM float_denorm_style
enum float_denorm_style { // constants for different IEEE float denormalization styles
denorm_indeterminate = -1,
denorm_absent = 0,
denorm_present = 1
};
// ENUM float_round_style
enum float_round_style { // constants for different IEEE rounding styles
round_indeterminate = -1,
round_toward_zero = 0,
@ -39,7 +37,6 @@ enum float_round_style { // constants for different IEEE rounding styles
round_toward_neg_infinity = 3
};
// STRUCT _Num_base
struct _Num_base { // base for all types, with common defaults
static constexpr float_denorm_style has_denorm = denorm_absent;
static constexpr bool has_denorm_loss = false;
@ -66,7 +63,6 @@ struct _Num_base { // base for all types, with common defaults
static constexpr int radix = 0;
};
// CLASS TEMPLATE numeric_limits
template <class _Ty>
class numeric_limits : public _Num_base { // numeric limits for arbitrary type _Ty (say little or nothing)
public:
@ -116,7 +112,6 @@ class numeric_limits<volatile _Ty> : public numeric_limits<_Ty> {}; // numeric l
template <class _Ty>
class numeric_limits<const volatile _Ty> : public numeric_limits<_Ty> {}; // numeric limits for const volatile types
// STRUCT _Num_int_base
struct _Num_int_base : _Num_base { // base for integer types
static constexpr bool is_bounded = true;
static constexpr bool is_exact = true;
@ -125,7 +120,6 @@ struct _Num_int_base : _Num_base { // base for integer types
static constexpr int radix = 2;
};
// STRUCT _Num_float_base
struct _Num_float_base : _Num_base { // base for floating-point types
static constexpr float_denorm_style has_denorm = denorm_present;
static constexpr bool has_infinity = true;
@ -139,7 +133,6 @@ struct _Num_float_base : _Num_base { // base for floating-point types
static constexpr int radix = FLT_RADIX;
};
// CLASS numeric_limits<bool>
template <>
class numeric_limits<bool> : public _Num_int_base {
public:
@ -182,7 +175,6 @@ public:
static constexpr int digits = 1;
};
// CLASS numeric_limits<char>
template <>
class numeric_limits<char> : public _Num_int_base {
public:
@ -228,7 +220,6 @@ public:
static constexpr int digits10 = 2;
};
// CLASS numeric_limits<signed char>
template <>
class numeric_limits<signed char> : public _Num_int_base {
public:
@ -273,7 +264,6 @@ public:
static constexpr int digits10 = 2;
};
// CLASS numeric_limits<unsigned char>
template <>
class numeric_limits<unsigned char> : public _Num_int_base {
public:
@ -319,7 +309,6 @@ public:
};
#ifdef __cpp_char8_t
// CLASS numeric_limits<char8_t>
template <>
class numeric_limits<char8_t> : public _Num_int_base {
public:
@ -365,7 +354,6 @@ public:
};
#endif // __cpp_char8_t
// CLASS numeric_limits<char16_t>
template <>
class numeric_limits<char16_t> : public _Num_int_base {
public:
@ -410,7 +398,6 @@ public:
static constexpr int digits10 = 4;
};
// CLASS numeric_limits<char32_t>
template <>
class numeric_limits<char32_t> : public _Num_int_base {
public:
@ -455,7 +442,6 @@ public:
static constexpr int digits10 = 9;
};
// CLASS numeric_limits<wchar_t>
template <>
class numeric_limits<wchar_t> : public _Num_int_base {
public:
@ -500,7 +486,6 @@ public:
static constexpr int digits10 = 4;
};
// CLASS numeric_limits<short>
template <>
class numeric_limits<short> : public _Num_int_base {
public:
@ -545,7 +530,6 @@ public:
static constexpr int digits10 = 4;
};
// CLASS numeric_limits<int>
template <>
class numeric_limits<int> : public _Num_int_base {
public:
@ -590,7 +574,6 @@ public:
static constexpr int digits10 = 9;
};
// CLASS numeric_limits<long>
template <>
class numeric_limits<long> : public _Num_int_base {
public:
@ -636,7 +619,6 @@ public:
static constexpr int digits10 = 9;
};
// CLASS numeric_limits<long long>
template <>
class numeric_limits<long long> : public _Num_int_base {
public:
@ -682,7 +664,6 @@ public:
};
#ifdef _NATIVE_WCHAR_T_DEFINED
// CLASS numeric_limits<unsigned short>
template <>
class numeric_limits<unsigned short> : public _Num_int_base {
public:
@ -728,7 +709,6 @@ public:
};
#endif // _NATIVE_WCHAR_T_DEFINED
// CLASS numeric_limits<unsigned int>
template <>
class numeric_limits<unsigned int> : public _Num_int_base {
public:
@ -773,7 +753,6 @@ public:
static constexpr int digits10 = 9;
};
// CLASS numeric_limits<unsigned long>
template <>
class numeric_limits<unsigned long> : public _Num_int_base {
public:
@ -819,7 +798,6 @@ public:
static constexpr int digits10 = 9;
};
// CLASS numeric_limits<unsigned long long>
template <>
class numeric_limits<unsigned long long> : public _Num_int_base {
public:
@ -864,7 +842,6 @@ public:
static constexpr int digits10 = 19;
};
// CLASS numeric_limits<float>
template <>
class numeric_limits<float> : public _Num_float_base {
public:
@ -913,7 +890,6 @@ public:
static constexpr int min_exponent10 = FLT_MIN_10_EXP;
};
// CLASS numeric_limits<double>
template <>
class numeric_limits<double> : public _Num_float_base {
public:
@ -962,7 +938,6 @@ public:
static constexpr int min_exponent10 = DBL_MIN_10_EXP;
};
// CLASS numeric_limits<long double>
template <>
class numeric_limits<long double> : public _Num_float_base {
public:

Просмотреть файл

@ -22,7 +22,6 @@ _STL_DISABLE_CLANG_WARNINGS
#undef new
_STD_BEGIN
// CLASS TEMPLATE _List_unchecked_const_iterator
template <class _Mylist, class _Base = _Iterator_base0>
class _List_unchecked_const_iterator : public _Base {
public:
@ -83,7 +82,6 @@ public:
_Nodeptr _Ptr; // pointer to node
};
// CLASS TEMPLATE _List_unchecked_iterator
template <class _Mylist>
class _List_unchecked_iterator : public _List_unchecked_const_iterator<_Mylist> {
public:
@ -129,7 +127,6 @@ public:
}
};
// CLASS TEMPLATE _List_const_iterator
template <class _Mylist>
class _List_const_iterator : public _List_unchecked_const_iterator<_Mylist, _Iterator_base> {
public:
@ -224,7 +221,6 @@ public:
}
};
// CLASS TEMPLATE _List_iterator
template <class _Mylist>
class _List_iterator : public _List_const_iterator<_Mylist> {
public:
@ -276,7 +272,6 @@ public:
}
};
// list TYPE WRAPPERS
template <class _Value_type, class _Size_type, class _Difference_type, class _Pointer, class _Const_pointer,
class _Reference, class _Const_reference, class _Nodeptr_type>
struct _List_iter_types {
@ -341,7 +336,6 @@ struct _List_simple_types : _Simple_types<_Ty> {
using _Nodeptr = _Node*;
};
// CLASS TEMPLATE _List_val
template <class _Val_types>
class _List_val : public _Container_base {
public:
@ -579,7 +573,6 @@ public:
size_type _Mysize; // number of elements
};
// STRUCT TEMPLATE _List_node_emplace_op2
template <class _Alnode>
struct _List_node_emplace_op2 : _Alloc_construct_ptr<_Alnode> {
using _Alnode_traits = allocator_traits<_Alnode>;
@ -612,7 +605,6 @@ struct _List_node_emplace_op2 : _Alloc_construct_ptr<_Alnode> {
}
};
// STRUCT TEMPLATE _List_node_insert_op2
template <class _Alnode>
struct _List_node_insert_op2 {
// list insert operation which maintains exception safety
@ -758,7 +750,6 @@ private:
template <class _Traits>
class _Hash;
// CLASS TEMPLATE list
template <class _Ty, class _Alloc = allocator<_Ty>>
class list { // bidirectional linked list
private:

Просмотреть файл

@ -23,7 +23,6 @@ _STL_DISABLE_CLANG_WARNINGS
#undef new
_STD_BEGIN
// CLASS TEMPLATE collate
template <class _Elem>
class collate : public locale::facet { // facet for ordering sequences of elements
public:
@ -118,7 +117,6 @@ private:
_Locinfo::_Collvec _Coll; // used by _LStrcoll and _XStrxfrm
};
// STATIC collate::id OBJECT
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdllimport-static-field-def"
@ -143,7 +141,6 @@ template __PURE_APPDOMAIN_GLOBAL locale::id collate<unsigned short>::id;
#pragma clang diagnostic pop
#endif // __clang__
// CLASS TEMPLATE collate_byname
template <class _Elem>
class collate_byname : public collate<_Elem> { // collate for named locale
public:
@ -159,7 +156,6 @@ protected:
__CLR_OR_THIS_CALL ~collate_byname() noexcept override {}
};
// FUNCTION TEMPLATE has_facet
template <class _Facet>
_NODISCARD bool has_facet(const locale& _Loc) noexcept {
_BEGIN_LOCK(_LOCK_LOCALE) // the thread lock, make get atomic
@ -168,85 +164,71 @@ _NODISCARD bool has_facet(const locale& _Loc) noexcept {
_END_LOCK()
}
// FUNCTION TEMPLATE isalnum
template <class _Elem>
_NODISCARD bool(isalnum)(_Elem _Ch, const locale& _Loc) {
return _STD use_facet<ctype<_Elem>>(_Loc).is(ctype_base::alnum, _Ch);
}
// FUNCTION TEMPLATE isalpha
template <class _Elem>
_NODISCARD bool(isalpha)(_Elem _Ch, const locale& _Loc) {
return _STD use_facet<ctype<_Elem>>(_Loc).is(ctype_base::alpha, _Ch);
}
// FUNCTION TEMPLATE isblank
template <class _Elem>
_NODISCARD bool(isblank)(_Elem _Ch, const locale& _Loc) {
return _STD use_facet<ctype<_Elem>>(_Loc).is(ctype_base::blank, _Ch);
}
// FUNCTION TEMPLATE iscntrl
template <class _Elem>
_NODISCARD bool(iscntrl)(_Elem _Ch, const locale& _Loc) {
return _STD use_facet<ctype<_Elem>>(_Loc).is(ctype_base::cntrl, _Ch);
}
// FUNCTION TEMPLATE isdigit
template <class _Elem>
_NODISCARD bool(isdigit)(_Elem _Ch, const locale& _Loc) {
return _STD use_facet<ctype<_Elem>>(_Loc).is(ctype_base::digit, _Ch);
}
// FUNCTION TEMPLATE isgraph
template <class _Elem>
_NODISCARD bool(isgraph)(_Elem _Ch, const locale& _Loc) {
return _STD use_facet<ctype<_Elem>>(_Loc).is(ctype_base::graph, _Ch);
}
// FUNCTION TEMPLATE islower
template <class _Elem>
_NODISCARD bool(islower)(_Elem _Ch, const locale& _Loc) {
return _STD use_facet<ctype<_Elem>>(_Loc).is(ctype_base::lower, _Ch);
}
// FUNCTION TEMPLATE isprint
template <class _Elem>
_NODISCARD bool(isprint)(_Elem _Ch, const locale& _Loc) {
return _STD use_facet<ctype<_Elem>>(_Loc).is(ctype_base::print, _Ch);
}
// FUNCTION TEMPLATE ispunct
template <class _Elem>
_NODISCARD bool(ispunct)(_Elem _Ch, const locale& _Loc) {
return _STD use_facet<ctype<_Elem>>(_Loc).is(ctype_base::punct, _Ch);
}
// FUNCTION TEMPLATE isspace
template <class _Elem>
_NODISCARD bool(isspace)(_Elem _Ch, const locale& _Loc) {
return _STD use_facet<ctype<_Elem>>(_Loc).is(ctype_base::space, _Ch);
}
// FUNCTION TEMPLATE isupper
template <class _Elem>
_NODISCARD bool(isupper)(_Elem _Ch, const locale& _Loc) {
return _STD use_facet<ctype<_Elem>>(_Loc).is(ctype_base::upper, _Ch);
}
// FUNCTION TEMPLATE isxdigit
template <class _Elem>
_NODISCARD bool(isxdigit)(_Elem _Ch, const locale& _Loc) {
return _STD use_facet<ctype<_Elem>>(_Loc).is(ctype_base::xdigit, _Ch);
}
// FUNCTION TEMPLATE tolower
template <class _Elem>
_NODISCARD _Elem(tolower)(_Elem _Ch, const locale& _Loc) {
return _STD use_facet<ctype<_Elem>>(_Loc).tolower(_Ch);
}
// FUNCTION TEMPLATE toupper
template <class _Elem>
_NODISCARD _Elem(toupper)(_Elem _Ch, const locale& _Loc) {
return _STD use_facet<ctype<_Elem>>(_Loc).toupper(_Ch);

Просмотреть файл

@ -23,7 +23,6 @@ _STL_DISABLE_CLANG_WARNINGS
#pragma push_macro("new")
#undef new
_STD_BEGIN
// CLASS TEMPLATE _Tmap_traits
template <class _Kty, // key type
class _Ty, // mapped type
class _Pr, // comparator predicate type
@ -70,7 +69,6 @@ public:
}
};
// CLASS TEMPLATE map
template <class _Kty, class _Ty, class _Pr = less<_Kty>, class _Alloc = allocator<pair<const _Kty, _Ty>>>
class map : public _Tree<_Tmap_traits<_Kty, _Ty, _Pr, _Alloc, false>> {
// ordered red-black tree of {key, mapped} values, unique keys
@ -419,7 +417,6 @@ typename map<_Kty, _Ty, _Keylt, _Alloc>::size_type erase_if(map<_Kty, _Ty, _Keyl
}
#endif // _HAS_CXX20
// CLASS TEMPLATE multimap
template <class _Kty, class _Ty, class _Pr = less<_Kty>, class _Alloc = allocator<pair<const _Kty, _Ty>>>
class multimap : public _Tree<_Tmap_traits<_Kty, _Ty, _Pr, _Alloc, true>> {
// ordered red-black tree of {key, mapped} values, non-unique keys

Просмотреть файл

@ -28,11 +28,9 @@ _STL_DISABLE_CLANG_WARNINGS
_STD_BEGIN
#ifdef __cpp_lib_concepts
namespace ranges {
// ALIAS TEMPLATE uninitialized_copy_result
template <class _In, class _Out>
using uninitialized_copy_result = in_out_result<_In, _Out>;
// VARIABLE ranges::uninitialized_copy
class _Uninitialized_copy_fn : private _Not_quite_object {
public:
using _Not_quite_object::_Not_quite_object;
@ -108,7 +106,6 @@ namespace ranges {
} // namespace ranges
#endif // __cpp_lib_concepts
// FUNCTION TEMPLATE uninitialized_copy_n
template <class _InIt, class _Diff, class _NoThrowFwdIt>
_NoThrowFwdIt uninitialized_copy_n(const _InIt _First, const _Diff _Count_raw, _NoThrowFwdIt _Dest) {
// copy [_First, _First + _Count) to [_Dest, ...)
@ -137,11 +134,9 @@ _NoThrowFwdIt uninitialized_copy_n(const _InIt _First, const _Diff _Count_raw, _
#ifdef __cpp_lib_concepts
namespace ranges {
// ALIAS TEMPLATE uninitialized_copy_n_result
template <class _In, class _Out>
using uninitialized_copy_n_result = in_out_result<_In, _Out>;
// VARIABLE ranges::uninitialized_copy_n
class _Uninitialized_copy_n_fn : private _Not_quite_object {
public:
using _Not_quite_object::_Not_quite_object;
@ -192,7 +187,6 @@ namespace ranges {
#endif // __cpp_lib_concepts
#if _HAS_CXX17
// FUNCTION TEMPLATE uninitialized_move
template <class _InIt, class _NoThrowFwdIt>
_NoThrowFwdIt uninitialized_move(const _InIt _First, const _InIt _Last, _NoThrowFwdIt _Dest) {
// move [_First, _Last) to raw [_Dest, ...)
@ -206,7 +200,6 @@ _NoThrowFwdIt uninitialized_move(const _InIt _First, const _InIt _Last, _NoThrow
#ifdef __cpp_lib_concepts
namespace ranges {
// VARIABLE ranges::uninitialized_move
class _Uninitialized_move_fn : private _Not_quite_object {
public:
using _Not_quite_object::_Not_quite_object;
@ -247,7 +240,6 @@ namespace ranges {
} // namespace ranges
#endif // __cpp_lib_concepts
// FUNCTION TEMPLATE uninitialized_move_n
template <class _InIt, class _Diff, class _NoThrowFwdIt>
pair<_InIt, _NoThrowFwdIt> uninitialized_move_n(_InIt _First, const _Diff _Count_raw, _NoThrowFwdIt _Dest) {
// move [_First, _First + _Count) to [_Dest, ...)
@ -280,11 +272,9 @@ pair<_InIt, _NoThrowFwdIt> uninitialized_move_n(_InIt _First, const _Diff _Count
#ifdef __cpp_lib_concepts
namespace ranges {
// ALIAS TEMPLATE uninitialized_move_n_result
template <class _In, class _Out>
using uninitialized_move_n_result = in_out_result<_In, _Out>;
// VARIABLE ranges::uninitialized_move_n
class _Uninitialized_move_n_fn : private _Not_quite_object {
public:
using _Not_quite_object::_Not_quite_object;
@ -332,7 +322,6 @@ namespace ranges {
inline constexpr _Uninitialized_move_n_fn uninitialized_move_n{_Not_quite_object::_Construct_tag{}};
// VARIABLE ranges::uninitialized_fill
class _Uninitialized_fill_fn : private _Not_quite_object {
public:
using _Not_quite_object::_Not_quite_object;
@ -393,7 +382,6 @@ namespace ranges {
} // namespace ranges
#endif // __cpp_lib_concepts
// FUNCTION TEMPLATE uninitialized_fill_n
template <class _NoThrowFwdIt, class _Diff, class _Tval>
_NoThrowFwdIt uninitialized_fill_n(_NoThrowFwdIt _First, const _Diff _Count_raw, const _Tval& _Val) {
// copy _Count copies of _Val to raw _First
@ -430,7 +418,6 @@ _NoThrowFwdIt uninitialized_fill_n(_NoThrowFwdIt _First, const _Diff _Count_raw,
#ifdef __cpp_lib_concepts
namespace ranges {
// VARIABLE ranges::uninitialized_fill_n
class _Uninitialized_fill_n_fn : private _Not_quite_object {
public:
using _Not_quite_object::_Not_quite_object;
@ -471,7 +458,6 @@ namespace ranges {
inline constexpr _Uninitialized_fill_n_fn uninitialized_fill_n{_Not_quite_object::_Construct_tag{}};
// VARIABLE ranges::construct_at
class _Construct_at_fn : private _Not_quite_object {
public:
using _Not_quite_object::_Not_quite_object;
@ -492,7 +478,6 @@ namespace ranges {
inline constexpr _Construct_at_fn construct_at{_Not_quite_object::_Construct_tag{}};
// VARIABLE ranges::destroy_at
// clang-format off
template <_No_throw_input_iterator _It, _No_throw_sentinel_for<_It> _Se>
requires destructible<iter_value_t<_It>>
@ -518,7 +503,6 @@ namespace ranges {
#endif // __cpp_lib_concepts
#if _HAS_CXX17
// FUNCTION TEMPLATE destroy
template <class _NoThrowFwdIt>
_CONSTEXPR20 void destroy(const _NoThrowFwdIt _First, const _NoThrowFwdIt _Last) {
// destroy all elements in [_First, _Last)
@ -528,7 +512,6 @@ _CONSTEXPR20 void destroy(const _NoThrowFwdIt _First, const _NoThrowFwdIt _Last)
#ifdef __cpp_lib_concepts
namespace ranges {
// VARIABLE ranges::destroy
// clang-format off
template <_No_throw_input_iterator _It, _No_throw_sentinel_for<_It> _Se>
requires destructible<iter_value_t<_It>>
@ -575,7 +558,6 @@ namespace ranges {
} // namespace ranges
#endif // __cpp_lib_concepts
// FUNCTION TEMPLATE destroy_n
template <class _NoThrowFwdIt, class _Diff>
_CONSTEXPR20 _NoThrowFwdIt destroy_n(_NoThrowFwdIt _First, const _Diff _Count_raw) {
// destroy all elements in [_First, _First + _Count)
@ -599,7 +581,6 @@ _CONSTEXPR20 _NoThrowFwdIt destroy_n(_NoThrowFwdIt _First, const _Diff _Count_ra
#ifdef __cpp_lib_concepts
namespace ranges {
// VARIABLE ranges::destroy_n
class _Destroy_n_fn : private _Not_quite_object {
public:
using _Not_quite_object::_Not_quite_object;
@ -634,7 +615,6 @@ namespace ranges {
} // namespace ranges
#endif // __cpp_lib_concepts
// FUNCTION TEMPLATE uninitialized_default_construct
template <class _NoThrowFwdIt>
void uninitialized_default_construct(const _NoThrowFwdIt _First, const _NoThrowFwdIt _Last) {
// default-initialize all elements in [_First, _Last)
@ -653,7 +633,6 @@ void uninitialized_default_construct(const _NoThrowFwdIt _First, const _NoThrowF
#ifdef __cpp_lib_concepts
namespace ranges {
// VARIABLE ranges::uninitialized_default_construct
class _Uninitialized_default_construct_fn : private _Not_quite_object {
public:
using _Not_quite_object::_Not_quite_object;
@ -709,7 +688,6 @@ namespace ranges {
} // namespace ranges
#endif // __cpp_lib_concepts
// FUNCTION TEMPLATE uninitialized_default_construct_n
template <class _NoThrowFwdIt, class _Diff>
_NoThrowFwdIt uninitialized_default_construct_n(_NoThrowFwdIt _First, const _Diff _Count_raw) {
// default-initialize all elements in [_First, _First + _Count_raw)
@ -735,7 +713,6 @@ _NoThrowFwdIt uninitialized_default_construct_n(_NoThrowFwdIt _First, const _Dif
#ifdef __cpp_lib_concepts
namespace ranges {
// VARIABLE ranges::uninitialized_default_construct_n
class _Uninitialized_default_construct_n_fn : private _Not_quite_object {
public:
using _Not_quite_object::_Not_quite_object;
@ -770,7 +747,6 @@ namespace ranges {
} // namespace ranges
#endif // __cpp_lib_concepts
// FUNCTION TEMPLATE uninitialized_value_construct
template <class _NoThrowFwdIt>
void uninitialized_value_construct(const _NoThrowFwdIt _First, const _NoThrowFwdIt _Last) {
// value-initialize all elements in [_First, _Last)
@ -792,7 +768,6 @@ void uninitialized_value_construct(const _NoThrowFwdIt _First, const _NoThrowFwd
#ifdef __cpp_lib_concepts
namespace ranges {
// VARIABLE ranges::uninitialized_value_construct
class _Uninitialized_value_construct_fn : private _Not_quite_object {
public:
using _Not_quite_object::_Not_quite_object;
@ -846,7 +821,6 @@ namespace ranges {
} // namespace ranges
#endif // __cpp_lib_concepts
// FUNCTION TEMPLATE uninitialized_value_construct_n
template <class _NoThrowFwdIt, class _Diff>
_NoThrowFwdIt uninitialized_value_construct_n(_NoThrowFwdIt _First, const _Diff _Count_raw) {
// value-initialize all elements in [_First, _First + _Count_raw)
@ -861,7 +835,6 @@ _NoThrowFwdIt uninitialized_value_construct_n(_NoThrowFwdIt _First, const _Diff
#ifdef __cpp_lib_concepts
namespace ranges {
// VARIABLE ranges::uninitialized_value_construct_n
class _Uninitialized_value_construct_n_fn : private _Not_quite_object {
public:
using _Not_quite_object::_Not_quite_object;
@ -899,7 +872,6 @@ namespace ranges {
#if _HAS_DEPRECATED_RAW_STORAGE_ITERATOR
// CLASS TEMPLATE raw_storage_iterator
template <class _OutIt, class _Ty>
class _CXX17_DEPRECATE_RAW_STORAGE_ITERATOR raw_storage_iterator { // wrap stores to raw buffer as output iterator
public:
@ -947,7 +919,6 @@ private:
#if _HAS_AUTO_PTR_ETC
// CLASS TEMPLATE auto_ptr
template <class _Ty>
class auto_ptr;
@ -1057,7 +1028,6 @@ public:
#endif // _HAS_AUTO_PTR_ETC
// CLASS bad_weak_ptr
class bad_weak_ptr : public exception { // exception type for invalid use of expired weak_ptr object
public:
bad_weak_ptr() noexcept {}
@ -1072,7 +1042,6 @@ public:
_THROW(bad_weak_ptr{});
}
// CLASS _Ref_count_base
class __declspec(novtable) _Ref_count_base { // common code for reference counting
private:
#ifdef _M_CEE_PURE
@ -1150,7 +1119,6 @@ public:
}
};
// CLASS TEMPLATE _Ref_count
template <class _Ty>
class _Ref_count : public _Ref_count_base { // handle reference counting for pointer without deleter
public:
@ -1168,7 +1136,6 @@ private:
_Ty* _Ptr;
};
// CLASS TEMPLATE _Ref_count_resource
template <class _Resource, class _Dx>
class _Ref_count_resource : public _Ref_count_base { // handle reference counting for object with deleter
public:
@ -1205,7 +1172,6 @@ private:
_Compressed_pair<_Dx, _Resource> _Mypair;
};
// CLASS TEMPLATE _Ref_count_resource_alloc
template <class _Resource, class _Dx, class _Alloc>
class _Ref_count_resource_alloc : public _Ref_count_base {
// handle reference counting for object with deleter and allocator
@ -1248,7 +1214,6 @@ private:
_Compressed_pair<_Dx, _Compressed_pair<_Myalty, _Resource>> _Mypair;
};
// DECLARATIONS
template <class _Ty>
struct default_delete;
@ -1270,7 +1235,6 @@ struct _Can_enable_shared<_Yty, void_t<typename _Yty::_Esft_type>>
// is_convertible is necessary to verify unambiguous inheritance
};
// CLASS TEMPLATE _Ptr_base
struct _Exception_ptr_access;
template <class _Ty>
@ -1446,25 +1410,21 @@ private:
#endif // _HAS_STATIC_RTTI
};
// TYPE TRAIT _Can_scalar_delete
template <class _Yty, class = void>
struct _Can_scalar_delete : false_type {};
template <class _Yty>
struct _Can_scalar_delete<_Yty, void_t<decltype(delete _STD declval<_Yty*>())>> : true_type {};
// TYPE TRAIT _Can_array_delete
template <class _Yty, class = void>
struct _Can_array_delete : false_type {};
template <class _Yty>
struct _Can_array_delete<_Yty, void_t<decltype(delete[] _STD declval<_Yty*>())>> : true_type {};
// TYPE TRAIT _Can_call_function_object
template <class _Fx, class _Arg, class = void>
struct _Can_call_function_object : false_type {};
template <class _Fx, class _Arg>
struct _Can_call_function_object<_Fx, _Arg, void_t<decltype(_STD declval<_Fx>()(_STD declval<_Arg>()))>> : true_type {};
// TYPE TRAIT _SP_convertible
template <class _Yty, class _Ty>
struct _SP_convertible : is_convertible<_Yty*, _Ty*>::type {};
template <class _Yty, class _Uty>
@ -1472,7 +1432,6 @@ struct _SP_convertible<_Yty, _Uty[]> : is_convertible<_Yty (*)[], _Uty (*)[]>::t
template <class _Yty, class _Uty, size_t _Ext>
struct _SP_convertible<_Yty, _Uty[_Ext]> : is_convertible<_Yty (*)[_Ext], _Uty (*)[_Ext]>::type {};
// TYPE TRAIT _SP_pointer_compatible
template <class _Yty, class _Ty>
struct _SP_pointer_compatible : is_convertible<_Yty*, _Ty*>::type {
// N4659 [util.smartptr.shared]/5 "a pointer type Y* is said to be compatible
@ -1495,7 +1454,6 @@ struct _SP_pointer_compatible<_Uty[_Ext], const volatile _Uty[]> : true_type {
// N4659 [util.smartptr.shared]/5 "... or Y is U[N] and T is cv U[]."
};
// CLASS TEMPLATE shared_ptr
template <class _Ux>
struct _Temporary_owner {
_Ux* _Ptr;
@ -2038,7 +1996,6 @@ struct _For_overwrite_tag {
};
#endif // _HAS_CXX20
// CLASS TEMPLATE _Ref_count_obj2
template <class _Ty>
class _Ref_count_obj2 : public _Ref_count_base { // handle reference counting for object in control block, no allocator
public:
@ -2288,7 +2245,6 @@ void _Uninitialized_fill_multidimensional_n(_Ty* const _Out, const size_t _Size,
}
}
// CLASS TEMPLATE _Ref_count_unbounded_array
template <class _Ty, bool = is_trivially_destructible_v<remove_extent_t<_Ty>>>
class _Ref_count_unbounded_array : public _Ref_count_base {
// handle reference counting for unbounded array with trivial destruction in control block, no allocator
@ -2383,7 +2339,6 @@ private:
}
};
// CLASS TEMPLATE _Ref_count_bounded_array
template <class _Ty>
class _Ref_count_bounded_array : public _Ref_count_base {
// handle reference counting for bounded array in control block, no allocator
@ -2422,7 +2377,6 @@ private:
};
#endif // _HAS_CXX20
// CLASS TEMPLATE _Ebco_base
template <class _Ty,
bool = is_empty_v<_Ty> && !is_final_v<_Ty>>
class _Ebco_base : private _Ty { // Empty Base Class Optimization, active
@ -2462,7 +2416,6 @@ protected:
}
};
// CLASS TEMPLATE _Ref_count_obj_alloc3
template <class _Ty, class _Alloc>
class _Ref_count_obj_alloc3 : public _Ebco_base<_Rebind_alloc_t<_Alloc, _Ty>>, public _Ref_count_base {
// handle reference counting for object in control block, allocator
@ -2639,7 +2592,6 @@ void _Uninitialized_fill_multidimensional_n_al(_Ty* const _Out, const size_t _Si
}
}
// CLASS TEMPLATE _Ref_count_unbounded_array_alloc
template <class _Ty, class _Alloc>
class _Ref_count_unbounded_array_alloc : public _Ebco_base<_Rebind_alloc_t<_Alloc, remove_all_extents_t<_Ty>>>,
public _Ref_count_base {
@ -2707,7 +2659,6 @@ private:
}
};
// CLASS TEMPLATE _Ref_count_bounded_array_alloc
template <class _Ty, class _Alloc>
class _Ref_count_bounded_array_alloc : public _Ebco_base<_Rebind_alloc_t<_Alloc, remove_all_extents_t<_Ty>>>,
public _Ref_count_base {
@ -2761,7 +2712,6 @@ private:
};
#endif // _HAS_CXX20
// FUNCTION TEMPLATE make_shared
template <class _Ty, class... _Types>
_NODISCARD
#if _HAS_CXX20
@ -2834,7 +2784,6 @@ _NODISCARD enable_if_t<is_bounded_array_v<_Ty>, shared_ptr<_Ty>> make_shared(con
return _Ret;
}
// FUNCTION TEMPLATE make_shared_for_overwrite
template <class _Ty>
_NODISCARD enable_if_t<!is_unbounded_array_v<_Ty>, shared_ptr<_Ty>> make_shared_for_overwrite() {
shared_ptr<_Ty> _Ret;
@ -2856,7 +2805,6 @@ _NODISCARD enable_if_t<is_unbounded_array_v<_Ty>, shared_ptr<_Ty>> make_shared_f
}
#endif // _HAS_CXX20
// FUNCTION TEMPLATE allocate_shared
template <class _Ty, class _Alloc, class... _Types>
_NODISCARD
#if _HAS_CXX20
@ -2961,7 +2909,6 @@ _NODISCARD enable_if_t<is_bounded_array_v<_Ty>, shared_ptr<_Ty>> allocate_shared
return _Ret;
}
// FUNCTION TEMPLATE allocate_shared_for_overwrite
template <class _Ty, class _Alloc>
_NODISCARD enable_if_t<!is_unbounded_array_v<_Ty>, shared_ptr<_Ty>> allocate_shared_for_overwrite(const _Alloc& _Al) {
shared_ptr<_Ty> _Ret;
@ -2997,7 +2944,6 @@ _NODISCARD enable_if_t<is_unbounded_array_v<_Ty>, shared_ptr<_Ty>> allocate_shar
}
#endif // _HAS_CXX20
// CLASS TEMPLATE weak_ptr
template <class _Ty>
class weak_ptr : public _Ptr_base<_Ty> { // class for pointer to reference counted resource
public:
@ -3087,7 +3033,6 @@ void swap(weak_ptr<_Ty>& _Left, weak_ptr<_Ty>& _Right) noexcept {
_Left.swap(_Right);
}
// CLASS TEMPLATE enable_shared_from_this
template <class _Ty>
class enable_shared_from_this { // provide member functions that create shared_ptr to this
public:
@ -3130,9 +3075,6 @@ private:
};
// CLASS TEMPLATE unique_ptr AND HELPERS
// STRUCT TEMPLATE default_delete
template <class _Ty>
struct default_delete { // default deleter for unique_ptr
constexpr default_delete() noexcept = default;
@ -3160,7 +3102,6 @@ struct default_delete<_Ty[]> { // default deleter for unique_ptr to array of unk
}
};
// STRUCT TEMPLATE _Get_deleter_pointer_type
template <class _Ty, class _Dx_noref, class = void>
struct _Get_deleter_pointer_type { // provide fallback
using type = _Ty*;
@ -3175,7 +3116,6 @@ template <class _Dx2>
using _Unique_ptr_enable_default_t =
enable_if_t<conjunction_v<negation<is_pointer<_Dx2>>, is_default_constructible<_Dx2>>, int>;
// CLASS TEMPLATE unique_ptr SCALAR
template <class _Ty, class _Dx /* = default_delete<_Ty> */>
class unique_ptr { // non-copyable pointer to an object
public:
@ -3301,7 +3241,6 @@ private:
_Compressed_pair<_Dx, pointer> _Mypair;
};
// CLASS TEMPLATE unique_ptr ARRAY
template <class _Ty, class _Dx>
class unique_ptr<_Ty[], _Dx> { // non-copyable pointer to an array object
public:
@ -3435,7 +3374,6 @@ private:
};
// FUNCTION TEMPLATE make_unique
template <class _Ty, class... _Types, enable_if_t<!is_array_v<_Ty>, int> = 0>
_NODISCARD unique_ptr<_Ty> make_unique(_Types&&... _Args) { // make a unique_ptr
return unique_ptr<_Ty>(new _Ty(_STD forward<_Types>(_Args)...));
@ -3451,7 +3389,6 @@ template <class _Ty, class... _Types, enable_if_t<extent_v<_Ty> != 0, int> = 0>
void make_unique(_Types&&...) = delete;
#if _HAS_CXX20
// FUNCTION TEMPLATE make_unique_for_overwrite
template <class _Ty, enable_if_t<!is_array_v<_Ty>, int> = 0>
_NODISCARD unique_ptr<_Ty> make_unique_for_overwrite() { // make a unique_ptr with default initialization
return unique_ptr<_Ty>(new _Ty);
@ -3610,7 +3547,6 @@ basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Out, c
return _Out;
}
// GARBAGE COLLECTION
#if _HAS_GARBAGE_COLLECTION_SUPPORT_DELETED_IN_CXX23
enum class pointer_safety { relaxed, preferred, strict };
@ -3630,7 +3566,6 @@ inline pointer_safety get_pointer_safety() noexcept {
}
#endif // _HAS_GARBAGE_COLLECTION_SUPPORT_DELETED_IN_CXX23
// STRUCT TEMPLATE owner_less
template <class _Ty = void>
struct owner_less; // not defined
@ -3697,7 +3632,6 @@ struct owner_less<void> {
using is_transparent = int;
};
// STRUCT TEMPLATE SPECIALIZATION hash
template <class _Ty, class _Dx>
struct hash<unique_ptr<_Ty, _Dx>> : _Conditionally_enabled_hash<unique_ptr<_Ty, _Dx>,
is_default_constructible_v<hash<typename unique_ptr<_Ty, _Dx>::pointer>>> {
@ -3717,7 +3651,6 @@ struct hash<shared_ptr<_Ty>> {
}
};
// FUNCTION align
inline void* align(size_t _Bound, size_t _Size, void*& _Ptr, size_t& _Space) noexcept /* strengthened */ {
// try to carve out _Size bytes on boundary _Bound
size_t _Off = static_cast<size_t>(reinterpret_cast<uintptr_t>(_Ptr) & (_Bound - 1));
@ -3747,13 +3680,11 @@ _NODISCARD constexpr _Ty* assume_aligned(_Ty* const _Ptr) noexcept /* strengthen
}
#endif // _HAS_CXX20
// SPIN LOCKS
_EXTERN_C
_CRTIMP2_PURE void __cdecl _Lock_shared_ptr_spin_lock();
_CRTIMP2_PURE void __cdecl _Unlock_shared_ptr_spin_lock();
_END_EXTERN_C
// WRAP SPIN-LOCK
struct _Shared_ptr_spin_lock { // class to manage a spin lock for shared_ptr atomic operations
_Shared_ptr_spin_lock() { // lock the spin lock
_Lock_shared_ptr_spin_lock();

Просмотреть файл

@ -32,7 +32,6 @@ _STD_BEGIN
namespace pmr {
// FUNCTION set_default_resource
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;
@ -46,7 +45,6 @@ namespace pmr {
extern "C" _NODISCARD _CRT_SATELLITE_1 memory_resource* __cdecl null_memory_resource() noexcept;
// FUNCTION new_delete_resource
class _Identity_equal_resource : public memory_resource {
protected:
bool do_is_equal(const memory_resource& _That) const noexcept override {
@ -105,7 +103,6 @@ namespace pmr {
}
#endif // __cpp_aligned_new
// CLASS unsynchronized_pool_resource
template <class _Tag = void>
struct _Double_link { // base class for intrusive doubly-linked structures
_Double_link* _Next;
@ -597,7 +594,6 @@ namespace pmr {
};
#endif // _M_CEE
// CLASS TEMPLATE monotonic_buffer_resource
class monotonic_buffer_resource : public _Identity_equal_resource {
public:
explicit monotonic_buffer_resource(memory_resource* const _Upstream) noexcept // strengthened

Просмотреть файл

@ -33,7 +33,6 @@ _STD_BEGIN
class condition_variable;
class condition_variable_any;
// MUTUAL EXCLUSION
class _Mutex_base { // base class for all mutex types
public:
_Mutex_base(int _Flags = 0) noexcept {
@ -106,7 +105,6 @@ public:
};
#endif // _M_CEE
// LOCK PROPERTIES
struct adopt_lock_t { // indicates adopt lock
explicit adopt_lock_t() = default;
};
@ -123,13 +121,11 @@ _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{};
// CLASS TEMPLATE unique_lock
template <class _Mutex>
class unique_lock { // whizzy class with destructor that unlocks mutex
public:
using mutex_type = _Mutex;
// CONSTRUCT, ASSIGN, AND DESTROY
unique_lock() noexcept : _Pmtx(nullptr), _Owns(false) {}
_NODISCARD_CTOR explicit unique_lock(_Mutex& _Mtx)
@ -276,20 +272,17 @@ private:
}
};
// FUNCTION TEMPLATE swap FOR unique_lock
template <class _Mutex>
void swap(unique_lock<_Mutex>& _Left, unique_lock<_Mutex>& _Right) noexcept {
_Left.swap(_Right);
}
// FUNCTION TEMPLATE _Lock_from_locks
template <size_t... _Indices, class... _LockN>
void _Lock_from_locks(const int _Target, index_sequence<_Indices...>, _LockN&... _LkN) { // lock _LkN[_Target]
int _Ignored[] = {((static_cast<int>(_Indices) == _Target ? (void) _LkN.lock() : void()), 0)...};
(void) _Ignored;
}
// FUNCTION TEMPLATE _Try_lock_from_locks
template <size_t... _Indices, class... _LockN>
bool _Try_lock_from_locks(
const int _Target, index_sequence<_Indices...>, _LockN&... _LkN) { // try to lock _LkN[_Target]
@ -299,7 +292,6 @@ bool _Try_lock_from_locks(
return _Result;
}
// FUNCTION TEMPLATE _Unlock_locks
template <size_t... _Indices, class... _LockN>
void _Unlock_locks(const int _First, const int _Last, index_sequence<_Indices...>, _LockN&... _LkN) noexcept
/* terminates */ {
@ -310,7 +302,6 @@ void _Unlock_locks(const int _First, const int _Last, index_sequence<_Indices...
(void) _Ignored;
}
// FUNCTION TEMPLATE try_lock
template <class... _LockN>
int _Try_lock_range(const int _First, const int _Last, _LockN&... _LkN) {
using _Indices = index_sequence_for<_LockN...>;
@ -360,7 +351,6 @@ _NODISCARD int try_lock(_Lock0& _Lk0, _Lock1& _Lk1, _LockN&... _LkN) { // try to
return _Try_lock1(_Lk0, _Lk1, _LkN...);
}
// FUNCTION TEMPLATE lock
template <class... _LockN>
int _Lock_attempt(const int _Hard_lock, _LockN&... _LkN) {
// attempt to lock 3 or more locks, starting by locking _LkN[_Hard_lock] and trying to lock the rest
@ -428,7 +418,6 @@ void lock(_Lock0& _Lk0, _Lock1& _Lk1, _LockN&... _LkN) { // lock multiple locks,
_Lock_nonmember1(_Lk0, _Lk1, _LkN...);
}
// CLASS TEMPLATE lock_guard
template <class _Mutex>
class _NODISCARD lock_guard { // class with destructor that unlocks a mutex
public:
@ -452,7 +441,6 @@ private:
};
#if _HAS_CXX17
// CLASS TEMPLATE scoped_lock
template <class... _Mutexes>
class _NODISCARD scoped_lock { // class with destructor that unlocks mutexes
public:
@ -507,7 +495,6 @@ public:
};
#endif // _HAS_CXX17
// FUNCTION TEMPLATE call_once
#ifdef _M_CEE
#define _WINDOWS_API __stdcall
#define _RENAME_WINDOWS_API(_Api) _Api##_clr

Просмотреть файл

@ -20,7 +20,6 @@ _STL_DISABLE_CLANG_WARNINGS
_STD_BEGIN
#if _HAS_CXX20
// STRUCT destroying_delete_t
struct destroying_delete_t {
explicit destroying_delete_t() = default;
};
@ -28,7 +27,6 @@ inline constexpr destroying_delete_t destroying_delete{};
#endif // _HAS_CXX20
#if _HAS_CXX17
// FUNCTION TEMPLATE launder
template <class _Ty>
_NODISCARD constexpr _Ty* launder(_Ty* _Ptr) noexcept {
static_assert(!is_function_v<_Ty> && !is_void_v<_Ty>,
@ -45,13 +43,11 @@ inline constexpr size_t hardware_destructive_interference_size = 64;
#endif // _HAS_CXX17
// SUPPORT TYPES
#if !defined(_INC_NEW) || !defined(_MSC_EXTENSIONS)
// handler for operator new failures
using new_handler = void(__CLRCALL_PURE_OR_CDECL*)();
#endif // !defined(_INC_NEW) || !defined(_MSC_EXTENSIONS)
// FUNCTION AND OBJECT DECLARATIONS
_CRTIMP2 new_handler __cdecl set_new_handler(_In_opt_ new_handler) noexcept;
_NODISCARD _CRTIMP2 new_handler __cdecl get_new_handler() noexcept;
_STD_END

Просмотреть файл

@ -21,7 +21,6 @@ _STL_DISABLE_CLANG_WARNINGS
#pragma push_macro("new")
#undef new
_STD_BEGIN
// FUNCTION TEMPLATE accumulate
template <class _InIt, class _Ty, class _Fn>
_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
@ -45,7 +44,6 @@ _NODISCARD _CONSTEXPR20 _Ty accumulate(const _InIt _First, const _InIt _Last, _T
}
#if _HAS_CXX17
// FUNCTION TEMPLATE reduce
#if _STD_VECTORIZE_WITH_FLOAT_CONTROL
template <class _InIt, class _Ty, class _BinOp>
inline constexpr bool _Plus_on_arithmetic_ranges_reduction_v =
@ -124,7 +122,6 @@ _NODISCARD _Iter_value_t<_FwdIt> reduce(_ExPo&& _Exec, const _FwdIt _First, cons
}
#endif // _HAS_CXX17
// FUNCTION TEMPLATE inner_product
template <class _InIt1, class _InIt2, class _Ty, class _BinOp1, class _BinOp2>
_NODISCARD _CONSTEXPR20 _Ty inner_product(
_InIt1 _First1, _InIt1 _Last1, _InIt2 _First2, _Ty _Val, _BinOp1 _Reduce_op, _BinOp2 _Transform_op) {
@ -152,7 +149,6 @@ _NODISCARD _CONSTEXPR20 _Ty inner_product(const _InIt1 _First1, const _InIt1 _La
}
#if _HAS_CXX17
// FUNCTION TEMPLATE transform_reduce
#if _STD_VECTORIZE_WITH_FLOAT_CONTROL
template <class _InIt1, class _InIt2, class _Ty, class _BinOp1, class _BinOp2>
inline constexpr bool _Default_ops_transform_reduce_v =
@ -243,7 +239,6 @@ _NODISCARD _Ty transform_reduce(_ExPo&& _Exec, const _FwdIt _First1, const _FwdI
_UnaryOp _Transform_op) noexcept; // terminates
#endif // _HAS_CXX17
// FUNCTION TEMPLATE partial_sum
template <class _InIt, class _OutIt, class _BinOp>
_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
@ -280,7 +275,6 @@ _CONSTEXPR20 _OutIt partial_sum(_InIt _First, _InIt _Last, _OutIt _Dest) {
}
#if _HAS_CXX17
// FUNCTION TEMPLATE exclusive_scan
template <class _InIt, class _OutIt, class _Ty, class _BinOp>
_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
@ -323,7 +317,6 @@ _FwdIt2 exclusive_scan(_ExPo&& _Exec, const _FwdIt1 _First, const _FwdIt1 _Last,
return _STD exclusive_scan(_STD forward<_ExPo>(_Exec), _First, _Last, _Dest, _STD move(_Val), plus{});
}
// FUNCTION TEMPLATE inclusive_scan
template <class _InIt, class _OutIt, class _Ty, class _BinOp>
_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
@ -387,7 +380,6 @@ _FwdIt2 inclusive_scan(_ExPo&& _Exec, const _FwdIt1 _First, const _FwdIt1 _Last,
return _STD inclusive_scan(_STD forward<_ExPo>(_Exec), _First, _Last, _Dest, plus{});
}
// FUNCTION TEMPLATE transform_exclusive_scan
template <class _InIt, class _OutIt, class _Ty, class _BinOp, class _UnaryOp>
_CONSTEXPR20 _OutIt transform_exclusive_scan(
const _InIt _First, const _InIt _Last, _OutIt _Dest, _Ty _Val, _BinOp _Reduce_op, _UnaryOp _Transform_op) {
@ -419,7 +411,6 @@ template <class _ExPo, class _FwdIt1, class _OutIt, class _Ty, class _BinOp, cla
_OutIt transform_exclusive_scan(_ExPo&& _Exec, const _FwdIt1 _First, const _FwdIt1 _Last, _OutIt _Dest, _Ty _Val,
_BinOp _Reduce_op, _UnaryOp _Transform_op) noexcept; // terminates
// FUNCTION TEMPLATE transform_inclusive_scan
template <class _InIt, class _OutIt, class _Ty, class _BinOp, class _UnaryOp>
_CONSTEXPR20 _OutIt transform_inclusive_scan(
const _InIt _First, const _InIt _Last, _OutIt _Dest, _BinOp _Reduce_op, _UnaryOp _Transform_op, _Ty _Val) {
@ -475,7 +466,6 @@ _FwdIt2 transform_inclusive_scan(_ExPo&& _Exec, const _FwdIt1 _First, const _Fwd
_BinOp _Reduce_op, _UnaryOp _Transform_op) noexcept; // terminates
#endif // _HAS_CXX17
// FUNCTION TEMPLATE adjacent_difference
template <class _InIt, class _OutIt, class _BinOp>
_CONSTEXPR20 _OutIt adjacent_difference(const _InIt _First, const _InIt _Last, _OutIt _Dest, _BinOp _Func) {
// compute adjacent differences into _Dest
@ -522,7 +512,6 @@ _FwdIt2 adjacent_difference(_ExPo&& _Exec, const _FwdIt1 _First, const _FwdIt1 _
}
#endif // _HAS_CXX17
// FUNCTION TEMPLATE iota
template <class _FwdIt, class _Ty>
_CONSTEXPR20 void iota(_FwdIt _First, _FwdIt _Last, _Ty _Val) {
// compute increasing sequence into [_First, _Last)
@ -535,7 +524,6 @@ _CONSTEXPR20 void iota(_FwdIt _First, _FwdIt _Last, _Ty _Val) {
}
#if _HAS_CXX17
// FUNCTION TEMPLATE _Abs_u
template <class _Integral>
_NODISCARD constexpr auto _Abs_u(const _Integral _Val) noexcept {
// computes absolute value of _Val (converting to an unsigned integer type if necessary to avoid overflow
@ -555,7 +543,6 @@ _NODISCARD constexpr auto _Abs_u(const _Integral _Val) noexcept {
}
}
// FUNCTION TEMPLATE gcd
template <class _Mt, class _Nt>
_NODISCARD constexpr common_type_t<_Mt, _Nt> gcd(const _Mt _Mx, const _Nt _Nx) noexcept /* strengthened */ {
// calculate greatest common divisor
@ -592,7 +579,6 @@ _NODISCARD constexpr common_type_t<_Mt, _Nt> gcd(const _Mt _Mx, const _Nt _Nx) n
return static_cast<_Common>(_Mx_magnitude << _Common_factors_of_2);
}
// FUNCTION TEMPLATE lcm
template <class _Mt, class _Nt>
_NODISCARD constexpr common_type_t<_Mt, _Nt> lcm(const _Mt _Mx, const _Nt _Nx) noexcept /* strengthened */ {
// calculate least common multiple
@ -610,7 +596,6 @@ _NODISCARD constexpr common_type_t<_Mt, _Nt> lcm(const _Mt _Mx, const _Nt _Nx) n
#endif // _HAS_CXX17
#if _HAS_CXX20
// FUNCTION TEMPLATE midpoint
template <class _Ty, enable_if_t<is_arithmetic_v<_Ty> && !is_same_v<remove_cv_t<_Ty>, bool>, int> = 0>
_NODISCARD constexpr _Ty midpoint(const _Ty _Val1, const _Ty _Val2) noexcept {
if constexpr (is_floating_point_v<_Ty>) {

Просмотреть файл

@ -30,14 +30,12 @@ _STL_DISABLE_CLANG_WARNINGS
_STD_BEGIN
// STRUCT nullopt_t [optional.nullopt]
struct nullopt_t { // no-value state indicator
struct _Tag {};
constexpr explicit nullopt_t(_Tag) {}
};
inline constexpr nullopt_t nullopt{nullopt_t::_Tag{}};
// CLASS bad_optional_access [optional.bad_optional_access]
class bad_optional_access : public exception {
public:
_NODISCARD const char* __CLR_OR_THIS_CALL what() const noexcept override {
@ -152,7 +150,6 @@ struct _Optional_construct_base : _Optional_destruct_base<_Ty> {
}
};
// CLASS TEMPLATE optional [optional.object]
template <class _Ty>
class optional : private _SMF_control<_Optional_construct_base<_Ty>, _Ty> {
private:
@ -166,7 +163,6 @@ public:
using value_type = _Ty;
// constructors [optional.object.ctor]
constexpr optional() noexcept {}
constexpr optional(nullopt_t) noexcept {}
@ -255,7 +251,6 @@ public:
}
#endif // ^^^ !_HAS_CONDITIONAL_EXPLICIT ^^^
// assignment [optional.object.assign]
optional& operator=(nullopt_t) noexcept {
reset();
return *this;
@ -315,7 +310,6 @@ public:
return this->_Construct(_Ilist, _STD forward<_Types>(_Args)...);
}
// swap [optional.object.swap]
void swap(optional& _Right) noexcept(is_nothrow_move_constructible_v<_Ty>&& is_nothrow_swappable_v<_Ty>) {
static_assert(is_move_constructible_v<_Ty>,
"optional<T>::swap requires T to be move constructible (N4828 [optional.swap]/1).");
@ -339,7 +333,6 @@ public:
}
}
// observers [optional.object.observe]
_NODISCARD constexpr const _Ty* operator->() const {
#if _CONTAINER_DEBUG_LEVEL > 0
_STL_VERIFY(this->_Has_value, "Cannot access value of empty optional");
@ -443,14 +436,12 @@ public:
return static_cast<remove_cv_t<_Ty>>(_STD forward<_Ty2>(_Right));
}
// modifiers [optional.object.mod]
using _Mybase::reset;
};
template <class _Ty>
optional(_Ty) -> optional<_Ty>;
// RELATIONAL OPERATORS [optional.relops]
template <class _Ty1, class _Ty2>
_NODISCARD constexpr bool operator==(const optional<_Ty1>& _Left, const optional<_Ty2>& _Right) {
const bool _Left_has_value = _Left.has_value();
@ -495,7 +486,6 @@ _NODISCARD constexpr compare_three_way_result_t<_Ty1, _Ty2> operator<=>(
}
#endif // __cpp_lib_concepts
// COMPARISONS WITH nullopt [optional.nullops]
template <class _Ty>
_NODISCARD constexpr bool operator==(const optional<_Ty>& _Left, nullopt_t) noexcept {
return !_Left.has_value();
@ -558,7 +548,6 @@ _NODISCARD constexpr bool operator>=(nullopt_t, const optional<_Ty>& _Right) noe
}
#endif // !_HAS_CXX20
// COMPARISONS WITH T [optional.comp_with_t]
template <class _Ty>
using _Enable_if_bool_convertible = enable_if_t<is_convertible_v<_Ty, bool>, int>;
@ -657,13 +646,11 @@ _NODISCARD constexpr compare_three_way_result_t<_Ty1, _Ty2>
}
#endif // __cpp_lib_concepts
// FUNCTION TEMPLATE swap [optional.specalg]
template <class _Ty, enable_if_t<is_move_constructible_v<_Ty> && is_swappable_v<_Ty>, int> = 0>
void swap(optional<_Ty>& _Left, optional<_Ty>& _Right) noexcept(noexcept(_Left.swap(_Right))) {
_Left.swap(_Right);
}
// FUNCTION TEMPLATE make_optional [optional.specalg]
template <class _Ty>
_NODISCARD constexpr optional<decay_t<_Ty>> make_optional(_Ty&& _Value) {
return optional<decay_t<_Ty>>{_STD forward<_Ty>(_Value)};
@ -677,7 +664,6 @@ _NODISCARD constexpr optional<_Ty> make_optional(initializer_list<_Elem> _Ilist,
return optional<_Ty>{in_place, _Ilist, _STD forward<_Types>(_Args)...};
}
// STRUCT TEMPLATE SPECIALIZATION hash [optional.hash]
template <class _Ty>
struct hash<optional<_Ty>>
: _Conditionally_enabled_hash<optional<_Ty>, is_default_constructible_v<hash<remove_const_t<_Ty>>>> {

Просмотреть файл

@ -20,7 +20,6 @@ _STL_DISABLE_CLANG_WARNINGS
_STD_BEGIN
#pragma vtordisp(push, 2) // compiler bug workaround
// CLASS TEMPLATE basic_ostream
template <class _Elem, class _Traits>
class basic_ostream : virtual public basic_ios<_Elem, _Traits> { // control insertions into a stream buffer
public:
@ -647,8 +646,6 @@ template class _CRTIMP2_PURE_IMPORT basic_ostream<unsigned short, char_traits<un
#endif // __FORCE_INSTANCE
#endif // defined(_DLL_CPPLIB)
// INSERTERS
template <class _Elem, class _Traits>
basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Ostr, const char* _Val) { // insert NTBS
ios_base::iostate _State = ios_base::goodbit;
@ -972,7 +969,6 @@ _Ostr&& operator<<(_Ostr&& _Os, const _Ty& _Val) { // insert to rvalue stream
return _STD move(_Os);
}
// MANIPULATORS
template <class _Elem, class _Traits>
basic_ostream<_Elem, _Traits>& __CLRCALL_OR_CDECL endl(
basic_ostream<_Elem, _Traits>& _Ostr) { // insert newline and flush stream
@ -1032,7 +1028,6 @@ basic_ostream<_Elem, _Traits>& flush_emit(basic_ostream<_Elem, _Traits>&) = dele
#endif // _CPPRTTI
#endif // _HAS_CXX20
// INSERTER FOR error_category
template <class _Elem, class _Traits>
basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Ostr,
const error_code& _Errcode) { // display error code

Просмотреть файл

@ -20,7 +20,6 @@ _STL_DISABLE_CLANG_WARNINGS
#undef new
_STD_BEGIN
// CLASS TEMPLATE queue
template <class _Ty, class _Container = deque<_Ty>>
class queue {
public:
@ -173,7 +172,6 @@ void swap(queue<_Ty, _Container>& _Left, queue<_Ty, _Container>& _Right) noexcep
template <class _Ty, class _Container, class _Alloc>
struct uses_allocator<queue<_Ty, _Container>, _Alloc> : uses_allocator<_Container, _Alloc>::type {};
// CLASS TEMPLATE priority_queue
template <class _Ty, class _Container = vector<_Ty>, class _Pr = less<typename _Container::value_type>>
class priority_queue {
public:

Просмотреть файл

@ -27,7 +27,6 @@ _STL_DISABLE_CLANG_WARNINGS
#pragma warning(disable : 4127) // conditional expression is constant
_STD_BEGIN
// TYPE ASSERT MACROS
#define _RNG_PROHIBIT_CHAR(_CheckedType) \
static_assert(!_Is_character<_CheckedType>::value, \
"note: char, signed char, unsigned char, char8_t, int8_t, and uint8_t are not allowed")
@ -50,7 +49,6 @@ _STD_BEGIN
"unsigned short, unsigned int, unsigned long, or unsigned long long"); \
_RNG_PROHIBIT_CHAR(_CheckedType)
// ALIAS TEMPLATE _Enable_if_seed_seq_t
template <class _Seed_seq, class _Self, class _Engine = _Self>
using _Enable_if_seed_seq_t = enable_if_t<
!is_convertible_v<remove_cv_t<_Seed_seq>,
@ -58,18 +56,15 @@ using _Enable_if_seed_seq_t = enable_if_t<
result_type> && !is_same_v<remove_cv_t<_Seed_seq>, _Self> && !is_same_v<remove_cv_t<_Seed_seq>, _Engine>,
int>;
// CONSTANTS
_INLINE_VAR constexpr long double _Pi = 3.14159265358979323846264338327950288L;
_INLINE_VAR constexpr long double _Exp1 = 2.71828182845904523536028747135266250L;
_INLINE_VAR constexpr long double _Two32 = 4294967296.0L;
_INLINE_VAR constexpr long double _Two31 = 2147483648.0L;
// HELPER FUNCTIONS
_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);
// I/O HELPERS FOR FLOATING-POINT VALUES
_INLINE_VAR constexpr int _Nwords = 4;
template <class _Elem, class _Traits>
@ -148,7 +143,6 @@ private:
basic_istream<_Elem, _Traits>& _Str;
};
// CLASS seed_seq
class seed_seq { // standard sequence of seed values
public:
using result_type = unsigned int;
@ -244,7 +238,6 @@ private:
vector<result_type> _Myvec;
};
// FUNCTION TEMPLATE generate_canonical
template <class _Real, size_t _Bits, class _Gen>
_NODISCARD _Real generate_canonical(_Gen& _Gx) { // build a floating-point value from random sequence
_RNG_REQUIRE_REALTYPE(generate_canonical, _Real);
@ -272,7 +265,6 @@ _NODISCARD _Real generate_canonical(_Gen& _Gx) { // build a floating-point value
#define _NRAND(eng, resty) (_STD generate_canonical<resty, static_cast<size_t>(-1)>(eng))
// CLASS TEMPLATE linear_congruential_engine
_INLINE_VAR constexpr int _MP_len = 5;
using _MP_arr = uint64_t[_MP_len];
@ -462,7 +454,6 @@ private:
result_type _Prev;
};
// CLASS TEMPLATE linear_congruential
template <class _Uint, _Uint _Ax, _Uint _Cx, _Uint _Mx>
class linear_congruential { // linear congruential random engine
public:
@ -555,7 +546,6 @@ private:
_Uint _Prev;
};
// CLASS TEMPLATE _Circ_buf FOR subtract_with_carry, subtract_with_carry_01, AND mersenne_twister
template <class _Ty, size_t _Nw>
struct _Circ_buf { // holds historical values for generators
_Ty _At(size_t _Ix) const {
@ -612,7 +602,6 @@ struct _Circ_buf { // holds historical values for generators
_Ty _Ax[2 * _Nw];
};
// CLASS TEMPLATE _Swc_base (subtract_with_carry, subtract_with_carry_01)
template <class _Ty, size_t _Sx, size_t _Rx, class _Swc_Traits>
class _Swc_base : public _Circ_buf<_Ty, _Rx> { // common bits of subtract_with_carry/_01
public:
@ -761,7 +750,6 @@ const size_t _Swc_base<_Ty, _Sx, _Rx, _Swc_Traits>::short_lag;
template <class _Ty, size_t _Sx, size_t _Rx, class _Swc_Traits>
const size_t _Swc_base<_Ty, _Sx, _Rx, _Swc_Traits>::long_lag;
// STRUCT TEMPLATE _Swc_traits
template <class _Ty, _Ty _Mx, size_t _Nw>
struct _Swc_traits { // traits for subtract_with_carry generator
using _Cy_t = int;
@ -838,7 +826,6 @@ struct _Swc_traits { // traits for subtract_with_carry generator
}
};
// CLASS TEMPLATE subtract_with_carry
template <class _Ty, _Ty _Mx, size_t _Sx, size_t _Rx>
class subtract_with_carry
: public _Swc_base<_Ty, _Sx, _Rx, _Swc_traits<_Ty, _Mx, _Rx>> { // subtract_with_carry generator
@ -857,7 +844,6 @@ public:
subtract_with_carry(_Gen& _Gx) : _Mybase(_Gx) {}
};
// CLASS TEMPLATE subtract_with_carry_engine
template <class _Ty, size_t _Wx, size_t _Sx, size_t _Rx>
class subtract_with_carry_engine : public subtract_with_carry<_Ty, (_Ty{1} << (_Wx - 1)) << 1, _Sx, _Rx> {
// subtract_with_carry generator
@ -925,7 +911,6 @@ public:
};
#if _HAS_TR1_NAMESPACE
// STRUCT TEMPLATE _Swc_01_traits
template <class _Ty, size_t _Wx, size_t _Rx>
struct _Swc_01_traits { // traits for subtract_with_carry_01 generator
using _Cy_t = _Ty;
@ -997,7 +982,6 @@ const _Ty _Swc_01_traits<_Ty, _Wx, _Rx>::_Max = 1;
template <class _Ty, size_t _Wx, size_t _Rx>
const _Ty _Swc_01_traits<_Ty, _Wx, _Rx>::_Scale1 = static_cast<_Ty>(_CSTD ldexp(1.0, _Wx % 32));
// CLASS TEMPLATE subtract_with_carry_01
template <class _Ty, size_t _Wx, size_t _Sx, size_t _Rx>
class _DEPRECATE_TR1_NAMESPACE subtract_with_carry_01
: public _Swc_base<_Ty, _Sx, _Rx, _Swc_01_traits<_Ty, _Wx, _Rx>> { // subtract_with_carry_01 generator
@ -1021,7 +1005,6 @@ _STL_RESTORE_DEPRECATED_WARNING
#endif // _HAS_TR1_NAMESPACE
// CLASS TEMPLATE mersenne_twister
template <class _Ty, int _Wx, int _Nx, int _Mx, int _Rx, _Ty _Px, int _Ux, int _Sx, _Ty _Bx, int _Tx, _Ty _Cx, int _Lx>
class mersenne_twister : public _Circ_buf<_Ty, _Nx> { // mersenne twister generator
public:
@ -1201,7 +1184,6 @@ basic_ostream<_Elem, _S_Traits>& operator<<(basic_ostream<_Elem, _S_Traits>& _Os
return _Eng._Write(_Ostr);
}
// CLASS TEMPLATE mersenne_twister_engine
template <class _Ty, size_t _Wx, size_t _Nx, size_t _Mx, size_t _Rx, _Ty _Px, size_t _Ux, _Ty _Dx, size_t _Sx, _Ty _Bx,
size_t _Tx, _Ty _Cx, size_t _Lx, _Ty _Fx>
class mersenne_twister_engine : public mersenne_twister<_Ty, _Wx, _Nx, _Mx, _Rx, _Px, _Ux, _Sx, _Bx, _Tx, _Cx, _Lx> {
@ -1286,7 +1268,6 @@ public:
}
};
// CLASS TEMPLATE discard_block
template <class _Engine, int _Px, int _Rx>
class discard_block { // discard_block compound engine
public:
@ -1400,7 +1381,6 @@ basic_ostream<_Elem, _Traits>& operator<<(
return _Eng._Write(_Ostr);
}
// CLASS TEMPLATE discard_block_engine
template <class _Engine, size_t _Px, size_t _Rx>
class discard_block_engine : public discard_block<_Engine, _Px, _Rx> { // discard_block_engine compound engine
public:
@ -1429,7 +1409,6 @@ public:
}
};
// CLASS TEMPLATE independent_bits_engine
template <class _Engine, size_t _Wx, class _UIntType>
class independent_bits_engine { // independent_bits_engine compound engine
public:
@ -1593,7 +1572,6 @@ basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Ostr,
return _Eng._Write(_Ostr);
}
// CLASS TEMPLATE shuffle_order_engine
template <class _Engine, size_t _Kx>
class shuffle_order_engine { // shuffle_order_engine compound engine
public:
@ -1728,7 +1706,6 @@ basic_ostream<_Elem, _Traits>& operator<<(
return _Eng._Write(_Ostr);
}
// CLASS TEMPLATE uniform_int
template <class _Ty = int>
class uniform_int { // uniform integer distribution
public:
@ -1882,7 +1859,6 @@ basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Ostr,
return _Dist._Write(_Ostr);
}
// CLASS TEMPLATE uniform_int_distribution
template <class _Ty = int>
class uniform_int_distribution : public uniform_int<_Ty> { // uniform integer distribution
public:
@ -1920,7 +1896,6 @@ _NODISCARD bool operator!=(const uniform_int_distribution<_Ty>& _Left, const uni
return !(_Left == _Right);
}
// CLASS bernoulli_distribution
class bernoulli_distribution { // class for bernoulli distribution
public:
using result_type = bool;
@ -2038,7 +2013,6 @@ basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Ostr,
return _Dist._Write(_Ostr);
}
// FUNCTION TEMPLATE _Float_upper_bound
// Returns smallest _Flt such that static_cast<_Ty>(_Result) > _Val.
// First truncate to largest _Flt <= _Val, then add ceil(ulp).
@ -2077,7 +2051,6 @@ _NODISCARD _Flt _Float_upper_bound(_Ty _Val) {
}
}
// CLASS TEMPLATE geometric_distribution
template <class _Ty = int>
class geometric_distribution { // geometric distribution
public:
@ -2211,7 +2184,6 @@ basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Ostr,
return _Dist._Write(_Ostr);
}
// CLASS TEMPLATE poisson_distribution AND HELPER
template <class _Ty = int>
class _Small_poisson_distribution { // poisson distribution with small mean
public:
@ -2394,7 +2366,6 @@ basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Ostr,
return _Dist._Write(_Ostr);
}
// CLASS TEMPLATE binomial_distribution
template <class _Ty = int>
class binomial_distribution { // binomial distribution
public:
@ -2601,7 +2572,6 @@ basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Ostr,
return _Dist._Write(_Ostr);
}
// CLASS TEMPLATE uniform_real
template <class _Ty = double>
class uniform_real { // uniform real distribution
public:
@ -2725,7 +2695,6 @@ basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Ostr,
return _Dist._Write(_Ostr);
}
// CLASS TEMPLATE uniform_real_distribution
template <class _Ty = double>
class uniform_real_distribution : public uniform_real<_Ty> { // uniform real distribution
public:
@ -2762,7 +2731,6 @@ _NODISCARD bool operator!=(const uniform_real_distribution<_Ty>& _Left, const un
return !(_Left == _Right);
}
// CLASS TEMPLATE exponential_distribution
template <class _Ty = double>
class exponential_distribution { // exponential distribution
public:
@ -2884,7 +2852,6 @@ basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Ostr,
return _Dist._Write(_Ostr);
}
// CLASS TEMPLATE normal_distribution
template <class _Ty = double>
class normal_distribution { // normal distribution
public:
@ -3081,7 +3048,6 @@ basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Ostr,
return _Dist._Write(_Ostr);
}
// CLASS TEMPLATE gamma_distribution
template <class _Ty = double>
class gamma_distribution { // gamma distribution
public:
@ -3277,7 +3243,6 @@ basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Ostr,
return _Dist._Write(_Ostr);
}
// CLASS TEMPLATE weibull_distribution
template <class _Ty = double>
class weibull_distribution { // weibull distribution
public:
@ -3414,7 +3379,6 @@ basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Ostr,
return _Dist._Write(_Ostr);
}
// CLASS TEMPLATE extreme_value_distribution
template <class _Ty = double>
class extreme_value_distribution { // extreme value distribution
public:
@ -3552,7 +3516,6 @@ basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Ostr,
return _Dist._Write(_Ostr);
}
// CLASS TEMPLATE lognormal_distribution
template <class _Ty = double>
class lognormal_distribution { // lognormal_distribution
public:
@ -3688,7 +3651,6 @@ basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Ostr,
return _Dist._Write(_Ostr);
}
// CLASS TEMPLATE chi_squared_distribution
template <class _Ty = double>
class chi_squared_distribution { // chi squared distribution
public:
@ -3810,7 +3772,6 @@ basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Ostr,
return _Dist._Write(_Ostr);
}
// CLASS TEMPLATE cauchy_distribution
template <class _Ty = double>
class cauchy_distribution { // Cauchy distribution
public:
@ -3946,7 +3907,6 @@ basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Ostr,
return _Dist._Write(_Ostr);
}
// CLASS TEMPLATE _Beta_distribution
template <class _Ty = double>
class _Beta_distribution { // beta distribution
public:
@ -4006,7 +3966,6 @@ private:
_Ty _Bx;
};
// CLASS TEMPLATE fisher_f_distribution
template <class _Ty = double>
class fisher_f_distribution { // fisher_f distribution
public:
@ -4154,7 +4113,6 @@ basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Ostr,
return _Dist._Write(_Ostr);
}
// CLASS TEMPLATE student_t_distribution
template <class _Ty = double>
class student_t_distribution { // student_t distribution
public:
@ -4291,7 +4249,6 @@ basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Ostr,
return _Dist._Write(_Ostr);
}
// CLASS TEMPLATE negative_binomial_distribution
template <class _Ty = int>
class negative_binomial_distribution { // negative binomial distribution
public:
@ -4437,7 +4394,6 @@ basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Ostr,
return _Dist._Write(_Ostr);
}
// CLASS TEMPLATE discrete_distribution
template <class _Ty = int>
class discrete_distribution { // discrete integer distribution
public:
@ -4634,7 +4590,6 @@ basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Ostr,
return _Dist._Write(_Ostr, _Dist._Par);
}
// CLASS TEMPLATE piecewise_constant_distribution
template <class _Ty = double>
class piecewise_constant_distribution
: public discrete_distribution<size_t> { // piecewise constant floating-point distribution
@ -4827,7 +4782,6 @@ basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Ostr,
return _Dist._Write(_Ostr);
}
// CLASS TEMPLATE piecewise_linear_distribution
template <class _Ty = double>
class piecewise_linear_distribution
: public discrete_distribution<size_t> { // piecewise linear floating-point distribution
@ -5076,7 +5030,6 @@ basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Ostr,
return _Dist._Write(_Ostr);
}
// PREDEFINED GENERATORS
using minstd_rand0 = linear_congruential_engine<unsigned int, 16807, 0, 2147483647>;
using minstd_rand = linear_congruential_engine<unsigned int, 48271, 0, 2147483647>;
@ -5107,7 +5060,6 @@ using knuth_b = shuffle_order_engine<minstd_rand0, 256>;
using default_random_engine = mt19937;
// CLASS random_device
_CRTIMP2_PURE unsigned int __CLRCALL_PURE_OR_CDECL _Random_device();

Просмотреть файл

@ -30,7 +30,6 @@ namespace ranges {
// MUCH machinery defined in <xutility>
// clang-format off
// CONCEPT ranges::viewable_range
template <class _Rng>
concept viewable_range = range<_Rng>
&& ((view<remove_cvref_t<_Rng>> && constructible_from<remove_cvref_t<_Rng>, _Rng>)
@ -263,7 +262,6 @@ namespace ranges {
template <bool _Enable, class _Rng, class _Derived>
using _Cached_position_t = conditional_t<_Enable, _Cached_position<_Rng, _Derived>, view_interface<_Derived>>;
// CLASS TEMPLATE ranges::_Copyable_box
template <_Copy_constructible_object _Ty>
class _Copyable_box { // a simplified optional that augments copy_constructible types with full copyability
public:
@ -474,7 +472,6 @@ namespace ranges {
/* [[no_unique_address]] */ _Ty _Val = _Ty();
};
// CLASS TEMPLATE ranges::_Defaultabox
template <movable _Ty>
class _Defaultabox { // a simplified optional that augments movable types with default-constructibility
public:
@ -657,7 +654,6 @@ namespace ranges {
/* [[no_unique_address]] */ _Ty _Value{};
};
// CLASS TEMPLATE ranges::empty_view
// clang-format off
template <class _Ty>
requires is_object_v<_Ty>
@ -686,12 +682,10 @@ namespace ranges {
};
namespace views {
// VARIABLE TEMPLATE views::empty
template <class _Ty>
inline constexpr empty_view<_Ty> empty;
} // namespace views
// CLASS TEMPLATE ranges::single_view
// clang-format off
template <copy_constructible _Ty>
requires is_object_v<_Ty>
@ -745,7 +739,6 @@ namespace ranges {
};
namespace views {
// VARIABLE views::single
struct _Single_fn {
// clang-format off
template <class _Ty>
@ -761,7 +754,6 @@ namespace ranges {
inline constexpr _Single_fn single;
} // namespace views
// CLASS TEMPLATE ranges::iota_view
template <class _Ty>
using _Iota_diff_t = conditional_t<is_integral_v<_Ty>, conditional_t<(sizeof(_Ty) < sizeof(int)), int, long long>,
iter_difference_t<_Ty>>;
@ -1072,7 +1064,6 @@ namespace ranges {
inline constexpr bool enable_borrowed_range<iota_view<_Wi, _Bo>> = true;
namespace views {
// VARIABLE views::iota
struct _Iota_fn {
template <class _Ty>
_NODISCARD constexpr auto operator()(_Ty&& _Val) const
@ -1092,7 +1083,6 @@ namespace ranges {
inline constexpr _Iota_fn iota;
} // namespace views
// CLASS TEMPLATE ranges::istream_view
template <class _Ty, class _Elem, class _Traits>
concept _Stream_extractable = requires(basic_istream<_Elem, _Traits>& __is, _Ty& __t) {
__is >> __t;
@ -1175,7 +1165,6 @@ namespace ranges {
return basic_istream_view<_Ty, _Elem, _Traits>{_Stream};
}
// CLASS TEMPLATE ranges::ref_view
// clang-format off
template <range _Rng>
requires is_object_v<_Rng>
@ -1233,7 +1222,6 @@ namespace ranges {
inline constexpr bool enable_borrowed_range<ref_view<_Rng>> = true;
namespace views {
// VARIABLE views::all
template <class _Rng>
concept _Can_ref_view = requires(_Rng&& __r) {
ref_view{static_cast<_Rng&&>(__r)};
@ -1288,12 +1276,10 @@ namespace ranges {
inline constexpr _All_fn all;
// ALIAS TEMPLATE views::all_t
template <viewable_range _Rng>
using all_t = decltype(all(_STD declval<_Rng>()));
} // namespace views
// CLASS TEMPLATE ranges::filter_view
// clang-format off
template <input_range _Vw, indirect_unary_predicate<iterator_t<_Vw>> _Pr>
requires view<_Vw> && is_object_v<_Pr>
@ -1524,7 +1510,6 @@ namespace ranges {
filter_view(_Rng&&, _Pr) -> filter_view<views::all_t<_Rng>, _Pr>;
namespace views {
// VARIABLE views::filter
class _Filter_fn {
private:
template <class _Pr>
@ -1566,7 +1551,6 @@ namespace ranges {
inline constexpr _Filter_fn filter;
} // namespace views
// CLASS TEMPLATE ranges::transform_view
// clang-format off
template <class _Rng, class _Fn> // TRANSITION, LLVM-47414
concept _Can_const_transform = range<const _Rng> && regular_invocable<const _Fn&, range_reference_t<const _Rng>>;
@ -2012,7 +1996,6 @@ namespace ranges {
transform_view(_Rng&&, _Fn) -> transform_view<views::all_t<_Rng>, _Fn>;
namespace views {
// VARIABLE views::transform
class _Transform_fn {
private:
template <class _Fn>
@ -2054,7 +2037,6 @@ namespace ranges {
inline constexpr _Transform_fn transform;
} // namespace views
// CLASS TEMPLATE ranges::take_view
template <view _Vw>
class take_view : public view_interface<take_view<_Vw>> {
private:
@ -2221,7 +2203,6 @@ namespace ranges {
inline constexpr bool enable_borrowed_range<take_view<_Rng>> = enable_borrowed_range<_Rng>;
namespace views {
// VARIABLE views::take
template <class>
inline constexpr bool _Is_subrange = false;
template <class _It, class _Se, subrange_kind _Ki>
@ -2356,7 +2337,6 @@ namespace ranges {
inline constexpr _Take_fn take;
} // namespace views
// CLASS TEMPLATE ranges::take_while_view
// clang-format off
template <view _Vw, class _Pr>
requires input_range<_Vw> && is_object_v<_Pr> && indirect_unary_predicate<const _Pr, iterator_t<_Vw>>
@ -2504,7 +2484,6 @@ namespace ranges {
take_while_view(_Rng&&, _Pr) -> take_while_view<views::all_t<_Rng>, _Pr>;
namespace views {
// VARIABLE views::take_while
class _Take_while_fn {
private:
template <class _Pr>
@ -2543,7 +2522,6 @@ namespace ranges {
inline constexpr _Take_while_fn take_while;
} // namespace views
// CLASS TEMPLATE ranges::drop_view
template <view _Vw>
class drop_view : public _Cached_position_t<forward_range<_Vw> && !(random_access_range<_Vw> && sized_range<_Vw>),
_Vw, drop_view<_Vw>> {
@ -2666,7 +2644,6 @@ namespace ranges {
inline constexpr bool enable_borrowed_range<drop_view<_Rng>> = enable_borrowed_range<_Rng>;
namespace views {
// VARIABLE views::drop
class _Drop_fn {
private:
enum class _St { _Empty, _Reconstruct_span, _Reconstruct_subrange, _Reconstruct_other, _Drop_view };
@ -2792,7 +2769,6 @@ namespace ranges {
inline constexpr _Drop_fn drop;
} // namespace views
// CLASS TEMPLATE ranges::drop_while_view
// clang-format off
template <view _Vw, class _Pr>
requires input_range<_Vw> && is_object_v<_Pr> && indirect_unary_predicate<const _Pr, iterator_t<_Vw>>
@ -2857,7 +2833,6 @@ namespace ranges {
inline constexpr bool enable_borrowed_range<drop_while_view<_Rng, _Pr>> = enable_borrowed_range<_Rng>;
namespace views {
// VARIABLE views::drop_while
class _Drop_while_fn {
private:
template <class _Pr>
@ -2896,7 +2871,6 @@ namespace ranges {
inline constexpr _Drop_while_fn drop_while;
} // namespace views
// CLASS TEMPLATE ranges::join_view
// clang-format off
template <input_range _Vw>
requires (view<_Vw> && input_range<range_reference_t<_Vw>>
@ -3255,7 +3229,6 @@ namespace ranges {
explicit join_view(_Rng&&) -> join_view<views::all_t<_Rng>>;
namespace views {
// VARIABLE views::join
class _Join_fn : public _Pipe::_Base<_Join_fn> {
public:
// clang-format off
@ -3272,7 +3245,6 @@ namespace ranges {
inline constexpr _Join_fn join;
} // namespace views
// CLASS TEMPLATE ranges::split_view
// clang-format off
template <class _Ty>
concept _Tiny_range = sized_range<_Ty>
@ -3649,7 +3621,6 @@ namespace ranges {
split_view(_Rng&&, range_value_t<_Rng>) -> split_view<views::all_t<_Rng>, single_view<range_value_t<_Rng>>>;
namespace views {
// VARIABLE views::split
class _Split_fn {
private:
template <class _Delim>
@ -3694,7 +3665,6 @@ namespace ranges {
inline constexpr _Split_fn split;
// VARIABLE views::counted
class _Counted_fn {
private:
enum class _St { _Span, _Subrange, _Subrange_counted };
@ -3740,7 +3710,6 @@ namespace ranges {
inline constexpr _Counted_fn counted;
} // namespace views
// CLASS TEMPLATE ranges::common_view
// clang-format off
template <view _Vw>
requires (!common_range<_Vw> && copyable<iterator_t<_Vw>>)
@ -3817,7 +3786,6 @@ namespace ranges {
inline constexpr bool enable_borrowed_range<common_view<_Rng>> = enable_borrowed_range<_Rng>;
namespace views {
// VARIABLE views::common
class _Common_fn : public _Pipe::_Base<_Common_fn> {
private:
enum class _St { _None, _All, _Common };
@ -3857,7 +3825,6 @@ namespace ranges {
inline constexpr _Common_fn common;
} // namespace views
// CLASS TEMPLATE ranges::reverse_view
// clang-format off
template <view _Vw>
requires bidirectional_range<_Vw>
@ -3935,7 +3902,6 @@ namespace ranges {
inline constexpr bool enable_borrowed_range<reverse_view<_Rng>> = enable_borrowed_range<_Rng>;
namespace views {
// VARIABLE views::reverse
template <class _Rng>
concept _Can_extract_base = requires(_Rng&& __r) {
static_cast<_Rng&&>(__r).base();
@ -4010,7 +3976,6 @@ namespace ranges {
inline constexpr _Reverse_fn reverse;
} // namespace views
// CLASS TEMPLATE ranges::elements_view
template <class _Tuple, size_t _Index>
concept _Has_tuple_element = requires(_Tuple __t) {
typename tuple_size<_Tuple>::type;
@ -4396,7 +4361,6 @@ namespace ranges {
using values_view = elements_view<views::all_t<_Rng>, 1>;
namespace views {
// VARIABLE views::elements
template <size_t _Index>
class _Elements_fn : public _Pipe::_Base<_Elements_fn<_Index>> {
public:

Просмотреть файл

@ -19,11 +19,9 @@ _STL_DISABLE_CLANG_WARNINGS
#undef new
_STD_BEGIN
// STRUCT TEMPLATE _Abs
template <intmax_t _Val>
struct _Abs : integral_constant<intmax_t, (_Val < 0 ? -_Val : _Val)> {}; // computes absolute value of _Val
// STRUCT TEMPLATE _Safe_mult
template <intmax_t _Ax, intmax_t _Bx, bool _Sfinae = false,
bool _Good = (_Abs<_Ax>::value <= INTMAX_MAX / (_Bx == 0 ? 1 : _Abs<_Bx>::value))>
struct _Safe_mult : integral_constant<intmax_t, _Ax * _Bx> {}; // computes _Ax * _Bx without overflow
@ -33,11 +31,9 @@ struct _Safe_mult<_Ax, _Bx, _Sfinae, false> { // _Ax * _Bx would overflow
static_assert(_Sfinae, "integer arithmetic overflow");
};
// STRUCT TEMPLATE _Sign_of
template <intmax_t _Val>
struct _Sign_of : integral_constant<intmax_t, (_Val < 0 ? -1 : 1)> {}; // computes sign of _Val
// STRUCT TEMPLATE _Safe_add
template <intmax_t _Ax, intmax_t _Bx, bool _Good, bool _Also_good>
struct _Safe_addX : integral_constant<intmax_t, _Ax + _Bx> {}; // computes _Ax + _Bx without overflow
@ -52,7 +48,6 @@ struct _Safe_add : _Safe_addX<_Ax, _Bx, _Sign_of<_Ax>::value != _Sign_of<_Bx>::v
// computes _Ax + _Bx, forbids overflow
};
// STRUCT TEMPLATE _Gcd
template <intmax_t _Ax, intmax_t _Bx>
struct _GcdX : _GcdX<_Bx, _Ax % _Bx>::type {}; // computes GCD of _Ax and _Bx
@ -67,7 +62,6 @@ struct _Gcd<0, 0> : integral_constant<intmax_t, 1> {
// contrary to mathematical convention; avoids division by 0 in ratio_less
};
// STRUCT TEMPLATE ratio
template <intmax_t _Nx, intmax_t _Dx = 1>
struct ratio { // holds the ratio of _Nx to _Dx
static_assert(_Dx != 0, "zero denominator");
@ -82,14 +76,12 @@ struct ratio { // holds the ratio of _Nx to _Dx
using type = ratio<num, den>;
};
// VARIABLE TEMPLATE _Is_ratio_v
template <class _Ty>
_INLINE_VAR constexpr bool _Is_ratio_v = false; // test for ratio type
template <intmax_t _Rx1, intmax_t _Rx2>
_INLINE_VAR constexpr bool _Is_ratio_v<ratio<_Rx1, _Rx2>> = true;
// ALIAS TEMPLATE ratio_add
template <class _Rx1, class _Rx2>
struct _Ratio_add { // add two ratios
static_assert(_Is_ratio_v<_Rx1> && _Is_ratio_v<_Rx2>, "ratio_add<R1, R2> requires R1 and R2 to be ratio<>s.");
@ -110,7 +102,6 @@ struct _Ratio_add { // add two ratios
template <class _Rx1, class _Rx2>
using ratio_add = typename _Ratio_add<_Rx1, _Rx2>::type;
// ALIAS TEMPLATE ratio_subtract
template <class _Rx1, class _Rx2>
struct _Ratio_subtract { // subtract two ratios
static_assert(_Is_ratio_v<_Rx1> && _Is_ratio_v<_Rx2>, "ratio_subtract<R1, R2> requires R1 and R2 to be ratio<>s.");
@ -124,7 +115,6 @@ struct _Ratio_subtract { // subtract two ratios
template <class _Rx1, class _Rx2>
using ratio_subtract = typename _Ratio_subtract<_Rx1, _Rx2>::type;
// ALIAS TEMPLATE ratio_multiply
template <class _Rx1, class _Rx2>
struct _Ratio_multiply { // multiply two ratios
static_assert(_Is_ratio_v<_Rx1> && _Is_ratio_v<_Rx2>, "ratio_multiply<R1, R2> requires R1 and R2 to be ratio<>s.");
@ -156,7 +146,6 @@ struct _Ratio_multiply_sfinae<_Rx1, _Rx2, _Sfinae,
template <class _Rx1, class _Rx2>
using ratio_multiply = typename _Ratio_multiply_sfinae<_Rx1, _Rx2, false>::type;
// ALIAS TEMPLATE ratio_divide
template <class _Rx1, class _Rx2>
struct _Ratio_divide { // divide two ratios
static_assert(_Is_ratio_v<_Rx1> && _Is_ratio_v<_Rx2>, "ratio_divide<R1, R2> requires R1 and R2 to be ratio<>s.");
@ -174,7 +163,6 @@ using _Ratio_divide_sfinae =
template <class _Rx1, class _Rx2>
using ratio_divide = _Ratio_divide_sfinae<_Rx1, _Rx2, false>;
// STRUCT TEMPLATE ratio_equal
template <class _Rx1, class _Rx2>
struct ratio_equal : bool_constant<_Rx1::num == _Rx2::num && _Rx1::den == _Rx2::den> { // tests if ratio == ratio
static_assert(_Is_ratio_v<_Rx1> && _Is_ratio_v<_Rx2>, "ratio_equal<R1, R2> requires R1 and R2 to be ratio<>s.");
@ -183,7 +171,6 @@ struct ratio_equal : bool_constant<_Rx1::num == _Rx2::num && _Rx1::den == _Rx2::
template <class _Rx1, class _Rx2>
_INLINE_VAR constexpr bool ratio_equal_v = ratio_equal<_Rx1, _Rx2>::value;
// STRUCT TEMPLATE ratio_not_equal
template <class _Rx1, class _Rx2>
struct ratio_not_equal : bool_constant<!ratio_equal_v<_Rx1, _Rx2>> { // tests if ratio != ratio
static_assert(_Is_ratio_v<_Rx1> && _Is_ratio_v<_Rx2>, "ratio_not_equal<R1, R2> requires R1 and R2 to be ratio<>s.");
@ -192,7 +179,6 @@ struct ratio_not_equal : bool_constant<!ratio_equal_v<_Rx1, _Rx2>> { // tests if
template <class _Rx1, class _Rx2>
_INLINE_VAR constexpr bool ratio_not_equal_v = ratio_not_equal<_Rx1, _Rx2>::value;
// STRUCT TEMPLATE ratio_less
struct _Big_uint128 {
uint64_t _Upper;
uint64_t _Lower;
@ -249,7 +235,6 @@ struct ratio_less : bool_constant<_Ratio_less(_Rx1::num, _Rx1::den, _Rx2::num, _
template <class _Rx1, class _Rx2>
_INLINE_VAR constexpr bool ratio_less_v = ratio_less<_Rx1, _Rx2>::value;
// STRUCT TEMPLATE ratio_less_equal
template <class _Rx1, class _Rx2>
struct ratio_less_equal : bool_constant<!ratio_less_v<_Rx2, _Rx1>> { // tests if ratio <= ratio
static_assert(
@ -259,7 +244,6 @@ struct ratio_less_equal : bool_constant<!ratio_less_v<_Rx2, _Rx1>> { // tests if
template <class _Rx1, class _Rx2>
_INLINE_VAR constexpr bool ratio_less_equal_v = ratio_less_equal<_Rx1, _Rx2>::value;
// STRUCT TEMPLATE ratio_greater
template <class _Rx1, class _Rx2>
struct ratio_greater : ratio_less<_Rx2, _Rx1>::type { // tests if ratio > ratio
static_assert(_Is_ratio_v<_Rx1> && _Is_ratio_v<_Rx2>, "ratio_greater<R1, R2> requires R1 and R2 to be ratio<>s.");
@ -268,7 +252,6 @@ struct ratio_greater : ratio_less<_Rx2, _Rx1>::type { // tests if ratio > ratio
template <class _Rx1, class _Rx2>
_INLINE_VAR constexpr bool ratio_greater_v = ratio_greater<_Rx1, _Rx2>::value;
// STRUCT TEMPLATE ratio_greater_equal
template <class _Rx1, class _Rx2>
struct ratio_greater_equal : bool_constant<!ratio_less_v<_Rx1, _Rx2>> { // tests if ratio >= ratio
static_assert(
@ -278,7 +261,6 @@ struct ratio_greater_equal : bool_constant<!ratio_less_v<_Rx1, _Rx2>> { // tests
template <class _Rx1, class _Rx2>
_INLINE_VAR constexpr bool ratio_greater_equal_v = ratio_greater_equal<_Rx1, _Rx2>::value;
// SI TYPEDEFS
using atto = ratio<1, 1000000000000000000LL>;
using femto = ratio<1, 1000000000000000LL>;
using pico = ratio<1, 1000000000000LL>;

Просмотреть файл

@ -58,7 +58,6 @@ _STL_DISABLE_CLANG_WARNINGS
_STD_BEGIN
// NAMED CONSTANTS
enum _Meta_type { // meta character representations for parser
_Meta_lpar = '(',
_Meta_rpar = ')',
@ -100,7 +99,6 @@ enum _Meta_type { // meta character representations for parser
_Esc_uni = 'u'
};
// NAMESPACE regex_constants
namespace regex_constants {
// constants used in regular expressions
enum syntax_option_type : int { // specify RE syntax rules
@ -161,7 +159,6 @@ namespace regex_constants {
[[noreturn]] _CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL _Xregex_error(regex_constants::error_type _Code);
// CLASS TEMPLATE regex_traits
template <class _Elem>
class regex_traits;
@ -389,7 +386,6 @@ private:
locale_type _Loc;
};
// CLASS regex_traits<char>
template <>
class regex_traits<char> : public _Regex_traits<char> {
public:
@ -414,7 +410,6 @@ public:
}
};
// CLASS regex_traits<wchar_t>
template <>
class regex_traits<wchar_t> : public _Regex_traits<wchar_t> {
public:
@ -439,7 +434,6 @@ public:
}
};
// CLASS regex_error
class regex_error : public runtime_error { // type of all regular expression exceptions
public:
explicit regex_error(regex_constants::error_type _Ex) : runtime_error(_Stringify(_Ex)), _Err(_Ex) {}
@ -507,7 +501,6 @@ private:
regex_constants::error_type _Err;
};
// FUNCTION TEMPLATE _Iter_compare
template <class _Traits, class _FwdIt1, class _FwdIt2>
int _Iter_compare3(_FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _First2, _FwdIt2 _Last2, true_type) {
// _Iter_compare for memory buffer ranges
@ -562,7 +555,6 @@ int _Iter_compare(_FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _First2, _FwdIt2 _Las
_Get_unwrapped(_First1), _Get_unwrapped(_Last1), _Get_unwrapped(_First2), _Get_unwrapped(_Last2));
}
// FUNCTION TEMPLATE _Is_word
inline bool _Is_word(unsigned char _UCh) {
// special casing char to avoid branches for std::regex in this path
static constexpr bool _Is_word_table[(numeric_limits<unsigned char>::max) () + 1] = {
@ -605,7 +597,6 @@ struct _Get_member_comparison_category<_Ty, void_t<typename _Ty::comparison_cate
};
#endif // _HAS_CXX20
// CLASS TEMPLATE sub_match
template <class _BidIt>
class sub_match : public pair<_BidIt, _BidIt> { // class to hold contents of a capture group
public:
@ -757,7 +748,6 @@ _NODISCARD bool operator>=(const sub_match<_BidIt>& _Left, const sub_match<_BidI
}
#endif // !_HAS_CXX20
// COMPARE sub_match AND NTBS
template <class _BidIt>
_NODISCARD bool operator==(const sub_match<_BidIt>& _Left, const _Iter_value_t<_BidIt>* _Right) {
return _Left._Match_equal(_Right);
@ -825,7 +815,6 @@ _NODISCARD bool operator>=(const sub_match<_BidIt>& _Left, const _Iter_value_t<_
}
#endif // !_HAS_CXX20
// COMPARE sub_match AND ELEMENT
template <class _BidIt>
_NODISCARD bool operator==(const sub_match<_BidIt>& _Left, const _Iter_value_t<_BidIt>& _Right) {
return _Left._Match_equal(_STD addressof(_Right), 1);
@ -894,7 +883,6 @@ _NODISCARD bool operator>=(const sub_match<_BidIt>& _Left, const _Iter_value_t<_
}
#endif // !_HAS_CXX20
// COMPARE sub_match AND string
template <class _BidIt, class _Traits, class _Alloc>
_NODISCARD bool operator==(
const sub_match<_BidIt>& _Left, const basic_string<_Iter_value_t<_BidIt>, _Traits, _Alloc>& _Right) {
@ -975,13 +963,11 @@ _NODISCARD bool operator>=(
}
#endif // !_HAS_CXX20
// INSERT sub_match IN STREAM
template <class _Elem, class _Traits, class _BidIt>
basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Ostr, const sub_match<_BidIt>& _Match) {
return _Ostr << _Match.str();
}
// FORWARD DECLARATIONS
template <class _BidIt, class _Alloc = allocator<sub_match<_BidIt>>>
class match_results;
@ -993,7 +979,6 @@ template <class _BidIt, class _Alloc, class _InIt, class _OutIt>
_OutIt _Format_sed(const match_results<_BidIt, _Alloc>& _Match, _OutIt _Out, _InIt _First, _InIt _Last,
regex_constants::match_flag_type _Flags = regex_constants::format_default);
// CLASS TEMPLATE match_results
template <class _BidIt, class _Alloc>
class match_results { // class to hold contents of all capture groups
public:
@ -1188,7 +1173,6 @@ _NODISCARD bool operator!=(const match_results<_BidIt, _Alloc>& _Left, const mat
}
#endif // !_HAS_CXX20
// NFA PROPERTIES
const unsigned int _BRE_MAX_GRP = 9U;
const unsigned int _Bmp_max = 256U; // must fit in an unsigned int
@ -1235,7 +1219,6 @@ enum _Node_type { // type flag for nfa nodes
_N_end
};
// STRUCT TEMPLATE _Buf
template <class _Elem>
struct _Buf { // character buffer
_Buf() : _Sz(0), _Nchrs(0), _Chrs(nullptr) {}
@ -1295,7 +1278,6 @@ private:
_Elem* _Chrs;
};
// STRUCT _Bitmap
struct _Bitmap { // accelerator table for small character values
_Bitmap() {
_CSTD memset(_Chrs, '\0', _Bmp_size);
@ -1319,7 +1301,6 @@ private:
unsigned char _Chrs[_Bmp_size];
};
// STRUCT TEMPLATE _Sequence
template <class _Elem>
struct _Sequence { // holds sequences of _Sz elements
explicit _Sequence(unsigned int _Len) : _Sz(_Len) {}
@ -1329,7 +1310,6 @@ struct _Sequence { // holds sequences of _Sz elements
_Sequence* _Next;
};
// CLASS _Node_base
class _Node_base { // base class for all nfa nodes
public:
explicit _Node_base(_Node_type _Ty, _Node_flags _Fl = _Fl_none)
@ -1343,7 +1323,6 @@ public:
virtual ~_Node_base() noexcept {}
};
// FUNCTION _Destroy_node
inline void _Destroy_node(_Node_base* _Nx, _Node_base* _Ne = nullptr) noexcept { // destroy sublist of nodes
while (_Nx != _Ne && _Nx) { // destroy node
_Node_base* _Tmp = _Nx;
@ -1353,7 +1332,6 @@ inline void _Destroy_node(_Node_base* _Nx, _Node_base* _Ne = nullptr) noexcept {
}
}
// CLASS _Root_node
class _Root_node : public _Node_base { // root of parse tree
public:
_Root_node() : _Node_base(_N_begin), _Loops(0), _Marks(0), _Refs(0) {
@ -1366,7 +1344,6 @@ public:
unsigned int _Refs;
};
// CLASS _Node_end_group
class _Node_end_group : public _Node_base { // node that marks end of a group
public:
_Node_end_group(_Node_type _Ty, _Node_flags _Fl, _Node_base* _Bx) : _Node_base(_Ty, _Fl), _Back(_Bx) {}
@ -1374,7 +1351,6 @@ public:
_Node_base* _Back;
};
// CLASS _Node_assert
class _Node_assert : public _Node_base { // node that holds an ECMAScript assertion
public:
explicit _Node_assert(_Node_type _Ty, _Node_flags _Fl = _Fl_none) : _Node_base(_Ty, _Fl), _Child(nullptr) {}
@ -1386,7 +1362,6 @@ public:
_Node_base* _Child;
};
// CLASS TEMPLATE _Node_capture
class _Node_capture : public _Node_base { // node that marks beginning of a capture group
public:
explicit _Node_capture(unsigned int _Ix) : _Node_base(_N_capture, _Fl_none), _Idx(_Ix) {}
@ -1394,7 +1369,6 @@ public:
unsigned int _Idx;
};
// CLASS _Node_back
class _Node_back : public _Node_base { // node that holds a back reference
public:
explicit _Node_back(unsigned int _Ix) : _Node_base(_N_back, _Fl_none), _Idx(_Ix) {}
@ -1402,7 +1376,6 @@ public:
unsigned int _Idx;
};
// CLASS TEMPLATE _Node_str
template <class _Elem>
class _Node_str : public _Node_base { // node that holds text
public:
@ -1411,7 +1384,6 @@ public:
_Buf<_Elem> _Data;
};
// CLASS TEMPLATE _Node_class
template <class _Elem, class _RxTraits>
class _Node_class : public _Node_base { // node that holds a character class (POSIX bracket expression)
public:
@ -1443,13 +1415,11 @@ public:
_Sequence<_Elem>* _Equiv;
};
// CLASS _Node_endif
class _Node_endif : public _Node_base { // node that marks the end of an alternative
public:
_Node_endif() : _Node_base(_N_endif, _Fl_none) {}
};
// CLASS _Node_if
class _Node_if : public _Node_base { // node that marks the beginning of an alternative
public:
explicit _Node_if(_Node_base* _End)
@ -1469,7 +1439,6 @@ public:
_Node_if* _Child;
};
// CLASS _Node_end_rep
class _Node_rep;
class _Node_end_rep : public _Node_base { // node that marks the end of a repetition
@ -1481,13 +1450,11 @@ public:
_Node_end_rep& operator=(const _Node_end_rep&) = delete;
};
// CLASS _Loop_vals_t
struct _Loop_vals_t { // storage for loop administration
int _Loop_idx;
void* _Loop_iter;
};
// CLASS _Node_rep
class _Node_rep : public _Node_base { // node that marks the beginning of a repetition
public:
_Node_rep(bool _Greedy, int _Mn, int _Mx, _Node_end_rep* _End, unsigned int _Number)
@ -1503,7 +1470,6 @@ public:
_Node_rep& operator=(const _Node_rep&) = delete;
};
// CLASS TEMPLATE _Builder
template <class _FwdIt, class _Elem, class _RxTraits>
class _Builder { // provides operations used by _Parser to build the nfa
public:
@ -1566,7 +1532,6 @@ public:
_Builder& operator=(const _Builder&) = delete;
};
// CLASS TEMPLATE _Bt_state_t
template <class _BidIt>
class _Bt_state_t { // holds the state needed for backtracking
public:
@ -1574,7 +1539,6 @@ public:
vector<bool> _Grp_valid;
};
// CLASS TEMPLATE _Tgt_state_t
template <class _BidIt>
class _Tgt_state_t : public _Bt_state_t<_BidIt> { // holds the current state of the match
public:
@ -1590,7 +1554,6 @@ public:
}
};
// CLASS TEMPLATE _Matcher
template <class _BidIt, class _Elem, class _RxTraits, class _It>
class _Matcher { // provides ways to match a regular expression to a text sequence
public:
@ -1711,7 +1674,6 @@ enum _Prs_ret { // indicate class element type
_Prs_set
};
// CLASS TEMPLATE _Parser
template <class _FwdIt, class _Elem, class _RxTraits>
class _Parser { // parse a regular expression
public:
@ -1807,7 +1769,6 @@ enum _Lang_flags { // describe language properties
_L_mtch_long = 0x40000000, // find longest match (ERE, BRE)
};
// CLASS _Regex_base
class _Regex_base : public _Container_base { // base class for basic_regex to construct and destroy proxy
public:
#if 0 < _ITERATOR_DEBUG_LEVEL
@ -1824,7 +1785,6 @@ public:
#endif // 0 < _ITERATOR_DEBUG_LEVEL
};
// CLASS TEMPLATE basic_regex
template <class _Elem, class _RxTraits = regex_traits<_Elem>>
class basic_regex : public _Regex_base { // regular expression
public:
@ -2095,7 +2055,6 @@ using wcmatch = match_results<const wchar_t*>;
using smatch = match_results<string::const_iterator>;
using wsmatch = match_results<wstring::const_iterator>;
// FUNCTION TEMPLATE _Format_default
template <class _BidIt, class _Alloc, class _InIt, class _OutIt>
_OutIt _Format_default(const match_results<_BidIt, _Alloc>& _Match, _OutIt _Out, _InIt _First, _InIt _Last,
regex_constants::match_flag_type) { // format with ECMAScript rules
@ -2142,7 +2101,6 @@ _OutIt _Format_default(const match_results<_BidIt, _Alloc>& _Match, _OutIt _Out,
return _Out;
}
// FUNCTION TEMPLATE _Format_sed
template <class _BidIt, class _Alloc, class _InIt, class _OutIt>
_OutIt _Format_sed(const match_results<_BidIt, _Alloc>& _Match, _OutIt _Out, _InIt _First, _InIt _Last,
regex_constants::match_flag_type) { // format with sed rules
@ -2169,7 +2127,6 @@ _OutIt _Format_sed(const match_results<_BidIt, _Alloc>& _Match, _OutIt _Out, _In
return _Out;
}
// FUNCTION TEMPLATE _Regex_match1
template <class _BidIt, class _Alloc, class _Elem, class _RxTraits, class _It>
bool _Regex_match1(_It _First, _It _Last, match_results<_BidIt, _Alloc>* _Matches,
const basic_regex<_Elem, _RxTraits>& _Re, regex_constants::match_flag_type _Flgs,
@ -2183,7 +2140,6 @@ bool _Regex_match1(_It _First, _It _Last, match_results<_BidIt, _Alloc>* _Matche
return _Mx._Match(_Matches, _Full);
}
// FUNCTION TEMPLATE regex_match
template <class _BidIt, class _Alloc, class _Elem, class _RxTraits>
bool regex_match(_BidIt _First, _BidIt _Last, match_results<_BidIt, _Alloc>& _Matches,
const basic_regex<_Elem, _RxTraits>& _Re, regex_constants::match_flag_type _Flgs = regex_constants::match_default) {
@ -2240,7 +2196,6 @@ _NODISCARD bool regex_match(const basic_string<_Elem, _StTraits, _StAlloc>& _Str
_Re, _Flgs | regex_constants::match_any, true);
}
// FUNCTION TEMPLATE _Regex_search2
template <class _BidIt, class _Alloc, class _Elem, class _RxTraits, class _It>
bool _Regex_search2(_It _First, _It _Last, match_results<_BidIt, _Alloc>* _Matches,
const basic_regex<_Elem, _RxTraits>& _Re, regex_constants::match_flag_type _Flgs, _It _Org) {
@ -2283,7 +2238,6 @@ bool _Regex_search2(_It _First, _It _Last, match_results<_BidIt, _Alloc>* _Match
return _Found;
}
// FUNCTION TEMPLATE regex_search
template <class _BidIt, class _Alloc, class _Elem, class _RxTraits>
bool regex_search(_BidIt _First, _BidIt _Last, match_results<_BidIt, _Alloc>& _Matches,
const basic_regex<_Elem, _RxTraits>& _Re, regex_constants::match_flag_type _Flgs = regex_constants::match_default) {
@ -2344,7 +2298,6 @@ _NODISCARD bool regex_search(const basic_string<_Elem, _StTraits, _StAlloc>& _St
_First, _Last, static_cast<match_results<_Iter>*>(nullptr), _Re, _Flgs | regex_constants::match_any, _First);
}
// FUNCTION TEMPLATE regex_replace
template <class _OutIt, class _BidIt, class _RxTraits, class _Elem, class _Traits, class _Alloc>
_OutIt _Regex_replace1(_OutIt _Result, _BidIt _First, _BidIt _Last, const basic_regex<_Elem, _RxTraits>& _Re,
const basic_string<_Elem, _Traits, _Alloc>& _Fmt, regex_constants::match_flag_type _Flgs) {
@ -2439,7 +2392,6 @@ _NODISCARD basic_string<_Elem> regex_replace(const _Elem* _Pstr, const basic_reg
return _Res;
}
// CLASS TEMPLATE regex_iterator
template <class _BidIt, class _Elem = _Iter_value_t<_BidIt>, class _RxTraits = regex_traits<_Elem>>
class regex_iterator : public _Iterator_base {
public:
@ -2569,7 +2521,6 @@ using wcregex_iterator = regex_iterator<const wchar_t*>;
using sregex_iterator = regex_iterator<string::const_iterator>;
using wsregex_iterator = regex_iterator<wstring::const_iterator>;
// CLASS TEMPLATE regex_token_iterator
template <class _BidIt, class _Elem = _Iter_value_t<_BidIt>, class _RxTraits = regex_traits<_Elem>>
class regex_token_iterator {
public:
@ -2754,7 +2705,6 @@ using wcregex_token_iterator = regex_token_iterator<const wchar_t*>;
using sregex_token_iterator = regex_token_iterator<string::const_iterator>;
using wsregex_token_iterator = regex_token_iterator<wstring::const_iterator>;
// IMPLEMENTATION OF _Builder
template <class _FwdIt, class _Elem, class _RxTraits>
_Builder<_FwdIt, _Elem, _RxTraits>::_Builder(const _RxTraits& _Tr, regex_constants::syntax_option_type _Fx)
: _Root(new _Root_node), _Current(_Root), _Flags(_Fx), _Traits(_Tr),
@ -3163,7 +3113,6 @@ void _Builder<_FwdIt, _Elem, _RxTraits>::_Tidy() noexcept { // free memory
_Root = nullptr;
}
// IMPLEMENTATION OF _Matcher
template <class _BidIt, class _Elem, class _RxTraits, class _It>
bool _Matcher<_BidIt, _Elem, _RxTraits, _It>::_Do_if(_Node_if* _Node) { // apply if node
_Tgt_state_t<_It> _St = _Tgt_state;
@ -3835,7 +3784,6 @@ _BidIt _Matcher<_BidIt, _Elem, _RxTraits, _It>::_Skip(_BidIt _First_arg, _BidIt
return _First_arg;
}
// IMPLEMENTATION OF _Parser
template <class _FwdIt, class _Elem, class _RxTraits>
void _Parser<_FwdIt, _Elem, _RxTraits>::_Error(regex_constants::error_type _Code) { // handle error
_Xregex_error(_Code);
@ -4584,7 +4532,6 @@ _Parser<_FwdIt, _Elem, _RxTraits>::_Parser(
: _Pat(_Pfirst), _Begin(_Pfirst), _End(_Plast), _Grp_idx(0), _Disj_count(0), _Finished_grps(0), _Nfa(_Tr, _Fx),
_Traits(_Tr), _Flags(_Fx) {
// PARSER LANGUAGE FLAGS
constexpr unsigned int _ECMA_flags = _L_ext_rep | _L_alt_pipe | _L_nex_grp | _L_nex_rep | _L_nc_grp | _L_asrt_gen
| _L_asrt_wrd | _L_bckr | _L_ngr_rep | _L_esc_uni | _L_esc_hex | _L_esc_bsl
| _L_esc_ffn | _L_esc_wsd | _L_esc_ctrl | _L_bzr_chr | _L_grp_esc | _L_ident_ECMA

Просмотреть файл

@ -18,7 +18,6 @@ _STL_DISABLE_CLANG_WARNINGS
#undef new
_STD_BEGIN
// FUNCTION TEMPLATE _Scoped_outermost
template <class _Alloc, class = void>
struct _Scoped_outermost_helper { // gets the outermost allocator
static decltype(auto) _Fn(_Alloc& _Al) { // gets the outermost allocator
@ -41,15 +40,12 @@ decltype(auto) _Scoped_outermost(_Alloc& _Al) { // gets the outermost allocator
return _Scoped_outermost_helper<_Alloc>::_Fn(_Al);
}
// ALIAS TEMPLATE _Scoped_outermost_t
template <class _Alloc>
using _Scoped_outermost_t = remove_reference_t<decltype(_Scoped_outermost(_STD declval<_Alloc&>()))>;
// ALIAS TEMPLATE _Scoped_outermost_traits
template <class _Alloc>
using _Scoped_outermost_traits = allocator_traits<_Scoped_outermost_t<_Alloc>>;
// CLASS TEMPLATE _Scoped_base
template <class _Outer, class... _Inner>
class scoped_allocator_adaptor;
@ -125,7 +121,6 @@ struct _Scoped_base<_Outer> : _Outer { // nest of allocators, one deep
}
};
// CLASS TEMPLATE scoped_allocator_adaptor
template <class _Outer, class... _Inner>
class scoped_allocator_adaptor : public _Scoped_base<_Outer, _Inner...> { // nest of allocators
using _Mybase = _Scoped_base<_Outer, _Inner...>;

Просмотреть файл

@ -21,7 +21,6 @@ _STL_DISABLE_CLANG_WARNINGS
#pragma push_macro("new")
#undef new
_STD_BEGIN
// CLASS TEMPLATE _Tset_traits
template <class _Kty, // key/value type
class _Pr, // comparator predicate type
class _Alloc, // actual allocator type (should be value allocator)
@ -49,7 +48,6 @@ public:
}
};
// CLASS TEMPLATE set
template <class _Kty, class _Pr = less<_Kty>, class _Alloc = allocator<_Kty>>
class set : public _Tree<_Tset_traits<_Kty, _Pr, _Alloc, false>> {
// ordered red-black tree of key values, unique keys
@ -229,7 +227,6 @@ typename set<_Kty, _Keylt, _Alloc>::size_type erase_if(set<_Kty, _Keylt, _Alloc>
}
#endif // _HAS_CXX20
// CLASS TEMPLATE multiset
template <class _Kty, class _Pr = less<_Kty>, class _Alloc = allocator<_Kty>>
class multiset : public _Tree<_Tset_traits<_Kty, _Pr, _Alloc, true>> {
// ordered red-black tree of key values, non-unique keys

Просмотреть файл

@ -27,7 +27,6 @@ _STL_DISABLE_CLANG_WARNINGS
#undef new
_STD_BEGIN
// CLASS shared_mutex
class shared_mutex { // class for mutual exclusion shared across threads
public:
using native_handle_type = _Smtx_t*;
@ -74,7 +73,6 @@ private:
// shared_timed_mutex is not supported under /clr
#ifndef _M_CEE
// CLASS shared_timed_mutex
class shared_timed_mutex { // class for mutual exclusion shared across threads
using _Read_cnt_t = unsigned int;
@ -231,7 +229,6 @@ private:
};
#endif // _M_CEE
// CLASS TEMPLATE shared_lock
template <class _Mutex>
class shared_lock { // shareable lock
public:
@ -334,7 +331,6 @@ public:
_Owns = false;
}
// MUTATE
void swap(shared_lock& _Right) noexcept {
_STD swap(_Pmtx, _Right._Pmtx);
_STD swap(_Owns, _Right._Owns);
@ -347,7 +343,6 @@ public:
return _Res;
}
// OBSERVE
_NODISCARD bool owns_lock() const noexcept {
return _Owns;
}
@ -375,7 +370,6 @@ private:
}
};
// SWAP
template <class _Mutex>
void swap(shared_lock<_Mutex>& _Left, shared_lock<_Mutex>& _Right) noexcept {
_Left.swap(_Right);

Просмотреть файл

@ -29,7 +29,6 @@ _STD_BEGIN
inline constexpr size_t dynamic_extent = static_cast<size_t>(-1);
// STRUCT TEMPLATE _Span_iterator
template <class _Ty>
struct _Span_iterator {
#ifdef __cpp_lib_concepts
@ -198,7 +197,6 @@ struct pointer_traits<_Span_iterator<_Ty>> {
}
};
// STRUCT TEMPLATE _Span_extent_type
template <class _Ty, size_t _Extent>
struct _Span_extent_type {
using pointer = _Ty*;
@ -238,14 +236,12 @@ namespace ranges {
inline constexpr bool enable_borrowed_range<span<_Ty, _Extent>> = true;
} // namespace ranges
// VARIABLE TEMPLATE _Is_span_v
template <class>
inline constexpr bool _Is_span_v = false;
template <class _Ty, size_t _Extent>
inline constexpr bool _Is_span_v<span<_Ty, _Extent>> = true;
// VARIABLE TEMPLATE _Is_std_array_v
template <class>
inline constexpr bool _Is_std_array_v = false;
@ -253,17 +249,14 @@ template <class _Ty, size_t _Size>
inline constexpr bool _Is_std_array_v<array<_Ty, _Size>> = true;
// clang-format off
// CONCEPT _Span_compatible_iterator
template <class _It, class _Ty>
concept _Span_compatible_iterator = contiguous_iterator<_It>
&& is_convertible_v<remove_reference_t<iter_reference_t<_It>>(*)[], _Ty(*)[]>;
// CONCEPT _Span_compatible_sentinel
template <class _Sentinel, class _It>
concept _Span_compatible_sentinel = sized_sentinel_for<_Sentinel, _It>
&& !is_convertible_v<_Sentinel, size_t>;
// CONCEPT _Span_compatible_range
template <class _Rng, class _Ty>
concept _Span_compatible_range =
!is_array_v<remove_cvref_t<_Rng>>
@ -276,26 +269,22 @@ concept _Span_compatible_range =
// clang-format on
#else // ^^^ __cpp_lib_concepts / !__cpp_lib_concepts vvv
// STRUCT TEMPLATE _Is_span
template <class>
struct _Is_span : false_type {};
template <class _Ty, size_t _Extent>
struct _Is_span<span<_Ty, _Extent>> : true_type {};
// STRUCT TEMPLATE _Is_std_array
template <class>
struct _Is_std_array : false_type {};
template <class _Ty, size_t _Size>
struct _Is_std_array<array<_Ty, _Size>> : true_type {};
// STRUCT TEMPLATE _Is_span_convertible_range
template <class _Rng, class _Ty>
struct _Is_span_convertible_range
: bool_constant<is_convertible_v<remove_pointer_t<decltype(_STD data(_STD declval<_Rng&>()))> (*)[], _Ty (*)[]>> {};
// STRUCT TEMPLATE _Has_container_interface
template <class, class = void>
struct _Has_container_interface : false_type {};
@ -303,7 +292,6 @@ template <class _Rng>
struct _Has_container_interface<_Rng,
void_t<decltype(_STD data(_STD declval<_Rng&>())), decltype(_STD size(_STD declval<_Rng&>()))>> : true_type {};
// VARIABLE TEMPLATE _Is_span_compatible_range
// clang-format off
template <class _Rng, class _Ty>
inline constexpr bool _Is_span_compatible_range = conjunction_v<
@ -317,7 +305,6 @@ inline constexpr bool _Is_span_compatible_range = conjunction_v<
#endif // !__cpp_lib_concepts
// [views.span]
// CLASS TEMPLATE span
template <class _Ty, size_t _Extent = dynamic_extent>
class span : private _Span_extent_type<_Ty, _Extent> {
private:
@ -645,7 +632,6 @@ public:
}
};
// DEDUCTION GUIDES
template <class _Ty, size_t _Extent>
span(_Ty (&)[_Extent]) -> span<_Ty, _Extent>;
@ -675,14 +661,12 @@ span(const _Rng&) -> span<const typename _Rng::value_type>;
#ifdef __cpp_lib_byte
// [span.objectrep] Views of object representation
// FUNCTION TEMPLATE as_bytes
template <class _Ty, size_t _Extent>
_NODISCARD auto as_bytes(span<_Ty, _Extent> _Sp) noexcept {
using _ReturnType = span<const byte, _Extent == dynamic_extent ? dynamic_extent : sizeof(_Ty) * _Extent>;
return _ReturnType{reinterpret_cast<const byte*>(_Sp.data()), _Sp.size_bytes()};
}
// FUNCTION TEMPLATE as_writable_bytes
template <class _Ty, size_t _Extent, enable_if_t<!is_const_v<_Ty>, int> = 0>
_NODISCARD auto as_writable_bytes(span<_Ty, _Extent> _Sp) noexcept {
using _ReturnType = span<byte, _Extent == dynamic_extent ? dynamic_extent : sizeof(_Ty) * _Extent>;

Просмотреть файл

@ -19,7 +19,6 @@ _STL_DISABLE_CLANG_WARNINGS
#undef new
_STD_BEGIN
// CLASS TEMPLATE basic_stringbuf
template <class _Elem, class _Traits, class _Alloc>
class basic_stringbuf
: public basic_streambuf<_Elem, _Traits> { // stream buffer maintaining an allocated character array
@ -544,7 +543,6 @@ void swap(basic_stringbuf<_Elem, _Traits, _Alloc>& _Left, basic_stringbuf<_Elem,
_Left.swap(_Right);
}
// CLASS TEMPLATE basic_istringstream
template <class _Elem, class _Traits, class _Alloc>
class basic_istringstream : public basic_istream<_Elem, _Traits> { // input stream associated with a character array
public:
@ -664,7 +662,6 @@ void swap(basic_istringstream<_Elem, _Traits, _Alloc>& _Left, basic_istringstrea
_Left.swap(_Right);
}
// CLASS TEMPLATE basic_ostringstream
template <class _Elem, class _Traits, class _Alloc>
class basic_ostringstream : public basic_ostream<_Elem, _Traits> { // output stream associated with a character array
public:
@ -784,7 +781,6 @@ void swap(basic_ostringstream<_Elem, _Traits, _Alloc>& _Left, basic_ostringstrea
_Left.swap(_Right);
}
// CLASS TEMPLATE basic_stringstream
template <class _Elem, class _Traits, class _Alloc>
class basic_stringstream
: public basic_iostream<_Elem, _Traits> { // input/output stream associated with a character array

Просмотреть файл

@ -18,7 +18,6 @@ _STL_DISABLE_CLANG_WARNINGS
#undef new
_STD_BEGIN
// CLASS TEMPLATE stack
template <class _Ty, class _Container = deque<_Ty>>
class stack {
public:

Просмотреть файл

@ -18,7 +18,6 @@ _STL_DISABLE_CLANG_WARNINGS
#pragma push_macro("new")
#undef new
_STD_BEGIN
// CLASS logic_error
class logic_error : public exception { // base of all logic-error exceptions
public:
using _Mybase = exception;
@ -35,7 +34,6 @@ protected:
#endif // !_HAS_EXCEPTIONS
};
// CLASS domain_error
class domain_error : public logic_error { // base of all domain-error exceptions
public:
using _Mybase = logic_error;
@ -52,7 +50,6 @@ protected:
#endif // !_HAS_EXCEPTIONS
};
// CLASS invalid_argument
class invalid_argument : public logic_error { // base of all invalid-argument exceptions
public:
using _Mybase = logic_error;
@ -69,7 +66,6 @@ protected:
#endif // !_HAS_EXCEPTIONS
};
// CLASS length_error
class length_error : public logic_error { // base of all length-error exceptions
public:
using _Mybase = logic_error;
@ -86,7 +82,6 @@ protected:
#endif // !_HAS_EXCEPTIONS
};
// CLASS out_of_range
class out_of_range : public logic_error { // base of all out-of-range exceptions
public:
using _Mybase = logic_error;
@ -103,7 +98,6 @@ protected:
#endif // !_HAS_EXCEPTIONS
};
// CLASS runtime_error
class runtime_error : public exception { // base of all runtime-error exceptions
public:
using _Mybase = exception;
@ -120,7 +114,6 @@ protected:
#endif // !_HAS_EXCEPTIONS
};
// CLASS overflow_error
class overflow_error : public runtime_error { // base of all overflow-error exceptions
public:
using _Mybase = runtime_error;
@ -137,7 +130,6 @@ protected:
#endif // !_HAS_EXCEPTIONS
};
// CLASS underflow_error
class underflow_error : public runtime_error { // base of all underflow-error exceptions
public:
using _Mybase = runtime_error;
@ -154,7 +146,6 @@ protected:
#endif // !_HAS_EXCEPTIONS
};
// CLASS range_error
class range_error : public runtime_error { // base of all range-error exceptions
public:
using _Mybase = runtime_error;

Просмотреть файл

@ -18,7 +18,6 @@ _STL_DISABLE_CLANG_WARNINGS
#undef new
_STD_BEGIN
// CLASS TEMPLATE basic_streambuf
template <class _Elem, class _Traits>
class basic_streambuf { // control read/write buffers
protected:

Просмотреть файл

@ -22,7 +22,6 @@ _STL_DISABLE_CLANG_WARNINGS
#undef new
_STD_BEGIN
// FUNCTION TEMPLATE getline
template <class _Elem, class _Traits, class _Alloc>
basic_istream<_Elem, _Traits>& getline(basic_istream<_Elem, _Traits>&& _Istr,
basic_string<_Elem, _Traits, _Alloc>& _Str,
@ -84,7 +83,6 @@ basic_istream<_Elem, _Traits>& getline(basic_istream<_Elem, _Traits>& _Istr,
return getline(_STD move(_Istr), _Str, _Istr.widen('\n'));
}
// sto* NARROW CONVERSIONS
_NODISCARD inline int stoi(const string& _Str, size_t* _Idx = nullptr, int _Base = 10) {
// convert string to int
int& _Errno_ref = errno; // Nonzero cost, pay it once
@ -266,7 +264,6 @@ _NODISCARD inline long double stold(const string& _Str, size_t* _Idx = nullptr)
return _Ans;
}
// sto* WIDE CONVERSIONS
_NODISCARD inline int stoi(const wstring& _Str, size_t* _Idx = nullptr, int _Base = 10) {
// convert wstring to int
int& _Errno_ref = errno; // Nonzero cost, pay it once
@ -448,7 +445,6 @@ _NODISCARD inline long double stold(const wstring& _Str, size_t* _Idx = nullptr)
return _Ans;
}
// HELPERS FOR to_string AND to_wstring AND operator<<(duration)
template <class _Elem, class _UTy>
_NODISCARD _Elem* _UIntegral_to_buff(_Elem* _RNext, _UTy _UVal) { // format _UVal into buffer *ending at* _RNext
static_assert(is_unsigned_v<_UTy>, "_UTy must be unsigned");
@ -509,7 +505,6 @@ _NODISCARD basic_string<_Elem> _UIntegral_to_string(const _Ty _Val) { // convert
return basic_string<_Elem>(_RNext, _Buff_end);
}
// to_string NARROW CONVERSIONS
_NODISCARD inline string to_string(int _Val) { // convert int to string
return _Integral_to_string<char>(_Val);
}
@ -549,7 +544,6 @@ _NODISCARD inline string to_string(long double _Val) { // convert long double to
return _STD to_string(static_cast<double>(_Val));
}
// to_wstring WIDE CONVERSIONS
_NODISCARD inline wstring to_wstring(int _Val) { // convert int to wstring
return _Integral_to_string<wchar_t>(_Val);
}

Просмотреть файл

@ -22,7 +22,6 @@ _STD_BEGIN
_CXX17_DEPRECATE_STRSTREAM typedef int _Header_strstream;
using _Hdr_strstream = _Header_strstream;
// CLASS strstreambuf
class strstreambuf : public streambuf { // stream buffer associated with static or allocated character array
public:
using _Mysb = streambuf;
@ -420,12 +419,10 @@ private:
void(__CLRCALL_OR_CDECL* _Pfree)(void*); // the pointer to free function
};
// strstreambuf OPERATORS
inline void swap(strstreambuf& _Left, strstreambuf& _Right) {
_Left.swap(_Right);
}
// CLASS istrstream
class istrstream : public istream { // input stream associated with a character array
public:
using _Mybase = istream;
@ -485,12 +482,10 @@ private:
_Mysb _Strbuffer; // the string buffer
};
// istrstream OPERATORS
inline void swap(istrstream& _Left, istrstream& _Right) {
_Left.swap(_Right);
}
// CLASS ostrstream
class ostrstream : public ostream { // output stream associated with a character array
public:
using _Mybase = ostream;
@ -549,12 +544,10 @@ private:
_Mysb _Strbuffer; // the string buffer
};
// ostrstream OPERATORS
inline void swap(ostrstream& _Left, ostrstream& _Right) {
_Left.swap(_Right);
}
// CLASS strstream
class strstream : public iostream { // input/output stream associated with character array buffer
public:
using _Mybase = iostream;
@ -618,7 +611,6 @@ private:
_Mysb _Strbuffer; // the string buffer
};
// strstream OPERATORS
inline void swap(strstream& _Left, strstream& _Right) {
_Left.swap(_Right);
}

Просмотреть файл

@ -32,7 +32,6 @@ _END_EXTERN_C
_STD_BEGIN
// CLASS TEMPLATE _Basic_syncbuf_impl
template <class _Elem, class _Traits>
class _Basic_syncbuf_impl : public basic_streambuf<_Elem, _Traits> {
public:
@ -67,7 +66,6 @@ protected:
bool _Sync_recorded{false};
};
// CLASS TEMPLATE basic_syncbuf
template <class _Elem, class _Traits, class _Alloc>
class basic_syncbuf : public _Basic_syncbuf_impl<_Elem, _Traits> {
public:
@ -319,7 +317,6 @@ void swap(basic_syncbuf<_Elem, _Traits, _Alloc>& _Left,
_Left.swap(_Right);
}
// CLASS TEMPLATE basic_osyncstream
template <class _Elem, class _Traits, class _Alloc>
class basic_osyncstream : public basic_ostream<_Elem, _Traits> {
public:

Просмотреть файл

@ -30,12 +30,10 @@ _STL_DISABLE_CLANG_WARNINGS
#undef new
_STD_BEGIN
// ENUM CLASS io_errc
enum class io_errc { // error codes for ios_base::failure
stream = 1
};
// STRUCT TEMPLATE is_error_code_enum
template <class _Enum>
struct is_error_code_enum : false_type {};
@ -45,7 +43,6 @@ struct is_error_code_enum<io_errc> : true_type {};
template <class _Ty>
_INLINE_VAR constexpr bool is_error_code_enum_v = is_error_code_enum<_Ty>::value;
// STRUCT TEMPLATE is_error_condition_enum
template <class _Enum>
struct is_error_condition_enum : false_type {};
@ -62,7 +59,6 @@ _NODISCARD error_code make_error_code(io_errc) noexcept;
_NODISCARD error_condition make_error_condition(errc) noexcept;
_NODISCARD error_condition make_error_condition(io_errc) noexcept;
// CLASS error_category
class error_category;
_NODISCARD const error_category& generic_category() noexcept;
@ -131,7 +127,6 @@ protected:
_NODISCARD inline bool _System_error_equal(const error_code&, const error_condition&) noexcept;
#endif // _STL_OPTIMIZE_SYSTEM_ERROR_OPERATORS
// CLASS error_code
class error_code { // store an implementation-specific error code and category
public:
error_code() noexcept : _Myval(0), _Mycat(&_STD system_category()) {} // construct non-error
@ -224,7 +219,6 @@ private:
const error_category* _Mycat; // pointer to error category
};
// CLASS error_condition
class error_condition { // store an abstract error code and category
public:
error_condition() noexcept : _Myval(0), _Mycat(&_STD generic_category()) {} // construct non-error
@ -377,7 +371,6 @@ _NODISCARD inline bool operator!=(const error_condition& _Left, const error_cond
#endif // !_HAS_CXX20
#endif // _STL_OPTIMIZE_SYSTEM_ERROR_OPERATORS
// VIRTUALS FOR error_category
_NODISCARD inline error_condition error_category::default_error_condition(int _Errval) const noexcept {
// make error_condition for error code
return error_condition(_Errval, *this);
@ -391,13 +384,11 @@ _NODISCARD inline bool error_category::equivalent(const error_code& _Code, int _
return *this == _Code.category() && _Code.value() == _Errval;
}
// MEMBER FUNCTIONS for error_code
_NODISCARD inline error_condition error_code::default_error_condition() const noexcept {
// make error_condition for error code
return category().default_error_condition(value());
}
// FUNCTION make_error_code
_NODISCARD inline error_code make_error_code(errc _Errno) noexcept {
return error_code(static_cast<int>(_Errno), _STD generic_category());
}
@ -406,7 +397,6 @@ _NODISCARD inline error_code make_error_code(io_errc _Errno) noexcept {
return error_code(static_cast<int>(_Errno), _STD iostream_category());
}
// FUNCTION make_error_condition
_NODISCARD inline error_condition make_error_condition(errc _Errno) noexcept {
return error_condition(static_cast<int>(_Errno), _STD generic_category());
}
@ -415,7 +405,6 @@ _NODISCARD inline error_condition make_error_condition(io_errc _Errno) noexcept
return error_condition(static_cast<int>(_Errno), _STD iostream_category());
}
// STRUCT TEMPLATE SPECIALIZATION hash
template <>
struct hash<error_code> {
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef error_code _ARGUMENT_TYPE_NAME;
@ -436,7 +425,6 @@ struct hash<error_condition> {
}
};
// CLASS system_error
class _System_error : public runtime_error { // base of all system-error exceptions
private:
static string _Makestr(error_code _Errcode, string _Message) { // compose error message

Просмотреть файл

@ -276,7 +276,6 @@ basic_ostream<_Ch, _Tr>& operator<<(basic_ostream<_Ch, _Tr>& _Str, thread::id _I
return _Str << _Id._Id;
}
// STRUCT TEMPLATE SPECIALIZATION hash
template <>
struct hash<thread::id> {
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef thread::id _ARGUMENT_TYPE_NAME;

Просмотреть файл

@ -23,7 +23,6 @@ _STL_DISABLE_CLANG_WARNINGS
_STD_BEGIN
#if _HAS_CONDITIONAL_EXPLICIT
// VARIABLE TEMPLATE _Tuple_conditional_explicit_v
template <bool _Same, class _Dest, class... _Srcs>
_INLINE_VAR constexpr bool _Tuple_conditional_explicit_v0 = false;
@ -35,7 +34,6 @@ template <class _Dest, class... _Srcs>
_INLINE_VAR constexpr bool _Tuple_conditional_explicit_v =
_Tuple_conditional_explicit_v0<tuple_size_v<_Dest> == sizeof...(_Srcs), _Dest, _Srcs...>;
#else // ^^^ _HAS_CONDITIONAL_EXPLICIT ^^^ / vvv !_HAS_CONDITIONAL_EXPLICIT vvv
// STRUCT TEMPLATE _Tuple_implicit_val
// Constrain tuple's implicit constructors
template <bool _Same, class _Dest, class... _Srcs>
_INLINE_VAR constexpr bool _Tuple_implicit_v0 = false;
@ -48,7 +46,6 @@ template <class _Dest, class... _Srcs>
struct _Tuple_implicit_val
: bool_constant<_Tuple_implicit_v0<tuple_size_v<_Dest> == sizeof...(_Srcs), _Dest, _Srcs...>> {};
// STRUCT TEMPLATE _Tuple_explicit_val
// Constrain tuple's explicit constructors
template <bool _Same, class _Dest, class... _Srcs>
_INLINE_VAR constexpr bool _Tuple_explicit_v0 = false;
@ -62,7 +59,6 @@ struct _Tuple_explicit_val
: bool_constant<_Tuple_explicit_v0<tuple_size_v<_Dest> == sizeof...(_Srcs), _Dest, _Srcs...>> {};
#endif // ^^^ !_HAS_CONDITIONAL_EXPLICIT ^^^
// VARIABLE TEMPLATE _Tuple_constructible_v
template <bool _Same, class _Dest, class... _Srcs>
_INLINE_VAR constexpr bool _Tuple_constructible_v0 = false;
@ -77,7 +73,6 @@ _INLINE_VAR constexpr bool _Tuple_constructible_v =
template <class _Dest, class... _Srcs>
struct _Tuple_constructible_val : bool_constant<_Tuple_constructible_v<_Dest, _Srcs...>> {};
// VARIABLE TEMPLATE _Tuple_nothrow_constructible_v
template <bool _Same, class _Dest, class... _Srcs>
_INLINE_VAR constexpr bool _Tuple_nothrow_constructible_v0 = false;
@ -89,7 +84,6 @@ template <class _Dest, class... _Srcs>
_INLINE_VAR constexpr bool _Tuple_nothrow_constructible_v =
_Tuple_nothrow_constructible_v0<tuple_size_v<_Dest> == sizeof...(_Srcs), _Dest, _Srcs...>;
// VARIABLE TEMPLATE _Tuple_assignable_v
template <bool _Same, class _Dest, class... _Srcs>
_INLINE_VAR constexpr bool _Tuple_assignable_v0 = false;
@ -104,7 +98,6 @@ _INLINE_VAR constexpr bool _Tuple_assignable_v =
template <class _Dest, class... _Srcs>
struct _Tuple_assignable_val : bool_constant<_Tuple_assignable_v<_Dest, _Srcs...>> {};
// VARIABLE TEMPLATE _Tuple_nothrow_assignable_v
template <bool _Same, class _Dest, class... _Srcs>
_INLINE_VAR constexpr bool _Tuple_nothrow_assignable_v0 = false;
@ -116,7 +109,6 @@ template <class _Dest, class... _Srcs>
_INLINE_VAR constexpr bool _Tuple_nothrow_assignable_v =
_Tuple_nothrow_assignable_v0<tuple_size_v<_Dest> == sizeof...(_Srcs), _Dest, _Srcs...>;
// STRUCT TEMPLATE _Tuple_convert_copy_val
// Constrain tuple's copy converting constructor (LWG-2549)
template <class _Myself, class... _Other>
struct _Tuple_convert_copy_val : true_type {};
@ -126,7 +118,6 @@ struct _Tuple_convert_copy_val<tuple<_This>, _Uty>
: bool_constant<!disjunction_v<is_same<_This, _Uty>, is_constructible<_This, const tuple<_Uty>&>,
is_convertible<const tuple<_Uty>&, _This>>> {};
// STRUCT TEMPLATE _Tuple_convert_move_val
// Constrain tuple's move converting constructor (LWG-2549)
template <class _Myself, class... _Other>
struct _Tuple_convert_move_val : true_type {};
@ -136,7 +127,6 @@ struct _Tuple_convert_move_val<tuple<_This>, _Uty>
: bool_constant<!disjunction_v<is_same<_This, _Uty>, is_constructible<_This, tuple<_Uty>>,
is_convertible<tuple<_Uty>, _This>>> {};
// STRUCT TEMPLATE _Tuple_perfect_val
// Constrain tuple's perfect forwarding constructor (LWG-3121)
template <class _Myself, class _This2, class... _Rest2>
struct _Tuple_perfect_val : true_type {};
@ -145,7 +135,6 @@ template <class _Myself, class _This2>
struct _Tuple_perfect_val<_Myself, _This2>
: bool_constant<!is_same_v<_Myself, remove_const_t<remove_reference_t<_This2>>>> {};
// STRUCT _Ignore
struct _Ignore { // struct that ignores assignments
template <class _Ty>
constexpr const _Ignore& operator=(const _Ty&) const noexcept /* strengthened */ {
@ -161,7 +150,6 @@ _INLINE_VAR constexpr _Ignore ignore{};
// some class - including injected-class-names! - that we know are not members of the class being defined.
// This avoids pointless class-member lookup for those names in this context.
// STRUCT TEMPLATE _Tuple_val
template <class _Ty>
struct _Tuple_val { // stores each value in a tuple
constexpr _Tuple_val() : _Val() {}
@ -189,7 +177,6 @@ struct _Tuple_val { // stores each value in a tuple
_Ty _Val;
};
// CLASS TEMPLATE tuple
struct _Exact_args_t {
explicit _Exact_args_t() = default;
}; // tag type to disambiguate construction (from one arg per element)
@ -747,7 +734,6 @@ template <class _Alloc, class... _Types>
tuple(allocator_arg_t, _Alloc, tuple<_Types...>) -> tuple<_Types...>;
#endif // _HAS_CXX17
// OPERATORS FOR tuple
template <class... _Types1, class... _Types2>
_NODISCARD constexpr bool operator==(const tuple<_Types1...>& _Left, const tuple<_Types2...>& _Right) {
static_assert(sizeof...(_Types1) == sizeof...(_Types2), "cannot compare tuples of different sizes");
@ -796,7 +782,6 @@ _CONSTEXPR20 void swap(tuple<_Types...>& _Left, tuple<_Types...>& _Right) noexce
return _Left.swap(_Right);
}
// CLASS _Tuple_element (find element by type)
template <class _Ty, class _Tuple>
struct _Tuple_element {}; // backstop _Tuple_element definition
@ -811,7 +796,6 @@ struct _Tuple_element<_Ty, tuple<_This, _Rest...>> { // recursive _Tuple_element
using _Ttype = typename _Tuple_element<_Ty, tuple<_Rest...>>::_Ttype;
};
// FUNCTION TEMPLATE get (by index)
template <size_t _Index, class... _Types>
_NODISCARD constexpr tuple_element_t<_Index, tuple<_Types...>>& get(tuple<_Types...>& _Tuple) noexcept {
using _Ttype = typename tuple_element<_Index, tuple<_Types...>>::_Ttype;
@ -846,7 +830,6 @@ _NODISCARD constexpr auto&& _Tuple_get(tuple<_Types...>&& _Tuple) noexcept {
return static_cast<_Ty&&>(static_cast<_Ttype&>(_Tuple)._Myfirst._Val);
}
// FUNCTION TEMPLATE get (by type)
template <class _Ty, class... _Types>
_NODISCARD constexpr _Ty& get(tuple<_Types...>& _Tuple) noexcept {
using _Ttype = typename _Tuple_element<_Ty, tuple<_Types...>>::_Ttype;
@ -871,7 +854,6 @@ _NODISCARD constexpr const _Ty&& get(const tuple<_Types...>&& _Tuple) noexcept {
return static_cast<const _Ty&&>(static_cast<const _Ttype&>(_Tuple)._Myfirst._Val);
}
// CONSTRUCTOR TEMPLATES FOR tuple
template <class _This, class... _Rest>
template <class _Tag, class _Tpl, size_t... _Indices, enable_if_t<is_same_v<_Tag, _STD _Unpack_tuple_t>, int>>
constexpr tuple<_This, _Rest...>::tuple(_Tag, _Tpl&& _Right, index_sequence<_Indices...>)
@ -883,27 +865,23 @@ template <class _Tag, class _Alloc, class _Tpl, size_t... _Indices,
constexpr tuple<_This, _Rest...>::tuple(_Tag, const _Alloc& _Al, _Tpl&& _Right, index_sequence<_Indices...>)
: tuple(_Alloc_exact_args_t{}, _Al, _STD get<_Indices>(_STD forward<_Tpl>(_Right))...) {}
// FUNCTION TEMPLATE make_tuple
template <class... _Types>
_NODISCARD constexpr tuple<_Unrefwrap_t<_Types>...> make_tuple(_Types&&... _Args) { // make tuple from elements
using _Ttype = tuple<_Unrefwrap_t<_Types>...>;
return _Ttype(_STD forward<_Types>(_Args)...);
}
// FUNCTION TEMPLATE tie
template <class... _Types>
_NODISCARD constexpr tuple<_Types&...> tie(_Types&... _Args) noexcept { // make tuple from elements
using _Ttype = tuple<_Types&...>;
return _Ttype(_Args...);
}
// FUNCTION TEMPLATE forward_as_tuple
template <class... _Types>
_NODISCARD constexpr tuple<_Types&&...> forward_as_tuple(_Types&&... _Args) noexcept { // forward arguments in a tuple
return tuple<_Types&&...>(_STD forward<_Types>(_Args)...);
}
// STRUCT TEMPLATE _Cat_sequences
template <class _Seq_type1, class _Seq_type2>
struct _Cat_sequences;
@ -913,7 +891,6 @@ struct _Cat_sequences<index_sequence<_Indexes1...>,
using type = index_sequence<_Indexes1..., _Indexes2...>;
};
// FORWARD DECLARATIONS
template <class _Ty, size_t _Size>
class array;
@ -929,7 +906,6 @@ _NODISCARD constexpr _Ty&& get(array<_Ty, _Size>&& _Arr) noexcept;
template <size_t _Idx, class _Ty, size_t _Size>
_NODISCARD constexpr const _Ty&& get(const array<_Ty, _Size>&& _Arr) noexcept;
// STRUCT TEMPLATE _View_as_tuple
template <class _Ty, class... _For_array>
struct _View_as_tuple { // tuple_cat() supports only tuples, pairs, and arrays
static_assert(_Always_false<_Ty>, "Unsupported tuple_cat arguments.");
@ -955,11 +931,9 @@ struct _View_as_tuple<array<_Ty, _Size>, _Types...>
: _View_as_tuple<array<_Ty, _Size - 1>, _Ty, _Types...> { // view an array as a tuple; counts down to 0
};
// STRUCT TEMPLATE _Repeat_for
template <size_t _Nx, class _Ty>
struct _Repeat_for : integral_constant<size_t, _Nx> {}; // repeats _Nx for each _Ty in a parameter pack
// FUNCTION TEMPLATE tuple_cat
template <class _Ret, class _Kx_arg, class _Ix_arg, size_t _Ix_next, class... _Tuples>
struct _Tuple_cat2 { // determine tuple_cat's return type and _Kx/_Ix indices
static_assert(sizeof...(_Tuples) == 0, "Unsupported tuple_cat arguments.");
@ -994,7 +968,6 @@ _NODISCARD constexpr typename _Tuple_cat1<_Tuples...>::type tuple_cat(_Tuples&&.
}
#if _HAS_CXX17
// FUNCTION TEMPLATE apply
template <class _Callable, class _Tuple, size_t... _Indices>
constexpr decltype(auto) _Apply_impl(
_Callable&& _Obj, _Tuple&& _Tpl, index_sequence<_Indices...>) { // invoke _Obj with the elements of _Tpl
@ -1007,7 +980,6 @@ constexpr decltype(auto) apply(_Callable&& _Obj, _Tuple&& _Tpl) { // invoke _Obj
make_index_sequence<tuple_size_v<remove_reference_t<_Tuple>>>{});
}
// FUNCTION TEMPLATE make_from_tuple
template <class _Ty, class _Tuple, size_t... _Indices>
constexpr _Ty _Make_from_tuple_impl(
_Tuple&& _Tpl, index_sequence<_Indices...>) { // construct _Ty from the elements of _Tpl
@ -1021,7 +993,6 @@ _NODISCARD constexpr _Ty make_from_tuple(_Tuple&& _Tpl) { // construct _Ty from
}
#endif // _HAS_CXX17
// STRUCT TEMPLATE uses_allocator
template <class... _Types, class _Alloc>
struct uses_allocator<tuple<_Types...>, _Alloc> : true_type {}; // true_type if container allocator enabled

Просмотреть файл

@ -19,7 +19,6 @@ _STL_DISABLE_CLANG_WARNINGS
#undef new
_STD_BEGIN
// STRUCT TEMPLATE integer_sequence
template <class _Ty, _Ty... _Vals>
struct integer_sequence { // sequence of integer parameters
static_assert(is_integral_v<_Ty>, "integer_sequence<T, I...> requires T to be an integral type.");
@ -31,7 +30,6 @@ struct integer_sequence { // sequence of integer parameters
}
};
// ALIAS TEMPLATE make_integer_sequence
template <class _Ty, _Ty _Size>
using make_integer_sequence = __make_integer_seq<integer_sequence, _Ty, _Size>;
@ -44,7 +42,6 @@ using make_index_sequence = make_integer_sequence<size_t, _Size>;
template <class... _Types>
using index_sequence_for = make_index_sequence<sizeof...(_Types)>;
// STRUCT TEMPLATE conjunction
template <bool _First_value, class _First, class... _Rest>
struct _Conjunction { // handle false trait or last trait
using type = _First;
@ -66,26 +63,22 @@ struct conjunction<_First, _Rest...> : _Conjunction<_First::value, _First, _Rest
template <class... _Traits>
_INLINE_VAR constexpr bool conjunction_v = conjunction<_Traits...>::value;
// STRUCT TEMPLATE negation
template <class _Trait>
struct negation : bool_constant<!static_cast<bool>(_Trait::value)> {}; // The negated result of _Trait
template <class _Trait>
_INLINE_VAR constexpr bool negation_v = negation<_Trait>::value;
// STRUCT TEMPLATE is_void
template <class _Ty>
_INLINE_VAR constexpr bool is_void_v = is_same_v<remove_cv_t<_Ty>, void>;
template <class _Ty>
struct is_void : bool_constant<is_void_v<_Ty>> {};
// ALIAS TEMPLATE void_t
template <class... _Types>
using void_t = void;
// Type modifiers
// STRUCT TEMPLATE add_const
template <class _Ty>
struct add_const { // add top-level const qualifier
using type = const _Ty;
@ -94,7 +87,6 @@ struct add_const { // add top-level const qualifier
template <class _Ty>
using add_const_t = typename add_const<_Ty>::type;
// STRUCT TEMPLATE add_volatile
template <class _Ty>
struct add_volatile { // add top-level volatile qualifier
using type = volatile _Ty;
@ -103,7 +95,6 @@ struct add_volatile { // add top-level volatile qualifier
template <class _Ty>
using add_volatile_t = typename add_volatile<_Ty>::type;
// STRUCT TEMPLATE add_cv
template <class _Ty>
struct add_cv { // add top-level const and volatile qualifiers
using type = const volatile _Ty;
@ -112,7 +103,6 @@ struct add_cv { // add top-level const and volatile qualifiers
template <class _Ty>
using add_cv_t = typename add_cv<_Ty>::type;
// STRUCT TEMPLATE _Add_reference
template <class _Ty, class = void>
struct _Add_reference { // add reference (non-referenceable type)
using _Lvalue = _Ty;
@ -125,7 +115,6 @@ struct _Add_reference<_Ty, void_t<_Ty&>> { // (referenceable type)
using _Rvalue = _Ty&&;
};
// STRUCT TEMPLATE add_lvalue_reference
template <class _Ty>
struct add_lvalue_reference {
using type = typename _Add_reference<_Ty>::_Lvalue;
@ -134,7 +123,6 @@ struct add_lvalue_reference {
template <class _Ty>
using add_lvalue_reference_t = typename _Add_reference<_Ty>::_Lvalue;
// STRUCT TEMPLATE add_rvalue_reference
template <class _Ty>
struct add_rvalue_reference {
using type = typename _Add_reference<_Ty>::_Rvalue;
@ -143,11 +131,9 @@ struct add_rvalue_reference {
template <class _Ty>
using add_rvalue_reference_t = typename _Add_reference<_Ty>::_Rvalue;
// FUNCTION TEMPLATE declval
template <class _Ty>
add_rvalue_reference_t<_Ty> declval() noexcept;
// STRUCT TEMPLATE remove_extent
template <class _Ty>
struct remove_extent { // remove array extent
using type = _Ty;
@ -166,7 +152,6 @@ struct remove_extent<_Ty[]> {
template <class _Ty>
using remove_extent_t = typename remove_extent<_Ty>::type;
// STRUCT TEMPLATE remove_all_extents
template <class _Ty>
struct remove_all_extents { // remove all array extents
using type = _Ty;
@ -185,7 +170,6 @@ struct remove_all_extents<_Ty[]> {
template <class _Ty>
using remove_all_extents_t = typename remove_all_extents<_Ty>::type;
// STRUCT TEMPLATE remove_pointer
template <class _Ty>
struct remove_pointer {
using type = _Ty;
@ -214,7 +198,6 @@ struct remove_pointer<_Ty* const volatile> {
template <class _Ty>
using remove_pointer_t = typename remove_pointer<_Ty>::type;
// STRUCT TEMPLATE add_pointer
template <class _Ty, class = void>
struct _Add_pointer { // add pointer (pointer type cannot be formed)
using type = _Ty;
@ -233,8 +216,6 @@ struct add_pointer {
template <class _Ty>
using add_pointer_t = typename _Add_pointer<_Ty>::type;
// TYPE PREDICATES
// STRUCT TEMPLATE is_array
template <class>
_INLINE_VAR constexpr bool is_array_v = false; // determine whether type argument is an array
@ -248,7 +229,6 @@ template <class _Ty>
struct is_array : bool_constant<is_array_v<_Ty>> {};
#if _HAS_CXX20
// STRUCT TEMPLATE is_bounded_array
template <class>
inline constexpr bool is_bounded_array_v = false;
@ -258,7 +238,6 @@ inline constexpr bool is_bounded_array_v<_Ty[_Nx]> = true;
template <class _Ty>
struct is_bounded_array : bool_constant<is_bounded_array_v<_Ty>> {};
// STRUCT TEMPLATE is_unbounded_array
template <class>
inline constexpr bool is_unbounded_array_v = false;
@ -269,7 +248,6 @@ template <class _Ty>
struct is_unbounded_array : bool_constant<is_unbounded_array_v<_Ty>> {};
#endif // _HAS_CXX20
// STRUCT TEMPLATE is_lvalue_reference
template <class>
_INLINE_VAR constexpr bool is_lvalue_reference_v = false; // determine whether type argument is an lvalue reference
@ -279,7 +257,6 @@ _INLINE_VAR constexpr bool is_lvalue_reference_v<_Ty&> = true;
template <class _Ty>
struct is_lvalue_reference : bool_constant<is_lvalue_reference_v<_Ty>> {};
// STRUCT TEMPLATE is_rvalue_reference
template <class>
_INLINE_VAR constexpr bool is_rvalue_reference_v = false; // determine whether type argument is an rvalue reference
@ -289,7 +266,6 @@ _INLINE_VAR constexpr bool is_rvalue_reference_v<_Ty&&> = true;
template <class _Ty>
struct is_rvalue_reference : bool_constant<is_rvalue_reference_v<_Ty>> {};
// STRUCT TEMPLATE is_reference
template <class>
_INLINE_VAR constexpr bool is_reference_v = false; // determine whether type argument is a reference
@ -302,7 +278,6 @@ _INLINE_VAR constexpr bool is_reference_v<_Ty&&> = true;
template <class _Ty>
struct is_reference : bool_constant<is_reference_v<_Ty>> {};
// STRUCT TEMPLATE is_pointer
template <class>
_INLINE_VAR constexpr bool is_pointer_v = false; // determine whether _Ty is a pointer
@ -321,7 +296,6 @@ _INLINE_VAR constexpr bool is_pointer_v<_Ty* const volatile> = true;
template <class _Ty>
struct is_pointer : bool_constant<is_pointer_v<_Ty>> {};
// STRUCT TEMPLATE is_null_pointer
template <class _Ty>
_INLINE_VAR constexpr bool is_null_pointer_v =
is_same_v<remove_cv_t<_Ty>, nullptr_t>; // determine whether _Ty is cv-qualified nullptr_t
@ -329,28 +303,24 @@ _INLINE_VAR constexpr bool is_null_pointer_v =
template <class _Ty>
struct is_null_pointer : bool_constant<is_null_pointer_v<_Ty>> {};
// STRUCT TEMPLATE is_union
template <class _Ty>
struct is_union : bool_constant<__is_union(_Ty)> {}; // determine whether _Ty is a union
template <class _Ty>
_INLINE_VAR constexpr bool is_union_v = __is_union(_Ty);
// STRUCT TEMPLATE is_class
template <class _Ty>
struct is_class : bool_constant<__is_class(_Ty)> {}; // determine whether _Ty is a class
template <class _Ty>
_INLINE_VAR constexpr bool is_class_v = __is_class(_Ty);
// STRUCT TEMPLATE is_fundamental
template <class _Ty>
_INLINE_VAR constexpr bool is_fundamental_v = is_arithmetic_v<_Ty> || is_void_v<_Ty> || is_null_pointer_v<_Ty>;
template <class _Ty>
struct is_fundamental : bool_constant<is_fundamental_v<_Ty>> {}; // determine whether _Ty is a fundamental type
// STRUCT TEMPLATE is_convertible
template <class _From, class _To>
struct is_convertible : bool_constant<__is_convertible_to(_From, _To)> {
// determine whether _From is convertible to _To
@ -359,7 +329,6 @@ struct is_convertible : bool_constant<__is_convertible_to(_From, _To)> {
template <class _From, class _To>
_INLINE_VAR constexpr bool is_convertible_v = __is_convertible_to(_From, _To);
// STRUCT TEMPLATE is_enum
template <class _Ty>
struct is_enum : bool_constant<__is_enum(_Ty)> {}; // determine whether _Ty is an enumerated type
@ -367,7 +336,6 @@ template <class _Ty>
_INLINE_VAR constexpr bool is_enum_v = __is_enum(_Ty);
#if _HAS_CXX23
// STRUCT TEMPLATE is_scoped_enum
template <class _Ty>
inline constexpr bool is_scoped_enum_v = conjunction_v<is_enum<_Ty>, negation<is_convertible<_Ty, int>>>;
@ -375,14 +343,12 @@ template <class _Ty>
struct is_scoped_enum : bool_constant<is_scoped_enum_v<_Ty>> {};
#endif // _HAS_CXX23
// STRUCT TEMPLATE is_compound
template <class _Ty>
struct is_compound : bool_constant<!is_fundamental_v<_Ty>> {}; // determine whether _Ty is a compound type
template <class _Ty>
_INLINE_VAR constexpr bool is_compound_v = !is_fundamental_v<_Ty>;
// STRUCT TEMPLATE _Arg_types
template <class... _Types>
struct _Arg_types {}; // provide argument_type, etc. when sizeof...(_Types) is 1 or 2
@ -397,7 +363,6 @@ struct _Arg_types<_Ty1, _Ty2> {
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef _Ty2 _SECOND_ARGUMENT_TYPE_NAME;
};
// STRUCT TEMPLATE is_member_function_pointer
template <class _Ty>
struct _Is_memfunptr { // base class for member function pointer predicates
using _Bool_type = false_type; // NB: members are user-visible via _Weak_types
@ -440,7 +405,6 @@ _INLINE_VAR constexpr bool is_member_function_pointer_v = _Is_memfunptr<remove_c
template <class _Ty>
struct is_member_function_pointer : bool_constant<is_member_function_pointer_v<_Ty>> {};
// STRUCT TEMPLATE is_const
template <class>
_INLINE_VAR constexpr bool is_const_v = false; // determine whether type argument is const qualified
@ -450,7 +414,6 @@ _INLINE_VAR constexpr bool is_const_v<const _Ty> = true;
template <class _Ty>
struct is_const : bool_constant<is_const_v<_Ty>> {};
// STRUCT TEMPLATE is_volatile
template <class>
_INLINE_VAR constexpr bool is_volatile_v = false; // determine whether type argument is volatile qualified
@ -460,7 +423,6 @@ _INLINE_VAR constexpr bool is_volatile_v<volatile _Ty> = true;
template <class _Ty>
struct is_volatile : bool_constant<is_volatile_v<_Ty>> {};
// STRUCT TEMPLATE is_function
template <class _Ty>
_INLINE_VAR constexpr bool is_function_v = // only function types and reference types can't be const qualified
!is_const_v<const _Ty> && !is_reference_v<_Ty>;
@ -468,7 +430,6 @@ _INLINE_VAR constexpr bool is_function_v = // only function types and reference
template <class _Ty>
struct is_function : bool_constant<is_function_v<_Ty>> {};
// STRUCT TEMPLATE is_object
template <class _Ty>
_INLINE_VAR constexpr bool is_object_v = // only function types and reference types can't be const qualified
is_const_v<const _Ty> && !is_void_v<_Ty>;
@ -476,7 +437,6 @@ _INLINE_VAR constexpr bool is_object_v = // only function types and reference ty
template <class _Ty>
struct is_object : bool_constant<is_object_v<_Ty>> {};
// STRUCT TEMPLATE is_member_object_pointer
template <class>
struct _Is_member_object_pointer {
static constexpr bool value = false;
@ -499,7 +459,6 @@ _INLINE_VAR constexpr bool is_member_object_pointer_v = _Is_member_object_pointe
template <class _Ty>
struct is_member_object_pointer : bool_constant<is_member_object_pointer_v<_Ty>> {};
// STRUCT TEMPLATE is_member_pointer
#ifdef __clang__
template <class _Ty>
_INLINE_VAR constexpr bool is_member_pointer_v = __is_member_pointer(_Ty);
@ -511,7 +470,6 @@ _INLINE_VAR constexpr bool is_member_pointer_v = is_member_object_pointer_v<_Ty>
template <class _Ty>
struct is_member_pointer : bool_constant<is_member_pointer_v<_Ty>> {}; // determine whether _Ty is a pointer to member
// STRUCT TEMPLATE is_scalar
template <class _Ty>
_INLINE_VAR constexpr bool is_scalar_v = // determine whether _Ty is a scalar type
is_arithmetic_v<_Ty> || is_enum_v<_Ty> || is_pointer_v<_Ty> || is_member_pointer_v<_Ty> || is_null_pointer_v<_Ty>;
@ -519,42 +477,36 @@ _INLINE_VAR constexpr bool is_scalar_v = // determine whether _Ty is a scalar ty
template <class _Ty>
struct is_scalar : bool_constant<is_scalar_v<_Ty>> {};
// STRUCT TEMPLATE is_pod
template <class _Ty>
struct _CXX20_DEPRECATE_IS_POD is_pod : bool_constant<__is_pod(_Ty)> {}; // determine whether _Ty is a POD type
template <class _Ty>
_CXX20_DEPRECATE_IS_POD _INLINE_VAR constexpr bool is_pod_v = __is_pod(_Ty);
// STRUCT TEMPLATE is_empty
template <class _Ty>
struct is_empty : bool_constant<__is_empty(_Ty)> {}; // determine whether _Ty is an empty class
template <class _Ty>
_INLINE_VAR constexpr bool is_empty_v = __is_empty(_Ty);
// STRUCT TEMPLATE is_polymorphic
template <class _Ty>
struct is_polymorphic : bool_constant<__is_polymorphic(_Ty)> {}; // determine whether _Ty is a polymorphic type
template <class _Ty>
_INLINE_VAR constexpr bool is_polymorphic_v = __is_polymorphic(_Ty);
// STRUCT TEMPLATE is_abstract
template <class _Ty>
struct is_abstract : bool_constant<__is_abstract(_Ty)> {}; // determine whether _Ty is an abstract class
template <class _Ty>
_INLINE_VAR constexpr bool is_abstract_v = __is_abstract(_Ty);
// STRUCT TEMPLATE is_final
template <class _Ty>
struct is_final : bool_constant<__is_final(_Ty)> {}; // determine whether _Ty is a final class
template <class _Ty>
_INLINE_VAR constexpr bool is_final_v = __is_final(_Ty);
// STRUCT TEMPLATE is_standard_layout
template <class _Ty>
struct is_standard_layout : bool_constant<__is_standard_layout(_Ty)> {}; // determine whether _Ty is standard layout
@ -562,7 +514,6 @@ template <class _Ty>
_INLINE_VAR constexpr bool is_standard_layout_v = __is_standard_layout(_Ty);
#if _HAS_DEPRECATED_IS_LITERAL_TYPE
// STRUCT TEMPLATE is_literal_type
template <class _Ty>
struct _CXX17_DEPRECATE_IS_LITERAL_TYPE is_literal_type : bool_constant<__is_literal_type(_Ty)> {
// determine whether _Ty is a literal type
@ -572,7 +523,6 @@ template <class _Ty>
_CXX17_DEPRECATE_IS_LITERAL_TYPE _INLINE_VAR constexpr bool is_literal_type_v = __is_literal_type(_Ty);
#endif // _HAS_DEPRECATED_IS_LITERAL_TYPE
// STRUCT TEMPLATE is_trivial
#if 1 // TRANSITION, VSO-119526 and LLVM-41915
template <class _Ty>
struct is_trivial : bool_constant<__is_trivially_constructible(_Ty) && __is_trivially_copyable(_Ty)> {
@ -589,7 +539,6 @@ template <class _Ty>
_INLINE_VAR constexpr bool is_trivial_v = __is_trivial(_Ty);
#endif // TRANSITION
// STRUCT TEMPLATE is_trivially_copyable
template <class _Ty>
struct is_trivially_copyable : bool_constant<__is_trivially_copyable(_Ty)> {
// determine whether _Ty is a trivially copyable type
@ -598,7 +547,6 @@ struct is_trivially_copyable : bool_constant<__is_trivially_copyable(_Ty)> {
template <class _Ty>
_INLINE_VAR constexpr bool is_trivially_copyable_v = __is_trivially_copyable(_Ty);
// STRUCT TEMPLATE has_virtual_destructor
template <class _Ty>
struct has_virtual_destructor : bool_constant<__has_virtual_destructor(_Ty)> {
// determine whether _Ty has a virtual destructor
@ -608,7 +556,6 @@ template <class _Ty>
_INLINE_VAR constexpr bool has_virtual_destructor_v = __has_virtual_destructor(_Ty);
#if _HAS_CXX17
// STRUCT TEMPLATE has_unique_object_representations
template <class _Ty>
struct has_unique_object_representations : bool_constant<__has_unique_object_representations(_Ty)> {
// determine whether _Ty has unique object representations
@ -617,7 +564,6 @@ struct has_unique_object_representations : bool_constant<__has_unique_object_rep
template <class _Ty>
_INLINE_VAR constexpr bool has_unique_object_representations_v = __has_unique_object_representations(_Ty);
// STRUCT TEMPLATE is_aggregate
template <class _Ty>
struct is_aggregate : bool_constant<__is_aggregate(_Ty)> {}; // determine whether _Ty is an aggregate
@ -625,8 +571,6 @@ template <class _Ty>
_INLINE_VAR constexpr bool is_aggregate_v = __is_aggregate(_Ty);
#endif // _HAS_CXX17
// CONSTRUCTIBLE/ASSIGNABLE TRAITS
// STRUCT TEMPLATE is_constructible
template <class _Ty, class... _Args>
struct is_constructible : bool_constant<__is_constructible(_Ty, _Args...)> {
// determine whether _Ty can be direct-initialized with _Args...
@ -635,7 +579,6 @@ struct is_constructible : bool_constant<__is_constructible(_Ty, _Args...)> {
template <class _Ty, class... _Args>
_INLINE_VAR constexpr bool is_constructible_v = __is_constructible(_Ty, _Args...);
// STRUCT TEMPLATE is_copy_constructible
template <class _Ty>
struct is_copy_constructible : bool_constant<__is_constructible(_Ty, add_lvalue_reference_t<const _Ty>)> {
// determine whether _Ty can be direct-initialized with an lvalue const _Ty
@ -644,7 +587,6 @@ struct is_copy_constructible : bool_constant<__is_constructible(_Ty, add_lvalue_
template <class _Ty>
_INLINE_VAR constexpr bool is_copy_constructible_v = __is_constructible(_Ty, add_lvalue_reference_t<const _Ty>);
// STRUCT TEMPLATE is_default_constructible
template <class _Ty>
struct is_default_constructible : bool_constant<__is_constructible(_Ty)> {
// determine whether _Ty can be value-initialized
@ -653,7 +595,6 @@ struct is_default_constructible : bool_constant<__is_constructible(_Ty)> {
template <class _Ty>
_INLINE_VAR constexpr bool is_default_constructible_v = __is_constructible(_Ty);
// STRUCT TEMPLATE _Is_implicitly_default_constructible
template <class _Ty, class = void>
struct _Is_implicitly_default_constructible : false_type {
// determine whether _Ty can be copy-initialized with {}
@ -666,7 +607,6 @@ template <class _Ty>
struct _Is_implicitly_default_constructible<_Ty, void_t<decltype(_Implicitly_default_construct<_Ty>({}))>> : true_type {
};
// STRUCT TEMPLATE is_move_constructible
template <class _Ty>
struct is_move_constructible : bool_constant<__is_constructible(_Ty, _Ty)> {
// determine whether _Ty can be direct-initialized from an rvalue _Ty
@ -675,14 +615,12 @@ struct is_move_constructible : bool_constant<__is_constructible(_Ty, _Ty)> {
template <class _Ty>
_INLINE_VAR constexpr bool is_move_constructible_v = __is_constructible(_Ty, _Ty);
// STRUCT TEMPLATE is_assignable
template <class _To, class _From>
struct is_assignable : bool_constant<__is_assignable(_To, _From)> {}; // determine whether _From can be assigned to _To
template <class _To, class _From>
_INLINE_VAR constexpr bool is_assignable_v = __is_assignable(_To, _From);
// STRUCT TEMPLATE is_copy_assignable
template <class _Ty>
struct is_copy_assignable
: bool_constant<__is_assignable(add_lvalue_reference_t<_Ty>, add_lvalue_reference_t<const _Ty>)> {
@ -710,7 +648,6 @@ template <class _Ty>
_INLINE_VAR constexpr bool _Is_copy_assignable_unchecked_v = is_copy_assignable_v<_Ty>;
#endif // defined(_IS_ASSIGNABLE_NOCHECK_SUPPORTED) && !defined(__CUDACC__)
// STRUCT TEMPLATE is_move_assignable
template <class _Ty>
struct is_move_assignable : bool_constant<__is_assignable(add_lvalue_reference_t<_Ty>, _Ty)> {
// determine whether an rvalue _Ty can be assigned to an lvalue _Ty
@ -735,7 +672,6 @@ template <class _Ty>
_INLINE_VAR constexpr bool _Is_move_assignable_unchecked_v = is_move_assignable_v<_Ty>;
#endif // defined(_IS_ASSIGNABLE_NOCHECK_SUPPORTED) && !defined(__CUDACC__)
// STRUCT TEMPLATE is_destructible
template <class _Ty>
struct is_destructible : bool_constant<__is_destructible(_Ty)> {
// true iff remove_all_extents_t<_Ty> is a reference type, or can be explicitly destroyed
@ -744,8 +680,6 @@ struct is_destructible : bool_constant<__is_destructible(_Ty)> {
template <class _Ty>
_INLINE_VAR constexpr bool is_destructible_v = __is_destructible(_Ty);
// TRIVIAL TRAITS
// STRUCT TEMPLATE is_trivially_constructible
template <class _Ty, class... _Args>
struct is_trivially_constructible : bool_constant<__is_trivially_constructible(_Ty, _Args...)> {
// determine whether direct-initialization of _Ty with _Args... is trivial
@ -754,7 +688,6 @@ struct is_trivially_constructible : bool_constant<__is_trivially_constructible(_
template <class _Ty, class... _Args>
_INLINE_VAR constexpr bool is_trivially_constructible_v = __is_trivially_constructible(_Ty, _Args...);
// STRUCT TEMPLATE is_trivially_copy_constructible
template <class _Ty>
struct is_trivially_copy_constructible
: bool_constant<__is_trivially_constructible(_Ty, add_lvalue_reference_t<const _Ty>)> {
@ -765,7 +698,6 @@ template <class _Ty>
_INLINE_VAR constexpr bool is_trivially_copy_constructible_v = __is_trivially_constructible(
_Ty, add_lvalue_reference_t<const _Ty>);
// STRUCT TEMPLATE is_trivially_default_constructible
template <class _Ty>
struct is_trivially_default_constructible : bool_constant<__is_trivially_constructible(_Ty)> {
// determine whether value-initialization of _Ty is trivial
@ -774,7 +706,6 @@ struct is_trivially_default_constructible : bool_constant<__is_trivially_constru
template <class _Ty>
_INLINE_VAR constexpr bool is_trivially_default_constructible_v = __is_trivially_constructible(_Ty);
// STRUCT TEMPLATE is_trivially_move_constructible
template <class _Ty>
struct is_trivially_move_constructible : bool_constant<__is_trivially_constructible(_Ty, _Ty)> {
// determine whether direct-initialization of _Ty with an rvalue _Ty is trivial
@ -783,7 +714,6 @@ struct is_trivially_move_constructible : bool_constant<__is_trivially_constructi
template <class _Ty>
_INLINE_VAR constexpr bool is_trivially_move_constructible_v = __is_trivially_constructible(_Ty, _Ty);
// STRUCT TEMPLATE is_trivially_assignable
template <class _To, class _From>
struct is_trivially_assignable : bool_constant<__is_trivially_assignable(_To, _From)> {
// determine whether _From can be trivially assigned to _To
@ -792,7 +722,6 @@ struct is_trivially_assignable : bool_constant<__is_trivially_assignable(_To, _F
template <class _To, class _From>
_INLINE_VAR constexpr bool is_trivially_assignable_v = __is_trivially_assignable(_To, _From);
// STRUCT TEMPLATE is_trivially_copy_assignable
template <class _Ty>
struct is_trivially_copy_assignable
: bool_constant<__is_trivially_assignable(add_lvalue_reference_t<_Ty>, add_lvalue_reference_t<const _Ty>)> {
@ -803,7 +732,6 @@ template <class _Ty>
_INLINE_VAR constexpr bool is_trivially_copy_assignable_v = __is_trivially_assignable(
add_lvalue_reference_t<_Ty>, add_lvalue_reference_t<const _Ty>);
// STRUCT TEMPLATE is_trivially_move_assignable
template <class _Ty>
struct is_trivially_move_assignable : bool_constant<__is_trivially_assignable(add_lvalue_reference_t<_Ty>, _Ty)> {
// determine whether an rvalue _Ty can be trivially assigned to an lvalue _Ty
@ -812,7 +740,6 @@ struct is_trivially_move_assignable : bool_constant<__is_trivially_assignable(ad
template <class _Ty>
_INLINE_VAR constexpr bool is_trivially_move_assignable_v = __is_trivially_assignable(add_lvalue_reference_t<_Ty>, _Ty);
// STRUCT TEMPLATE is_trivially_destructible
template <class _Ty>
struct is_trivially_destructible : bool_constant<__is_trivially_destructible(_Ty)> {
// determine whether remove_all_extents_t<_Ty> is a reference type or can trivially be explicitly destroyed
@ -821,8 +748,6 @@ struct is_trivially_destructible : bool_constant<__is_trivially_destructible(_Ty
template <class _Ty>
_INLINE_VAR constexpr bool is_trivially_destructible_v = __is_trivially_destructible(_Ty);
// NOTHROW TRAITS
// STRUCT TEMPLATE is_nothrow_constructible
template <class _Ty, class... _Args>
struct is_nothrow_constructible : bool_constant<__is_nothrow_constructible(_Ty, _Args...)> {
// determine whether direct-initialization of _Ty from _Args... is both valid and not potentially-throwing
@ -831,7 +756,6 @@ struct is_nothrow_constructible : bool_constant<__is_nothrow_constructible(_Ty,
template <class _Ty, class... _Args>
_INLINE_VAR constexpr bool is_nothrow_constructible_v = __is_nothrow_constructible(_Ty, _Args...);
// STRUCT TEMPLATE is_nothrow_copy_constructible
template <class _Ty>
struct is_nothrow_copy_constructible
: bool_constant<__is_nothrow_constructible(_Ty, add_lvalue_reference_t<const _Ty>)> {
@ -843,7 +767,6 @@ template <class _Ty>
_INLINE_VAR constexpr bool is_nothrow_copy_constructible_v = __is_nothrow_constructible(
_Ty, add_lvalue_reference_t<const _Ty>);
// STRUCT TEMPLATE is_nothrow_default_constructible
template <class _Ty>
struct is_nothrow_default_constructible : bool_constant<__is_nothrow_constructible(_Ty)> {
// determine whether value-initialization of _Ty is both valid and not potentially-throwing
@ -852,7 +775,6 @@ struct is_nothrow_default_constructible : bool_constant<__is_nothrow_constructib
template <class _Ty>
_INLINE_VAR constexpr bool is_nothrow_default_constructible_v = __is_nothrow_constructible(_Ty);
// STRUCT TEMPLATE is_nothrow_move_constructible
template <class _Ty>
struct is_nothrow_move_constructible : bool_constant<__is_nothrow_constructible(_Ty, _Ty)> {
// determine whether direct-initialization of _Ty from an rvalue _Ty is both valid and not potentially-throwing
@ -861,7 +783,6 @@ struct is_nothrow_move_constructible : bool_constant<__is_nothrow_constructible(
template <class _Ty>
_INLINE_VAR constexpr bool is_nothrow_move_constructible_v = __is_nothrow_constructible(_Ty, _Ty);
// STRUCT TEMPLATE is_nothrow_assignable
template <class _To, class _From>
struct is_nothrow_assignable : bool_constant<__is_nothrow_assignable(_To, _From)> {
// determine whether assignment of _From to _To is both valid and not potentially-throwing
@ -870,7 +791,6 @@ struct is_nothrow_assignable : bool_constant<__is_nothrow_assignable(_To, _From)
template <class _To, class _From>
_INLINE_VAR constexpr bool is_nothrow_assignable_v = __is_nothrow_assignable(_To, _From);
// STRUCT TEMPLATE is_nothrow_copy_assignable
template <class _Ty>
struct is_nothrow_copy_assignable
: bool_constant<__is_nothrow_assignable(add_lvalue_reference_t<_Ty>, add_lvalue_reference_t<const _Ty>)> {
@ -881,7 +801,6 @@ template <class _Ty>
_INLINE_VAR constexpr bool is_nothrow_copy_assignable_v = __is_nothrow_assignable(
add_lvalue_reference_t<_Ty>, add_lvalue_reference_t<const _Ty>);
// STRUCT TEMPLATE is_nothrow_move_assignable
template <class _Ty>
struct is_nothrow_move_assignable : bool_constant<__is_nothrow_assignable(add_lvalue_reference_t<_Ty>, _Ty)> {
// determine whether assignment of an rvalue _Ty to an lvalue _Ty is both valid and not potentially-throwing
@ -890,7 +809,6 @@ struct is_nothrow_move_assignable : bool_constant<__is_nothrow_assignable(add_lv
template <class _Ty>
_INLINE_VAR constexpr bool is_nothrow_move_assignable_v = __is_nothrow_assignable(add_lvalue_reference_t<_Ty>, _Ty);
// STRUCT TEMPLATE is_nothrow_destructible
template <class _Ty>
struct is_nothrow_destructible : bool_constant<__is_nothrow_destructible(_Ty)> {
// determine whether remove_all_extents_t<_Ty> is a reference type or has
@ -900,7 +818,6 @@ struct is_nothrow_destructible : bool_constant<__is_nothrow_destructible(_Ty)> {
template <class _Ty>
_INLINE_VAR constexpr bool is_nothrow_destructible_v = __is_nothrow_destructible(_Ty);
// STRUCT TEMPLATE is_signed
template <class _Ty, bool = is_integral_v<_Ty>>
struct _Sign_base { // determine whether integral type _Ty is signed or unsigned
using _Uty = remove_cv_t<_Ty>;
@ -922,18 +839,15 @@ struct is_signed : bool_constant<_Sign_base<_Ty>::_Signed> {}; // determine whet
template <class _Ty>
_INLINE_VAR constexpr bool is_signed_v = _Sign_base<_Ty>::_Signed;
// STRUCT TEMPLATE is_unsigned
template <class _Ty>
struct is_unsigned : bool_constant<_Sign_base<_Ty>::_Unsigned> {}; // determine whether _Ty is an unsigned type
template <class _Ty>
_INLINE_VAR constexpr bool is_unsigned_v = _Sign_base<_Ty>::_Unsigned;
// VARIABLE TEMPLATE _Is_nonbool_integral
template <class _Ty>
_INLINE_VAR constexpr bool _Is_nonbool_integral = is_integral_v<_Ty> && !is_same_v<remove_cv_t<_Ty>, bool>;
// STRUCT TEMPLATE make_signed
template <bool>
struct _Select { // Select between aliases that extract either their first or second parameter
template <class _Ty1, class>
@ -990,7 +904,6 @@ struct make_signed { // signed partner to _Ty
template <class _Ty>
using make_signed_t = typename make_signed<_Ty>::type;
// STRUCT TEMPLATE make_unsigned
template <size_t>
struct _Make_unsigned2; // Choose make_unsigned strategy by type size
@ -1036,20 +949,17 @@ struct make_unsigned { // unsigned partner to _Ty
template <class _Ty>
using make_unsigned_t = typename make_unsigned<_Ty>::type;
// FUNCTION TEMPLATE _Unsigned_value
template <class _Rep>
constexpr make_unsigned_t<_Rep> _Unsigned_value(_Rep _Val) { // makes _Val unsigned
return static_cast<make_unsigned_t<_Rep>>(_Val);
}
// STRUCT TEMPLATE alignment_of
template <class _Ty>
struct alignment_of : integral_constant<size_t, alignof(_Ty)> {}; // determine alignment of _Ty
template <class _Ty>
_INLINE_VAR constexpr size_t alignment_of_v = alignof(_Ty);
// STRUCT TEMPLATE aligned_storage
template <class _Ty, size_t _Len>
union _Align_type { // union with size _Len bytes and alignment of _Ty
_Ty _Val;
@ -1119,7 +1029,6 @@ struct aligned_storage { // define type with size _Len and alignment _Align
template <size_t _Len, size_t _Align = alignof(max_align_t)>
using aligned_storage_t = typename aligned_storage<_Len, _Align>::type;
// STRUCT TEMPLATE aligned_union
template <size_t... _Vals>
struct _Maximum;
@ -1145,7 +1054,6 @@ struct aligned_union { // define type with size at least _Len, for storing anyth
template <size_t _Len, class... _Types>
using aligned_union_t = typename aligned_union<_Len, _Types...>::type;
// STRUCT TEMPLATE underlying_type
template <class _Ty, bool = is_enum_v<_Ty>>
struct _Underlying_type {
using type = __underlying_type(_Ty);
@ -1160,7 +1068,6 @@ struct underlying_type : _Underlying_type<_Ty> {}; // determine underlying type
template <class _Ty>
using underlying_type_t = typename _Underlying_type<_Ty>::type;
// STRUCT TEMPLATE rank
template <class _Ty>
_INLINE_VAR constexpr size_t rank_v = 0; // determine number of dimensions of array _Ty
@ -1173,7 +1080,6 @@ _INLINE_VAR constexpr size_t rank_v<_Ty[]> = rank_v<_Ty> + 1;
template <class _Ty>
struct rank : integral_constant<size_t, rank_v<_Ty>> {};
// STRUCT TEMPLATE extent
template <class _Ty, unsigned int _Ix = 0>
_INLINE_VAR constexpr size_t extent_v = 0; // determine extent of dimension _Ix of array _Ty
@ -1189,7 +1095,6 @@ _INLINE_VAR constexpr size_t extent_v<_Ty[], _Ix> = extent_v<_Ty, _Ix - 1>;
template <class _Ty, unsigned int _Ix = 0>
struct extent : integral_constant<size_t, extent_v<_Ty, _Ix>> {};
// STRUCT TEMPLATE is_base_of
template <class _Base, class _Derived>
struct is_base_of : bool_constant<__is_base_of(_Base, _Derived)> {
// determine whether _Base is a base of or the same as _Derived
@ -1198,7 +1103,6 @@ struct is_base_of : bool_constant<__is_base_of(_Base, _Derived)> {
template <class _Base, class _Derived>
_INLINE_VAR constexpr bool is_base_of_v = __is_base_of(_Base, _Derived);
// STRUCT TEMPLATE decay
template <class _Ty>
struct decay { // determines decayed version of _Ty
using _Ty1 = remove_reference_t<_Ty>;
@ -1209,11 +1113,9 @@ struct decay { // determines decayed version of _Ty
template <class _Ty>
using decay_t = typename decay<_Ty>::type;
// ALIAS TEMPLATE _Conditional_type
template <class _Ty1, class _Ty2>
using _Conditional_type = decltype(false ? _STD declval<_Ty1>() : _STD declval<_Ty2>());
// STRUCT TEMPLATE common_type
#if _HAS_CXX20
template <class _Ty1, class _Ty2, class = void>
struct _Const_lvalue_cond_oper {};
@ -1269,20 +1171,16 @@ template <class _Ty1, class _Ty2, class... _Rest>
struct common_type<_Ty1, _Ty2, _Rest...> : _Common_type3<void, _Ty1, _Ty2, _Rest...> {};
#if _HAS_CXX20
// STRUCT TEMPLATE basic_common_reference
template <class, class, template <class> class, template <class> class>
struct basic_common_reference {};
// FUNCTION TEMPLATE _Returns_exactly
template <class _Ty>
_Ty _Returns_exactly() noexcept; // not defined
// ALIAS TEMPLATE _Cond_res
template <class _Ty1, class _Ty2>
using _Cond_res = // N4810 [meta.trans.other]/2.4
decltype(false ? _Returns_exactly<_Ty1>() : _Returns_exactly<_Ty2>());
// ALIAS TEMPLATE _Copy_cv
template <class _From>
struct _Copy_cv_impl {
template <class _To>
@ -1307,7 +1205,6 @@ template <class _From, class _To>
using _Copy_cv = // N4810 [meta.trans.other]/2.3
typename _Copy_cv_impl<_From>::template _Apply<_To>;
// STRUCT TEMPLATE _Add_qualifiers
template <class _Ty1>
struct _Add_qualifiers { // _Add_qualifiers<A>::template _Apply is XREF(A) from N4810 [meta.trans.other]/2.1
template <class _Ty2>
@ -1324,11 +1221,9 @@ struct _Add_qualifiers<_Ty1&&> {
using _Apply = add_rvalue_reference_t<_Copy_cv<_Ty1, _Ty2>>;
};
// STRUCT TEMPLATE common_reference
template <class...>
struct common_reference;
// ALIAS TEMPLATE common_reference_t
template <class... _Types>
using common_reference_t = typename common_reference<_Types...>::type;
@ -1415,7 +1310,6 @@ template <class _Ty1, class _Ty2, class _Ty3, class... _Rest>
struct common_reference<_Ty1, _Ty2, _Ty3, _Rest...> : _Fold_common_reference<void, _Ty1, _Ty2, _Ty3, _Rest...> {};
#endif // _HAS_CXX20
// STRUCT TEMPLATE _Identity
template <class _Ty>
struct _Identity {
using type = _Ty;
@ -1424,7 +1318,6 @@ template <class _Ty>
using _Identity_t = typename _Identity<_Ty>::type;
#if _HAS_CXX20
// STRUCT TEMPLATE type_identity
template <class _Ty>
struct type_identity {
using type = _Ty;
@ -1433,7 +1326,6 @@ template <class _Ty>
using type_identity_t = typename type_identity<_Ty>::type;
#endif // _HAS_CXX20
// STRUCT TEMPLATE _Is_specialization
template <class _Type, template <class...> class _Template>
_INLINE_VAR constexpr bool _Is_specialization_v = false; // true if and only if _Type is a specialization of _Template
template <template <class...> class _Template, class... _Types>
@ -1442,7 +1334,6 @@ _INLINE_VAR constexpr bool _Is_specialization_v<_Template<_Types...>, _Template>
template <class _Type, template <class...> class _Template>
struct _Is_specialization : bool_constant<_Is_specialization_v<_Type, _Template>> {};
// FUNCTION TEMPLATE forward
template <class _Ty>
_NODISCARD constexpr _Ty&& forward(
remove_reference_t<_Ty>& _Arg) noexcept { // forward an lvalue as either an lvalue or an rvalue
@ -1455,13 +1346,11 @@ _NODISCARD constexpr _Ty&& forward(remove_reference_t<_Ty>&& _Arg) noexcept { //
return static_cast<_Ty&&>(_Arg);
}
// FUNCTION TEMPLATE move
template <class _Ty>
_NODISCARD constexpr remove_reference_t<_Ty>&& move(_Ty&& _Arg) noexcept { // forward _Arg as movable
return static_cast<remove_reference_t<_Ty>&&>(_Arg);
}
// FUNCTION TEMPLATE move_if_noexcept
template <class _Ty>
_NODISCARD constexpr conditional_t<!is_nothrow_move_constructible_v<_Ty> && is_copy_constructible_v<_Ty>, const _Ty&,
_Ty&&>
@ -1476,7 +1365,6 @@ class reference_wrapper;
// (WG21-N4842 [constexpr.functions]/1), yet both std::apply and std::visit are required to be constexpr and have
// invoke-like behavior. As a result, we've chosen to apply the part of P1065R2 resolving LWG-2894 as a defect report.
// FUNCTION TEMPLATE invoke
#pragma warning(push) // TRANSITION, DevCom-936696
#pragma warning(disable : 28278) // Function '%s' appears with no prototype in scope
enum class _Invoker_strategy {
@ -1615,7 +1503,6 @@ _CONSTEXPR17 auto invoke(_Callable&& _Obj, _Ty1&& _Arg1, _Types2&&... _Args2) no
}
#pragma warning(pop) // TRANSITION, DevCom-936696
// TYPE TRAITS FOR invoke()
#pragma warning(push)
#pragma warning(disable : 4242) // '%s': conversion from '%s' to '%s', possible loss of data (/Wall)
#pragma warning(disable : 4244) // '%s': conversion from '%s' to '%s', possible loss of data (Yes, duplicated message.)
@ -1728,7 +1615,6 @@ using _Select_invoke_traits = conditional_t<sizeof...(_Args) == 0, _Invoke_trait
_Invoke_traits_nonzero<void, _Callable, _Args...>>;
#if _HAS_DEPRECATED_RESULT_OF
// STRUCT TEMPLATE result_of
template <class _Fty>
struct _CXX17_DEPRECATE_RESULT_OF result_of { // explain usage
static_assert(_Always_false<_Fty>, "result_of<CallableType> is invalid; use "
@ -1762,7 +1648,6 @@ struct _Is_invocable_r : _Is_invocable_r_<_Rx, _Callable, _Args...> {
};
#if _HAS_CXX17
// STRUCT TEMPLATE invoke_result
template <class _Callable, class... _Args>
struct invoke_result : _Select_invoke_traits<_Callable, _Args...> {
// determine the result type of invoking _Callable with _Args
@ -1771,7 +1656,6 @@ struct invoke_result : _Select_invoke_traits<_Callable, _Args...> {
template <class _Callable, class... _Args>
using invoke_result_t = typename _Select_invoke_traits<_Callable, _Args...>::type;
// STRUCT TEMPLATE is_invocable
template <class _Callable, class... _Args>
struct is_invocable : _Select_invoke_traits<_Callable, _Args...>::_Is_invocable {
// determines whether _Callable is callable with _Args
@ -1780,7 +1664,6 @@ struct is_invocable : _Select_invoke_traits<_Callable, _Args...>::_Is_invocable
template <class _Callable, class... _Args>
inline constexpr bool is_invocable_v = _Select_invoke_traits<_Callable, _Args...>::_Is_invocable::value;
// STRUCT TEMPLATE is_nothrow_invocable
template <class _Callable, class... _Args>
struct is_nothrow_invocable : _Select_invoke_traits<_Callable, _Args...>::_Is_nothrow_invocable {
// determines whether _Callable is nothrow-callable with _Args
@ -1789,7 +1672,6 @@ struct is_nothrow_invocable : _Select_invoke_traits<_Callable, _Args...>::_Is_no
template <class _Callable, class... _Args>
inline constexpr bool is_nothrow_invocable_v = _Select_invoke_traits<_Callable, _Args...>::_Is_nothrow_invocable::value;
// STRUCT TEMPLATE is_invocable_r
template <class _Rx, class _Callable, class... _Args>
struct is_invocable_r : _Is_invocable_r_<_Rx, _Callable, _Args...> {
// determines whether _Callable is callable with _Args and return type _Rx
@ -1798,7 +1680,6 @@ struct is_invocable_r : _Is_invocable_r_<_Rx, _Callable, _Args...> {
template <class _Rx, class _Callable, class... _Args>
inline constexpr bool is_invocable_r_v = _Is_invocable_r_<_Rx, _Callable, _Args...>::value;
// STRUCT TEMPLATE is_nothrow_invocable_r
template <class _Rx, class _Callable, class... _Args>
struct is_nothrow_invocable_r : _Select_invoke_traits<_Callable, _Args...>::template _Is_nothrow_invocable_r<_Rx> {
// determines whether _Callable is nothrow-callable with _Args and return type _Rx
@ -1812,27 +1693,23 @@ inline constexpr bool is_nothrow_invocable_r_v =
#if _HAS_CXX20
#ifndef __EDG__ // TRANSITION, VSO-1268984
#ifndef __clang__ // TRANSITION, LLVM-48860
// STRUCT TEMPLATE is_layout_compatible
template <class _Ty1, class _Ty2>
struct is_layout_compatible : bool_constant<__is_layout_compatible(_Ty1, _Ty2)> {};
template <class _Ty1, class _Ty2>
inline constexpr bool is_layout_compatible_v = __is_layout_compatible(_Ty1, _Ty2);
// STRUCT TEMPLATE is_pointer_interconvertible_base_of
template <class _Base, class _Derived>
struct is_pointer_interconvertible_base_of : bool_constant<__is_pointer_interconvertible_base_of(_Base, _Derived)> {};
template <class _Base, class _Derived>
inline constexpr bool is_pointer_interconvertible_base_of_v = __is_pointer_interconvertible_base_of(_Base, _Derived);
// FUNCTION TEMPLATE is_pointer_interconvertible_with_class
template <class _ClassTy, class _MemberTy>
_NODISCARD constexpr bool is_pointer_interconvertible_with_class(_MemberTy _ClassTy::*_Pm) noexcept {
return __is_pointer_interconvertible_with_class(_ClassTy, _Pm);
}
// FUNCTION TEMPLATE is_corresponding_member
template <class _ClassTy1, class _ClassTy2, class _MemberTy1, class _MemberTy2>
_NODISCARD constexpr bool is_corresponding_member(_MemberTy1 _ClassTy1::*_Pm1, _MemberTy2 _ClassTy2::*_Pm2) noexcept {
return __is_corresponding_member(_ClassTy1, _ClassTy2, _Pm1, _Pm2);
@ -1841,7 +1718,6 @@ _NODISCARD constexpr bool is_corresponding_member(_MemberTy1 _ClassTy1::*_Pm1, _
#endif // __EDG__
#endif // _HAS_CXX20
// ALIAS TEMPLATE _Weak_types
template <class _Ty>
struct _Function_args {}; // determine whether _Ty is a function
@ -1901,7 +1777,6 @@ template <class _Ty>
using _Weak_types = conditional_t<is_function_v<remove_pointer_t<_Ty>>, _Function_args<remove_pointer_t<_Ty>>,
conditional_t<is_member_function_pointer_v<_Ty>, _Is_memfunptr<remove_cv_t<_Ty>>, _Weak_binary_args<_Ty>>>;
// CLASS TEMPLATE reference_wrapper
template <class _Ty>
void _Refwrap_ctor_fun(_Identity_t<_Ty&>) noexcept;
template <class _Ty>
@ -1958,7 +1833,6 @@ template <class _Ty>
reference_wrapper(_Ty&) -> reference_wrapper<_Ty>;
#endif // _HAS_CXX17
// FUNCTION TEMPLATES ref AND cref
template <class _Ty>
_NODISCARD _CONSTEXPR20 reference_wrapper<_Ty> ref(_Ty& _Val) noexcept {
return reference_wrapper<_Ty>(_Val);
@ -1986,7 +1860,6 @@ _NODISCARD _CONSTEXPR20 reference_wrapper<const _Ty> cref(reference_wrapper<_Ty>
}
#if _HAS_CXX20
// STRUCT TEMPLATE unwrap_reference
template <class _Ty>
struct unwrap_reference {
using type = _Ty;
@ -1998,7 +1871,6 @@ struct unwrap_reference<reference_wrapper<_Ty>> {
template <class _Ty>
using unwrap_reference_t = typename unwrap_reference<_Ty>::type;
// STRUCT TEMPLATE unwrap_ref_decay
template <class _Ty>
using unwrap_ref_decay_t = unwrap_reference_t<decay_t<_Ty>>;
template <class _Ty>
@ -2007,15 +1879,12 @@ struct unwrap_ref_decay {
};
#endif // _HAS_CXX20
// STRUCT TEMPLATE _Is_swappable
template <class _Ty>
struct _Is_swappable;
// STRUCT TEMPLATE _Is_nothrow_swappable
template <class _Ty>
struct _Is_nothrow_swappable;
// FUNCTION TEMPLATE swap
#if _HAS_CXX17
template <class _Ty, enable_if_t<is_move_constructible_v<_Ty> && is_move_assignable_v<_Ty>, int> = 0>
#else // ^^^ _HAS_CXX17 / !_HAS_CXX17 vvv
@ -2026,7 +1895,6 @@ _CONSTEXPR20 void swap(_Ty&, _Ty&) noexcept(is_nothrow_move_constructible_v<_Ty>
template <class _Ty, size_t _Size, enable_if_t<_Is_swappable<_Ty>::value, int> = 0>
_CONSTEXPR20 void swap(_Ty (&)[_Size], _Ty (&)[_Size]) noexcept(_Is_nothrow_swappable<_Ty>::value);
// STRUCT TEMPLATE _Swappable_with_helper
template <class _Ty1, class _Ty2, class = void>
struct _Swappable_with_helper : false_type {}; // swap(declval<_Ty1>(), declval<_Ty2>()) is not valid
@ -2034,20 +1902,17 @@ template <class _Ty1, class _Ty2>
struct _Swappable_with_helper<_Ty1, _Ty2, void_t<decltype(swap(_STD declval<_Ty1>(), _STD declval<_Ty2>()))>>
: true_type {}; // swap(declval<_Ty1>(), declval<_Ty2>()) is valid
// STRUCT TEMPLATE _Is_swappable_with
template <class _Ty1, class _Ty2>
struct _Is_swappable_with
: bool_constant<conjunction_v<_Swappable_with_helper<_Ty1, _Ty2>, _Swappable_with_helper<_Ty2, _Ty1>>> {
// Determine if expressions with type and value category _Ty1 and _Ty2 can be swapped (and vice versa)
};
// STRUCT TEMPLATE _Is_swappable
template <class _Ty>
struct _Is_swappable : _Is_swappable_with<add_lvalue_reference_t<_Ty>, add_lvalue_reference_t<_Ty>>::type {
// Determine if _Ty lvalues satisfy is_swappable_with
};
// STRUCT TEMPLATE _Swap_cannot_throw
template <class _Ty1, class _Ty2>
struct _Swap_cannot_throw : bool_constant<noexcept(swap(_STD declval<_Ty1>(), _STD declval<_Ty2>())) //
&& noexcept(swap(_STD declval<_Ty2>(), _STD declval<_Ty1>()))> {
@ -2055,7 +1920,6 @@ struct _Swap_cannot_throw : bool_constant<noexcept(swap(_STD declval<_Ty1>(), _S
// (presumed to satisfy is_swappable_with) can be swapped without emitting exceptions
};
// STRUCT TEMPLATE _Is_nothrow_swappable_with
template <class _Ty1, class _Ty2>
struct _Is_nothrow_swappable_with
: bool_constant<conjunction_v<_Is_swappable_with<_Ty1, _Ty2>, _Swap_cannot_throw<_Ty1, _Ty2>>> {
@ -2063,7 +1927,6 @@ struct _Is_nothrow_swappable_with
// satisfy is_swappable_with, and can be swapped without emitting exceptions
};
// STRUCT TEMPLATE _Is_nothrow_swappable
template <class _Ty>
struct _Is_nothrow_swappable
: _Is_nothrow_swappable_with<add_lvalue_reference_t<_Ty>, add_lvalue_reference_t<_Ty>>::type {
@ -2071,7 +1934,6 @@ struct _Is_nothrow_swappable
};
#if _HAS_CXX17
// STRUCT TEMPLATE is_swappable_with
template <class _Ty1, class _Ty2>
struct is_swappable_with : _Is_swappable_with<_Ty1, _Ty2>::type {
// Determine if expressions with type and value category _Ty1 and _Ty2
@ -2082,14 +1944,12 @@ template <class _Ty1, class _Ty2>
inline constexpr bool is_swappable_with_v =
conjunction_v<_Swappable_with_helper<_Ty1, _Ty2>, _Swappable_with_helper<_Ty2, _Ty1>>;
// STRUCT TEMPLATE is_swappable
template <class _Ty>
struct is_swappable : _Is_swappable<_Ty>::type {}; // Determine if _Ty lvalues satisfy is_swappable_with
template <class _Ty>
inline constexpr bool is_swappable_v = _Is_swappable<_Ty>::value;
// STRUCT TEMPLATE is_nothrow_swappable_with
template <class _Ty1, class _Ty2>
struct is_nothrow_swappable_with : _Is_nothrow_swappable_with<_Ty1, _Ty2>::type {
// Determine if expressions with type and value category _Ty1 and _Ty2
@ -2099,7 +1959,6 @@ struct is_nothrow_swappable_with : _Is_nothrow_swappable_with<_Ty1, _Ty2>::type
template <class _Ty1, class _Ty2>
inline constexpr bool is_nothrow_swappable_with_v = _Is_nothrow_swappable_with<_Ty1, _Ty2>::value;
// STRUCT TEMPLATE is_nothrow_swappable
template <class _Ty>
struct is_nothrow_swappable : _Is_nothrow_swappable<_Ty>::type {
// Determine if _Ty lvalues satisfy is_nothrow_swappable_with
@ -2109,7 +1968,6 @@ template <class _Ty>
inline constexpr bool is_nothrow_swappable_v = _Is_nothrow_swappable<_Ty>::value;
#endif // _HAS_CXX17
// TYPE TRAIT _Is_trivially_swappable
namespace _Has_ADL_swap_detail {
void swap(); // undefined (deliberate shadowing)
@ -2134,7 +1992,6 @@ struct _Is_trivially_swappable : bool_constant<_Is_trivially_swappable_v<_Ty>> {
// true_type if and only if it is valid to swap two _Ty lvalues by exchanging object representations.
};
// BITMASK OPERATIONS
#define _BITMASK_OPS(_BITMASK) \
_NODISCARD constexpr _BITMASK operator&(_BITMASK _Left, _BITMASK _Right) noexcept { /* return _Left & _Right */ \
using _IntTy = _STD underlying_type_t<_BITMASK>; \
@ -2178,9 +2035,8 @@ struct _Is_trivially_swappable : bool_constant<_Is_trivially_swappable_v<_Ty>> {
return (_Left & _Elements) == _Elements; \
}
// FNV-1a UTILITIES
// These functions are extremely performance sensitive, check examples like
// that in VSO-653642 before making changes.
// These FNV-1a utility functions are extremely performance sensitive,
// check examples like that in VSO-653642 before making changes.
#if defined(_WIN64)
_INLINE_VAR constexpr size_t _FNV_offset_basis = 14695981039346656037ULL;
_INLINE_VAR constexpr size_t _FNV_prime = 1099511628211ULL;
@ -2215,13 +2071,11 @@ _NODISCARD size_t _Fnv1a_append_value(
return _Fnv1a_append_bytes(_Val, &reinterpret_cast<const unsigned char&>(_Keyval), sizeof(_Kty));
}
// FUNCTION TEMPLATE _Hash_representation
template <class _Kty>
_NODISCARD size_t _Hash_representation(const _Kty& _Keyval) noexcept { // bitwise hashes the representation of a key
return _Fnv1a_append_value(_FNV_offset_basis, _Keyval);
}
// FUNCTION TEMPLATE _Hash_array_representation
template <class _Kty>
_NODISCARD size_t _Hash_array_representation(
const _Kty* const _First, const size_t _Count) noexcept { // bitwise hashes the representation of an array
@ -2230,7 +2084,6 @@ _NODISCARD size_t _Hash_array_representation(
_FNV_offset_basis, reinterpret_cast<const unsigned char*>(_First), _Count * sizeof(_Kty));
}
// STRUCT TEMPLATE _Conditionally_enabled_hash
template <class _Kty>
struct hash;
@ -2254,7 +2107,6 @@ struct _Conditionally_enabled_hash<_Kty, false> { // conditionally disabled hash
_Conditionally_enabled_hash& operator=(_Conditionally_enabled_hash&&) = delete;
};
// STRUCT TEMPLATE hash
template <class _Kty>
struct hash
: _Conditionally_enabled_hash<_Kty,
@ -2302,7 +2154,6 @@ struct hash<nullptr_t> {
}
};
// STRUCT TEMPLATE _Is_nothrow_hashable
template <class _Kty, class = void>
struct _Is_nothrow_hashable : false_type {}; // tests if std::hash can hash _Kty with noexcept

Просмотреть файл

@ -70,7 +70,6 @@ private:
const type_info* _Tptr;
};
// STRUCT TEMPLATE SPECIALIZATION hash
template <>
struct hash<type_index> {
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef type_index _ARGUMENT_TYPE_NAME;

Просмотреть файл

@ -29,7 +29,6 @@ constexpr int _Small_object_num_ptrs = 6 + 16 / sizeof(void*);
#if !_HAS_EXCEPTIONS
// CLASS bad_cast
class _CRTIMP2_IMPORT bad_cast : public exception { // base of all bad cast exceptions
public:
bad_cast(const char* _Message = "bad cast") noexcept : exception(_Message) {}
@ -42,7 +41,6 @@ protected:
}
};
// CLASS bad_typeid
class _CRTIMP2_IMPORT bad_typeid : public exception { // base of all bad typeid exceptions
public:
bad_typeid(const char* _Message = "bad typeid") noexcept : exception(_Message) {}

Просмотреть файл

@ -22,7 +22,6 @@ _STL_DISABLE_CLANG_WARNINGS
#undef new
_STD_BEGIN
// CLASS TEMPLATE _Umap_traits
template <class _Kty, // key type
class _Ty, // mapped type
class _Tr, // comparator predicate type
@ -63,7 +62,6 @@ public:
}
};
// CLASS TEMPLATE unordered_map
template <class _Kty, class _Ty, class _Hasher = hash<_Kty>, class _Keyeq = equal_to<_Kty>,
class _Alloc = allocator<pair<const _Kty, _Ty>>>
class unordered_map : public _Hash<_Umap_traits<_Kty, _Ty, _Uhash_compare<_Kty, _Hasher, _Keyeq>, _Alloc, false>> {
@ -476,7 +474,6 @@ _NODISCARD bool operator!=(const unordered_map<_Kty, _Ty, _Hasher, _Keyeq, _Allo
}
#endif // !_HAS_CXX20
// CLASS TEMPLATE unordered_multimap
template <class _Kty, class _Ty, class _Hasher = hash<_Kty>, class _Keyeq = equal_to<_Kty>,
class _Alloc = allocator<pair<const _Kty, _Ty>>>
class unordered_multimap : public _Hash<_Umap_traits<_Kty, _Ty, _Uhash_compare<_Kty, _Hasher, _Keyeq>, _Alloc, true>> {

Просмотреть файл

@ -22,7 +22,6 @@ _STL_DISABLE_CLANG_WARNINGS
#undef new
_STD_BEGIN
// CLASS TEMPLATE _Uset_traits
template <class _Kty, // key type (same as value type)
class _Tr, // comparator predicate type
class _Alloc, // actual allocator type (should be value allocator)
@ -60,7 +59,6 @@ public:
}
};
// CLASS TEMPLATE unordered_set
template <class _Kty, class _Hasher = hash<_Kty>, class _Keyeq = equal_to<_Kty>, class _Alloc = allocator<_Kty>>
class unordered_set : public _Hash<_Uset_traits<_Kty, _Uhash_compare<_Kty, _Hasher, _Keyeq>, _Alloc, false>> {
// hash table of key-values, unique keys
@ -330,7 +328,6 @@ _NODISCARD bool operator!=(const unordered_set<_Kty, _Hasher, _Keyeq, _Alloc>& _
}
#endif // !_HAS_CXX20
// CLASS TEMPLATE unordered_multiset
template <class _Kty, class _Hasher = hash<_Kty>, class _Keyeq = equal_to<_Kty>, class _Alloc = allocator<_Kty>>
class unordered_multiset : public _Hash<_Uset_traits<_Kty, _Uhash_compare<_Kty, _Hasher, _Keyeq>, _Alloc, true>> {
// hash table of key-values, non-unique keys

Просмотреть файл

@ -27,7 +27,6 @@ _STL_DISABLE_CLANG_WARNINGS
#undef new
_STD_BEGIN
// FUNCTION TEMPLATE max
template <class _Ty, class _Pr>
_NODISCARD constexpr const _Ty&(max) (const _Ty& _Left, const _Ty& _Right, _Pr _Pred) noexcept(
noexcept(_Pred(_Left, _Right))) /* strengthened */ {
@ -51,7 +50,6 @@ _NODISCARD constexpr _Ty(max)(initializer_list<_Ty>, _Pr); // implemented in <al
template <class _Ty>
_NODISCARD constexpr _Ty(max)(initializer_list<_Ty>); // implemented in <algorithm>
// FUNCTION TEMPLATE min
template <class _Ty, class _Pr>
_NODISCARD constexpr const _Ty&(min) (const _Ty& _Left, const _Ty& _Right, _Pr _Pred) noexcept(
noexcept(_Pred(_Right, _Left))) /* strengthened */ {
@ -75,13 +73,11 @@ _NODISCARD constexpr _Ty(min)(initializer_list<_Ty>, _Pr); // implemented in <al
template <class _Ty>
_NODISCARD constexpr _Ty(min)(initializer_list<_Ty>); // implemented in <algorithm>
// FUNCTION TEMPLATE iter_swap (from <algorithm>)
template <class _FwdIt1, class _FwdIt2>
_CONSTEXPR20 void iter_swap(_FwdIt1 _Left, _FwdIt2 _Right) { // swap *_Left and *_Right
swap(*_Left, *_Right);
}
// FUNCTION TEMPLATE swap
template <class _Ty, size_t _Size, enable_if_t<_Is_swappable<_Ty>::value, int> _Enabled>
_CONSTEXPR20 void swap(_Ty (&_Left)[_Size], _Ty (&_Right)[_Size]) noexcept(_Is_nothrow_swappable<_Ty>::value) {
if (&_Left != &_Right) {
@ -106,20 +102,17 @@ _CONSTEXPR20 void swap(_Ty& _Left, _Ty& _Right) noexcept(
_Right = _STD move(_Tmp);
}
// FUNCTION TEMPLATE _Swap_adl
template <class _Ty>
_CONSTEXPR20 void _Swap_adl(_Ty& _Left, _Ty& _Right) noexcept(_Is_nothrow_swappable<_Ty>::value) {
swap(_Left, _Right);
}
// STRUCT piecewise_construct_t
struct piecewise_construct_t { // tag type for pair tuple arguments
explicit piecewise_construct_t() = default;
};
_INLINE_VAR constexpr piecewise_construct_t piecewise_construct{};
// STRUCT TEMPLATE pair
template <class...>
class tuple;
@ -390,7 +383,6 @@ _NODISCARD constexpr bool operator>=(const pair<_Ty1, _Ty2>& _Left, const pair<_
}
#endif // ^^^ !defined(__cpp_lib_concepts) ^^^
// ALIAS TEMPLATE _Unrefwrap_t
template <class _Ty>
struct _Unrefwrap_helper { // leave unchanged if not a reference_wrapper
using type = _Ty;
@ -405,7 +397,6 @@ struct _Unrefwrap_helper<reference_wrapper<_Ty>> { // make a reference from a re
template <class _Ty>
using _Unrefwrap_t = typename _Unrefwrap_helper<decay_t<_Ty>>::type;
// FUNCTION TEMPLATE make_pair
template <class _Ty1, class _Ty2>
_NODISCARD constexpr pair<_Unrefwrap_t<_Ty1>, _Unrefwrap_t<_Ty2>> make_pair(_Ty1&& _Val1, _Ty2&& _Val2) noexcept(
is_nothrow_constructible_v<_Unrefwrap_t<_Ty1>, _Ty1>&&
@ -437,7 +428,6 @@ namespace _CXX20_DEPRECATE_REL_OPS rel_ops {
}
} // namespace rel_ops
// STRUCTS FOR STRUCTURED BINDINGS tuple_size AND tuple_element
template <class _Tuple>
struct tuple_size;
@ -486,7 +476,6 @@ struct _CXX20_DEPRECATE_VOLATILE _MSVC_KNOWN_SEMANTICS tuple_element<_Index, con
template <size_t _Index, class _Tuple>
using tuple_element_t = typename tuple_element<_Index, _Tuple>::type;
// TUPLE INTERFACE TO array
template <class _Ty, size_t _Size>
class array;
@ -500,7 +489,6 @@ struct _MSVC_KNOWN_SEMANTICS tuple_element<_Idx, array<_Ty, _Size>> {
using type = _Ty;
};
// TUPLE INTERFACE TO tuple
template <class... _Types>
struct tuple_size<tuple<_Types...>> : integral_constant<size_t, sizeof...(_Types)> {}; // size of tuple
@ -520,7 +508,6 @@ template <size_t _Index, class _This, class... _Rest>
struct _MSVC_KNOWN_SEMANTICS tuple_element<_Index, tuple<_This, _Rest...>>
: tuple_element<_Index - 1, tuple<_Rest...>> {}; // recursive tuple_element definition
// TUPLE INTERFACE TO pair
template <class _Ty1, class _Ty2>
struct tuple_size<pair<_Ty1, _Ty2>> : integral_constant<size_t, 2> {}; // size of pair
@ -613,7 +600,6 @@ _NODISCARD constexpr const _Ty2&& get(
return _STD get<1>(_STD move(_Pr));
}
// FUNCTION TEMPLATE exchange
template <class _Ty, class _Other = _Ty>
_CONSTEXPR20 _Ty exchange(_Ty& _Val, _Other&& _New_val) noexcept(
conjunction_v<is_nothrow_move_constructible<_Ty>, is_nothrow_assignable<_Ty&, _Other>>) /* strengthened */ {
@ -623,7 +609,6 @@ _CONSTEXPR20 _Ty exchange(_Ty& _Val, _Other&& _New_val) noexcept(
return _Old_val;
}
// FUNCTION TEMPLATE as_const
template <class _Ty>
_NODISCARD constexpr add_const_t<_Ty>& as_const(_Ty& _Val) noexcept { // view _Val through const lenses
return _Val;
@ -633,7 +618,6 @@ template <class _Ty>
void as_const(const _Ty&&) = delete;
#if _HAS_CXX17
// in_place TAG TYPE TEMPLATES
struct in_place_t { // tag used to select a constructor which initializes a contained object in place
explicit in_place_t() = default;
};
@ -666,7 +650,6 @@ inline constexpr bool _Is_standard_integer = is_integral_v<_Ty>
#endif // __cpp_char8_t
char16_t, char32_t>;
// FUNCTION TEMPLATE cmp_equal
template <class _Ty1, class _Ty2>
_NODISCARD constexpr bool cmp_equal(const _Ty1 _Left, const _Ty2 _Right) noexcept {
static_assert(_Is_standard_integer<_Ty1> && _Is_standard_integer<_Ty2>,
@ -680,13 +663,11 @@ _NODISCARD constexpr bool cmp_equal(const _Ty1 _Left, const _Ty2 _Right) noexcep
}
}
// FUNCTION TEMPLATE cmp_not_equal
template <class _Ty1, class _Ty2>
_NODISCARD constexpr bool cmp_not_equal(const _Ty1 _Left, const _Ty2 _Right) noexcept {
return !_STD cmp_equal(_Left, _Right);
}
// FUNCTION TEMPLATE cmp_less
template <class _Ty1, class _Ty2>
_NODISCARD constexpr bool cmp_less(const _Ty1 _Left, const _Ty2 _Right) noexcept {
static_assert(_Is_standard_integer<_Ty1> && _Is_standard_integer<_Ty2>,
@ -700,25 +681,21 @@ _NODISCARD constexpr bool cmp_less(const _Ty1 _Left, const _Ty2 _Right) noexcept
}
}
// FUNCTION TEMPLATE cmp_greater
template <class _Ty1, class _Ty2>
_NODISCARD constexpr bool cmp_greater(const _Ty1 _Left, const _Ty2 _Right) noexcept {
return _STD cmp_less(_Right, _Left);
}
// FUNCTION TEMPLATE cmp_less_equal
template <class _Ty1, class _Ty2>
_NODISCARD constexpr bool cmp_less_equal(const _Ty1 _Left, const _Ty2 _Right) noexcept {
return !_STD cmp_less(_Right, _Left);
}
// FUNCTION TEMPLATE cmp_greater_equal
template <class _Ty1, class _Ty2>
_NODISCARD constexpr bool cmp_greater_equal(const _Ty1 _Left, const _Ty2 _Right) noexcept {
return !_STD cmp_less(_Left, _Right);
}
// FUNCTION TEMPLATE in_range
template <class _Ty>
_NODISCARD _CONSTEVAL _Ty _Min_limit() noexcept { // same as (numeric_limits<_Ty>::min)(), less throughput cost
static_assert(_Is_standard_integer<_Ty>); // doesn't attempt to handle all types

Просмотреть файл

@ -19,7 +19,6 @@ _STL_DISABLE_CLANG_WARNINGS
#undef new
_STD_BEGIN
// FORWARD REFERENCES
class gslice;
class slice;
@ -34,7 +33,6 @@ class slice_array;
template <class _Ty>
class valarray;
// FUNCTION TEMPLATE _Allocate_for_op_delete
template <class _Ty>
_Ty* _Allocate_for_op_delete(size_t _Count) {
// allocates space for _Count objects of type _Ty
@ -57,7 +55,6 @@ _Ty* _Allocate_for_op_delete(size_t _Count) {
using _Boolarray = valarray<bool>;
using _Sizarray = valarray<size_t>;
// CLASS TEMPLATE valarray
template <class _Ty>
class valarray { // store array with various indexing options
private:
@ -1353,7 +1350,6 @@ _NODISCARD valarray<_Ty> tanh(const valarray<_Ty>& _Left) {
return _Ans;
}
// CLASS slice
class slice { // define a slice of a valarray
public:
slice() = default;
@ -1385,7 +1381,6 @@ protected:
size_t _Stride = 0; // the distance between elements
};
// CLASS TEMPLATE slice_array
template <class _Ty>
class slice_array : public slice { // define a slice of a valarray
public:
@ -1500,7 +1495,6 @@ private:
_Ty* _Myptr; // pointer to valarray contents
};
// CLASS gslice
class gslice { // define a generalized (multidimensional) slice of a valarray
public:
gslice() : _Start(0) {} // construct with all zeros
@ -1563,7 +1557,6 @@ private:
_Sizarray _Stride; // array of distances between elements
};
// CLASS TEMPLATE gslice_array
template <class _Ty>
class gslice_array : public gslice { // define a generalized slice of a valarray
public:
@ -1691,7 +1684,6 @@ private:
_Ty* _Myptr; // pointer to valarray contents
};
// CLASS TEMPLATE mask_array
template <class _Ty>
class mask_array { // define a subset of a valarray with an array of mask bits
public:
@ -1841,7 +1833,6 @@ private:
_Ty* _Myptr; // pointer to valarray contents
};
// CLASS TEMPLATE indirect_array
template <class _Ty>
class indirect_array { // define a subset of a valarray with an array of indexes
public:

Просмотреть файл

@ -35,7 +35,6 @@ _STL_DISABLE_CLANG_WARNINGS
_STD_BEGIN
// TYPE TRAITS
template <class...>
struct _All_same : true_type {};
template <class _First, class... _Rest>
@ -46,12 +45,10 @@ struct _Convertible_from_all : bool_constant<conjunction_v<is_convertible<_From,
// variadic is_convertible
};
// METAPROGRAMMING UTILITIES
template <class...>
struct _Meta_list {}; // a sequence of types
struct _Meta_nil {};
// ALIAS TEMPLATE _Meta_front
template <class _List>
struct _Meta_front_;
template <class _List>
@ -64,7 +61,6 @@ struct _Meta_front_<_List<_First, _Rest...>> {
using type = _First;
};
// ALIAS TEMPLATE _Meta_pop_front
template <class _List>
struct _Meta_pop_front_;
template <class _List>
@ -77,7 +73,6 @@ struct _Meta_pop_front_<_List<_First, _Rest...>> {
using type = _List<_Rest...>;
};
// ALIAS TEMPLATE _Meta_push_front
template <class _List, class _Ty>
struct _Meta_push_front_;
template <class _List, class _Ty>
@ -90,7 +85,6 @@ struct _Meta_push_front_<_List<_Types...>, _Ty> {
using type = _List<_Ty, _Types...>;
};
// STRUCT TEMPLATE _Meta_quote
template <class _Void, template <class...> class _Fn, class... _Args>
struct _Meta_quote_helper_;
template <template <class...> class _Fn, class... _Args>
@ -103,19 +97,16 @@ struct _Meta_quote { // encapsulate a template into a meta-callable type
using _Invoke = typename _Meta_quote_helper_<void, _Fn, _Types...>::type;
};
// ALIAS TEMPLATE _Meta_invoke
template <class _Fn, class... _Args>
using _Meta_invoke = // invoke meta-callable _Fn with _Args
typename _Fn::template _Invoke<_Args...>;
// STRUCT TEMPLATE _Meta_bind_back
template <class _Fn, class... _Args>
struct _Meta_bind_back { // construct a meta-callable that passes its arguments and _Args to _Fn
template <class... _Types>
using _Invoke = _Meta_invoke<_Fn, _Types..., _Args...>;
};
// ALIAS TEMPLATE _Meta_apply
template <class _Fn, class _List>
struct _Meta_apply_;
template <class _Fn, class _List>
@ -135,7 +126,6 @@ struct _Meta_apply_<_Fn,
using type = _Meta_invoke<_Fn, integral_constant<_Ty, _Idxs>...>;
};
// ALIAS TEMPLATE _Meta_transform
template <class _Fn, class _List>
struct _Meta_transform_;
template <class _Fn, class _List>
@ -148,7 +138,6 @@ struct _Meta_transform_<_Fn, _List<_Types...>> {
using type = _List<_Meta_invoke<_Fn, _Types>...>;
};
// ALIAS TEMPLATE _Meta_repeat_n_c
template <class, class, template <class...> class>
struct _Meta_repeat_n_c_;
template <size_t _Count, class _Ty, template <class...> class _Continue>
@ -164,7 +153,6 @@ struct _Meta_repeat_n_c_<_Ty, index_sequence<_Idxs...>, _Continue> {
using type = _Continue<_Meta_repeat_first_helper<_Ty, _Idxs>...>;
};
// ALIAS TEMPLATE _Meta_at_c
template <class _List, size_t _Idx, class = void>
struct _Meta_at_;
template <class _List, size_t _Idx>
@ -196,7 +184,6 @@ struct _Meta_at_<_List<_Types...>, _Idx, enable_if_t<(_Idx < sizeof...(_Types))>
};
#endif // __clang__
// ALIAS TEMPLATE _Meta_find_index
inline constexpr auto _Meta_npos = ~size_t{0};
template <class _List, class _Ty>
@ -225,7 +212,6 @@ struct _Meta_find_index_<_List<_First, _Rest...>, _Ty> {
using type = integral_constant<size_t, _Meta_find_index_i_(_Bools, 1 + sizeof...(_Rest))>;
};
// ALIAS TEMPLATE _Meta_find_unique_index
template <class _List, class _Ty>
struct _Meta_find_unique_index_ {
using type = integral_constant<size_t, _Meta_npos>;
@ -252,7 +238,6 @@ struct _Meta_find_unique_index_<_List<_First, _Rest...>, _Ty> {
_Meta_find_unique_index_i_(_Meta_find_index_<_List<_First, _Rest...>, _Ty>::_Bools, 1 + sizeof...(_Rest))>;
};
// ALIAS TEMPLATE _Meta_as_list
template <class>
struct _Meta_as_list_;
template <class _Ty>
@ -272,7 +257,6 @@ struct _Meta_as_list_<integer_sequence<_Ty, _Idxs...>> { // convert an integer_s
using type = _Meta_list<integral_constant<_Ty, _Idxs>...>;
};
// ALIAS TEMPLATE _Meta_as_integer_sequence
template <class _List>
struct _Meta_as_integer_sequence_;
template <class _List>
@ -285,7 +269,6 @@ struct _Meta_as_integer_sequence_<_List<integral_constant<_Ty, _Idxs>...>> {
using type = integer_sequence<_Ty, _Idxs...>;
};
// ALIAS TEMPLATE _Meta_concat
template <class...>
struct _Meta_concat_;
template <class... _Types>
@ -318,13 +301,11 @@ struct _Meta_concat_<_List<_Items1...>, _List<_Items2...>, _List<_Items3...>, _R
using type = _Meta_concat<_List<_Items1..., _Items2..., _Items3...>, _Rest...>;
};
// ALIAS TEMPLATE _Meta_join
template <class _ListOfLists>
using _Meta_join =
// transform a list of lists of elements into a single list containing those elements
_Meta_apply<_Meta_quote<_Meta_concat>, _ListOfLists>;
// ALIAS TEMPLATE _Meta_cartesian_product
template <class>
struct _Meta_cartesian_product_;
template <class _ListOfLists>
@ -371,11 +352,9 @@ struct _Meta_cartesian_product_<_List1<_List2<_Items...>, _Lists...>> {
#define _STL_STAMP(n, x) x(_STL_STAMP##n, n)
// VARIANT OF VALUE TYPES [variant.variant]
template <class... _Types>
class variant;
// VARIANT HELPER CLASSES [variant.helper]
template <class _Ty>
struct variant_size; // undefined
template <class _Ty>
@ -419,7 +398,6 @@ struct variant_alternative<_Idx, variant<_Types...>> {
inline constexpr size_t variant_npos = _Meta_npos;
// CLASS bad_variant_access [variant.bad.access]
class bad_variant_access
: public exception { // exception for visit of a valueless variant or get<I> on a variant with index() != I
public:
@ -444,7 +422,6 @@ protected:
template <bool _TrivialDestruction, class... _Types>
class _Variant_storage_ {}; // empty storage (empty "_Types" case)
// ALIAS TEMPLATE _Variant_storage
template <class... _Types>
using _Variant_storage = _Variant_storage_<conjunction_v<is_trivially_destructible<_Types>...>, _Types...>;
@ -584,7 +561,6 @@ public:
};
#endif // __cplusplus_winrt
// _Variant_storage VISITATION AND ACCESS
template <size_t _Idx, class _Storage>
_NODISCARD constexpr decltype(auto) _Variant_raw_get(
_Storage&& _Obj) noexcept { // access the _Idx-th element of a _Variant_storage
@ -764,7 +740,6 @@ _NODISCARD constexpr _Variant_raw_visit_t<_Fn, _Storage> _Variant_raw_visit(
return _Variant_raw_visit1<_Strategy>::_Visit(_Idx, static_cast<_Fn&&>(_Func), static_cast<_Storage&&>(_Obj));
}
// STRUCT TEMPLATE _Variant_base
template <class...>
class _Variant_base;
@ -956,7 +931,6 @@ template <class... _Types>
using _Variant_destroy_layer = conditional_t<conjunction_v<is_trivially_destructible<_Types>...>,
_Variant_base<_Types...>, _Variant_destroy_layer_<_Types...>>;
// CLASS TEMPLATE variant
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-volatile"
@ -1038,7 +1012,6 @@ public:
"variant<> (with no template arguments) may not be instantiated (N4835 [variant.variant]/3).");
using _Mybase = _SMF_control<_Variant_destroy_layer<_Types...>, _Types...>;
// constructors [variant.ctor]
template <class _First = _Meta_front<variant>, enable_if_t<is_default_constructible_v<_First>, int> = 0>
constexpr variant() noexcept(is_nothrow_default_constructible_v<_First>)
: _Mybase(in_place_index<0>) {} // value-initialize alternative 0
@ -1086,7 +1059,6 @@ public:
// initialize alternative _Idx from _Ilist and _Args...
}
// assignment [variant.assign]
template <class _Ty, enable_if_t<!is_same_v<_Remove_cvref_t<_Ty>, variant> //
&& is_constructible_v<_Variant_init_type<_Ty, _Types...>, _Ty> //
&& is_assignable_v<_Variant_init_type<_Ty, _Types...>&, _Ty>, //
@ -1113,7 +1085,6 @@ public:
return *this;
}
// modifiers [variant.mod]
using _Mybase::_Storage;
template <class _Ty, class... _ArgTypes, size_t _Idx = _Meta_find_unique_index<variant, _Ty>::value,
@ -1150,11 +1121,9 @@ public:
return _Emplace_valueless<_Idx>(_Ilist, static_cast<_ArgTypes&&>(_Args)...);
}
// value status [variant.status]
using _Mybase::index;
using _Mybase::valueless_by_exception;
// swap [variant.swap]
#ifdef __clang__ // TRANSITION, LLVM-45398
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-lambda-capture"
@ -1253,7 +1222,6 @@ private:
}
};
// VALUE ACCESS [variant.get]
template <class _Ty, class... _Types>
_NODISCARD constexpr bool holds_alternative(
const variant<_Types...>& _Var) noexcept { // true iff _Var holds alternative _Ty
@ -1367,7 +1335,6 @@ _NODISCARD constexpr add_pointer_t<const _Ty> get_if(
return _STD get_if<_Idx>(_Ptr);
}
// RELATIONAL OPERATORS [variant.relops]
template <class _Op, class _Result, class... _Types>
struct _Variant_relop_visitor2 { // evaluate _Op with the contained value of two variants that hold the same alternative
const _Variant_storage<_Types...>& _Left;
@ -1480,7 +1447,6 @@ _NODISCARD constexpr common_comparison_category_t<compare_three_way_result_t<_Ty
}
#endif // __cpp_lib_concepts
// VISITATION [variant.visit]
template <class... _Variants>
inline constexpr size_t _Variant_total_states =
(size_t{1} * ... * (variant_size_v<_Variants> + 1)); // +1 to account for the valueless state
@ -1716,7 +1682,6 @@ constexpr _Ret visit(_Callable&& _Obj, _Variants&&... _Args) {
}
#endif // _HAS_CXX20
// monostate RELATIONAL OPERATORS [variant.monostate.relops]
_NODISCARD constexpr bool operator==(monostate, monostate) noexcept {
return true;
}
@ -1743,14 +1708,12 @@ _NODISCARD constexpr bool operator>=(monostate, monostate) noexcept {
}
#endif // !_HAS_CXX20
// SPECIALIZED ALGORITHMS [variant.specalg]
template <class... _Types,
enable_if_t<conjunction_v<is_move_constructible<_Types>..., is_swappable<_Types>...>, int> = 0>
void swap(variant<_Types...>& _Left, variant<_Types...>& _Right) noexcept(noexcept(_Left.swap(_Right))) {
_Left.swap(_Right);
}
// HASH SUPPORT [variant.hash]
struct _Variant_hash_visitor { // visitation function for hashing variants
template <class _Ty, size_t _Idx>
_NODISCARD size_t operator()(_Tagged<const _Ty&, _Idx> _Obj) const

Просмотреть файл

@ -22,7 +22,6 @@ _STL_DISABLE_CLANG_WARNINGS
#undef new
_STD_BEGIN
// CLASS TEMPLATE _Vector_const_iterator
template <class _Myvec>
class _Vector_const_iterator : public _Iterator_base {
public:
@ -246,7 +245,6 @@ struct pointer_traits<_Vector_const_iterator<_Myvec>> {
};
#endif // _HAS_CXX20
// CLASS TEMPLATE _Vector_iterator
template <class _Myvec>
class _Vector_iterator : public _Vector_const_iterator<_Myvec> {
public:
@ -372,7 +370,6 @@ struct pointer_traits<_Vector_iterator<_Myvec>> {
};
#endif // _HAS_CXX20
// vector TYPE WRAPPERS
template <class _Value_type, class _Size_type, class _Difference_type, class _Pointer, class _Const_pointer,
class _Reference, class _Const_reference>
struct _Vec_iter_types {
@ -383,12 +380,10 @@ struct _Vec_iter_types {
using const_pointer = _Const_pointer;
};
// STRUCT _Value_init_tag
struct _Value_init_tag { // tag to request value-initialization
explicit _Value_init_tag() = default;
};
// CLASS TEMPLATE _Vector_val
template <class _Val_types>
class _Vector_val : public _Container_base {
public:
@ -428,7 +423,6 @@ public:
pointer _Myend; // pointer to end of array
};
// FUNCTION TEMPLATE _Unfancy_maybe_null
template <class _Ptrty>
constexpr auto _Unfancy_maybe_null(_Ptrty _Ptr) noexcept {
// converts from a (potentially null) fancy pointer to a plain pointer
@ -440,7 +434,6 @@ constexpr _Ty* _Unfancy_maybe_null(_Ty* _Ptr) noexcept { // do nothing for plain
return _Ptr;
}
// CLASS TEMPLATE vector
template <class _Ty, class _Alloc = allocator<_Ty>>
class vector { // varying size array of values
private:
@ -1953,13 +1946,11 @@ constexpr typename vector<_Ty, _Alloc>::size_type erase_if(vector<_Ty, _Alloc>&
}
#endif // _HAS_CXX20
// CLASS TEMPLATE vector<bool, Alloc> AND FRIENDS
template <class _Alloc0>
struct _Wrap_alloc { // TRANSITION, ABI compat, preserves symbol names of vector<bool>::iterator
using _Alloc = _Alloc0;
};
// CLASS _Vb_iter_base
template <class _Alvbase_wrapped>
class _Vb_iter_base : public _Iterator_base {
// store information common to reference and iterators
@ -1995,7 +1986,6 @@ public:
_Size_type _Myoff = 0;
};
// CLASS _Vb_reference
template <class _Alvbase_wrapped>
class _Vb_reference : public _Vb_iter_base<_Alvbase_wrapped> {
// reference to a bit within a base word
@ -2057,7 +2047,6 @@ protected:
}
};
// CLASS _Vb_const_iterator
template <class _Alvbase_wrapped>
class _Vb_const_iterator : public _Vb_iter_base<_Alvbase_wrapped> {
private:
@ -2264,7 +2253,6 @@ _NODISCARD _CONSTEXPR20 _Vb_const_iterator<_Alvbase_wrapped> operator+(
return _Right;
}
// CLASS _Vb_iterator
template <class _Alvbase_wrapped>
class _Vb_iterator : public _Vb_const_iterator<_Alvbase_wrapped> {
public:
@ -2357,7 +2345,6 @@ _NODISCARD _CONSTEXPR20 _Vb_iterator<_Alvbase_wrapped> operator+(
return _Right;
}
// CLASS TEMPLATE _Vb_val
template <class _Alloc>
class _Vb_val : public _Container_base {
public:
@ -2435,7 +2422,6 @@ public:
size_type _Mysize; // current length of sequence
};
// CLASS vector<bool>
template <class _Alloc>
class vector<bool, _Alloc> : public _Vb_val<_Alloc> {
public:
@ -3054,7 +3040,6 @@ public:
}
};
// STRUCT TEMPLATE SPECIALIZATION hash
template <class _Alloc>
struct hash<vector<bool, _Alloc>> {
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef vector<bool, _Alloc> _ARGUMENT_TYPE_NAME;
@ -3072,7 +3057,6 @@ namespace pmr {
} // namespace pmr
#endif // _HAS_CXX17
// VARIABLE TEMPLATE _Is_vb_iterator
template <class _Alloc, bool _RequiresMutable>
_INLINE_VAR constexpr bool _Is_vb_iterator<_Vb_iterator<_Alloc>, _RequiresMutable> = true;

Просмотреть файл

@ -53,7 +53,6 @@ _STL_DISABLE_CLANG_WARNINGS
_STD_BEGIN
#if _HAS_CXX20
// ENUM CLASS memory_order
enum class memory_order : int {
relaxed,
consume,
@ -77,7 +76,6 @@ inline constexpr memory_order memory_order_release = memory_order::release;
inline constexpr memory_order memory_order_acq_rel = memory_order::acq_rel;
inline constexpr memory_order memory_order_seq_cst = memory_order::seq_cst;
#else // _HAS_CXX20
// ENUM memory_order
enum memory_order {
memory_order_relaxed,
memory_order_consume,
@ -90,7 +88,6 @@ enum memory_order {
using _Atomic_counter_t = unsigned long;
// FUNCTION TEMPLATE _Atomic_address_as
template <class _Integral, class _Ty>
_NODISCARD volatile _Integral* _Atomic_address_as(_Ty& _Source) noexcept {
// gets a pointer to the argument as an integral type (to pass to intrinsics)

Просмотреть файл

@ -17,7 +17,6 @@ _STL_DISABLE_CLANG_WARNINGS
#undef new
_STD_BEGIN
// STRUCT once_flag
struct once_flag { // opaque data structure for call_once()
constexpr once_flag() noexcept : _Opaque(nullptr) {}

Просмотреть файл

@ -25,7 +25,6 @@ _STL_DISABLE_CLANG_WARNINGS
#undef new
_STD_BEGIN
// ENUM CLASS chars_format
enum class chars_format {
scientific = 0b001,
fixed = 0b010,
@ -35,7 +34,6 @@ enum class chars_format {
_BITMASK_OPS(chars_format)
// STRUCT to_chars_result
struct to_chars_result {
char* ptr;
errc ec;

Просмотреть файл

@ -17,7 +17,6 @@ _STL_DISABLE_CLANG_WARNINGS
#undef new
_STD_BEGIN
// ENUM CLASS errc
enum class errc { // names for generic error codes
address_family_not_supported = 102, // EAFNOSUPPORT
address_in_use = 100, // EADDRINUSE

Просмотреть файл

@ -22,7 +22,6 @@ _STL_DISABLE_CLANG_WARNINGS
// In particular, basic_string must not be included here.
_STD_BEGIN
// CLASS _Facet_base
class _CRTIMP2_PURE_IMPORT _Facet_base { // code for reference counting a facet
public:
virtual __CLR_OR_THIS_CALL ~_Facet_base() noexcept {} // ensure that derived classes can be destroyed properly

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше