Cite N4950 in headers and source files (#3686)

Towards #182.

- This PR drops all section numbers except for D.x in `<yvals_core.h>`. I decided to cite WG21-N4868 for C++20 deprecation.
- Some citations in `<format>` are intentionally not updated because WG21-P2675R1 and LWG-3631 are not implemented yet.
- Citations in test files are not updated, but I think I'll do it soon.
- Drive-by change: a comment for `move_only_function`'s move assignment operator explaining why it's `noexcept(false)` (see https://github.com/microsoft/STL/pull/3565#discussion_r1134755402 and https://github.com/microsoft/STL/issues/2278#issuecomment-943360927).

---------

Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
Co-authored-by: Nicole Mazzuca <mazzucan@outlook.com>
Co-authored-by: Casey Carter <cacarter@microsoft.com>
This commit is contained in:
A. Jiang 2023-05-19 02:38:57 +08:00 коммит произвёл GitHub
Родитель 04db1206b0
Коммит d3a7da7ace
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
48 изменённых файлов: 448 добавлений и 443 удалений

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

@ -196,7 +196,7 @@ namespace chrono {
using period = typename _Duration::period;
static_assert(_Is_duration_v<_Duration>,
"N4885 [time.point.general]/1 mandates Duration to be a specialization of chrono::duration.");
"N4950 [time.point.general]/1 mandates Duration to be a specialization of chrono::duration.");
constexpr time_point() = default;

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

@ -5454,7 +5454,7 @@ _EXPORT_STD template <class _FwdIt>
constexpr _FwdIt shift_left(_FwdIt _First, const _FwdIt _Last, _Iter_diff_t<_FwdIt> _Pos_to_shift) {
// shift [_First, _Last) left by _Pos_to_shift
// positions; returns the end of the resulting range
_STL_ASSERT(_Pos_to_shift >= 0, "shift count must be non-negative (N4910 [alg.shift]/1)");
_STL_ASSERT(_Pos_to_shift >= 0, "shift count must be non-negative (N4950 [alg.shift]/1)");
_Adl_verify_range(_First, _Last);
@ -5495,7 +5495,7 @@ _EXPORT_STD template <class _FwdIt>
constexpr _FwdIt shift_right(_FwdIt _First, const _FwdIt _Last, _Iter_diff_t<_FwdIt> _Pos_to_shift) {
// shift [_First, _Last) right by _Pos_to_shift
// positions; returns the beginning of the resulting range
_STL_ASSERT(_Pos_to_shift >= 0, "shift count must be non-negative (N4910 [alg.shift]/5)");
_STL_ASSERT(_Pos_to_shift >= 0, "shift count must be non-negative (N4950 [alg.shift]/5)");
_Adl_verify_range(_First, _Last);
@ -5581,7 +5581,7 @@ namespace ranges {
template <permutable _It, sentinel_for<_It> _Se>
constexpr subrange<_It> operator()(_It _First, const _Se _Last, iter_difference_t<_It> _Pos_to_shift) const {
_STL_ASSERT(_Pos_to_shift >= 0, "shift count must be non-negative (N4910 [alg.shift]/1)");
_STL_ASSERT(_Pos_to_shift >= 0, "shift count must be non-negative (N4950 [alg.shift]/1)");
_Adl_verify_range(_First, _Last);
auto _Result = _First;
@ -5599,7 +5599,7 @@ namespace ranges {
template <forward_range _Rng>
requires permutable<iterator_t<_Rng>>
constexpr borrowed_subrange_t<_Rng> operator()(_Rng&& _Range, range_difference_t<_Rng> _Pos_to_shift) const {
_STL_ASSERT(_Pos_to_shift >= 0, "shift count must be non-negative (N4910 [alg.shift]/1)");
_STL_ASSERT(_Pos_to_shift >= 0, "shift count must be non-negative (N4950 [alg.shift]/1)");
if (_Pos_to_shift == 0) {
auto _Last = _Rewrap_iterator(_Range, _Get_final_iterator_unwrapped(_Range));
@ -5703,7 +5703,7 @@ namespace ranges {
_It _First, _Se _Last, iter_difference_t<_It> _Pos_to_shift, const _SizeTy _Size) {
_STL_INTERNAL_STATIC_ASSERT(permutable<_It>);
_STL_INTERNAL_STATIC_ASSERT(sentinel_for<_Se, _It>);
_STL_ASSERT(_Pos_to_shift >= 0, "shift count must be non-negative (N4910 [alg.shift]/5)");
_STL_ASSERT(_Pos_to_shift >= 0, "shift count must be non-negative (N4950 [alg.shift]/5)");
if (_Pos_to_shift == 0) {
return {_First, _RANGES next(_First, _Last)};
@ -10061,7 +10061,7 @@ namespace ranges {
const auto _First = _Range.begin();
const auto _Last = _Range.end();
_STL_ASSERT(_First != _Last,
"An initializer_list passed to std::ranges::minmax must not be empty. (N4928 [alg.min.max]/21)");
"An initializer_list passed to std::ranges::minmax must not be empty. (N4950 [alg.min.max]/21)");
return _Minmax_fwd_unchecked(_First, _Last, _STD _Pass_fn(_Pred), _STD _Pass_fn(_Proj));
}
@ -10073,13 +10073,13 @@ namespace ranges {
auto _UFirst = _RANGES _Ubegin(_Range);
auto _ULast = _RANGES _Uend(_Range);
_STL_ASSERT(
_UFirst != _ULast, "A range passed to std::ranges::minmax must not be empty. (N4928 [alg.min.max]/21)");
_UFirst != _ULast, "A range passed to std::ranges::minmax must not be empty. (N4950 [alg.min.max]/21)");
if constexpr (forward_range<_Rng> && _Prefer_iterator_copies<iterator_t<_Rng>>) {
return _Minmax_fwd_unchecked(
_STD move(_UFirst), _STD move(_ULast), _STD _Pass_fn(_Pred), _STD _Pass_fn(_Proj));
} else {
using _Vty = range_value_t<_Rng>;
// This initialization is correct, similar to the N4928 [dcl.init.aggr]/6 example
// This initialization is correct, similar to the N4950 [dcl.init.aggr]/6 example
minmax_result<_Vty> _Found = {static_cast<_Vty>(*_UFirst), _Found.min};
if (_UFirst == _ULast) {
return _Found;
@ -10147,7 +10147,7 @@ namespace ranges {
auto _Found_min = _First;
if (++_First == _Last) {
// This initialization is correct, similar to the N4928 [dcl.init.aggr]/6 example
// This initialization is correct, similar to the N4950 [dcl.init.aggr]/6 example
minmax_result<_Vty> _Result = {static_cast<_Vty>(*_Found_min), _Result.min};
return _Result;
}
@ -10568,7 +10568,7 @@ namespace ranges {
const _Ty& _Val, const _Ty& _Lo, const _Ty& _Hi, _Pr _Pred = {}, _Pj _Proj = {}) const {
_STL_ASSERT(!_STD invoke(_Pred, _STD invoke(_Proj, _Hi), _STD invoke(_Proj, _Lo)),
"The lower bound cannot be greater than the upper bound in a call to std::ranges::clamp "
"(N4861 [alg.clamp]/2).");
"(N4950 [alg.clamp]/2).");
auto&& _Temp = _STD invoke(_Proj, _Val);
if (_STD invoke(_Pred, _STD forward<decltype(_Temp)>(_Temp), _STD invoke(_Proj, _Lo))) {

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

@ -580,9 +580,8 @@ public:
#if _HAS_CXX17
template <class _First, class... _Rest>
struct _Enforce_same {
static_assert(conjunction_v<is_same<_First, _Rest>...>,
"N4687 26.3.7.2 [array.cons]/2: "
"Requires: (is_same_v<T, U> && ...) is true. Otherwise the program is ill-formed.");
static_assert(
conjunction_v<is_same<_First, _Rest>...>, "N4950 [array.cons]/2: Mandates: (is_same_v<T, U> && ...) is true.");
using type = _First;
};
@ -830,18 +829,18 @@ _NODISCARD constexpr array<remove_cv_t<_Ty>, _Size> _To_array_rvalue_impl(
_EXPORT_STD template <class _Ty, size_t _Size>
_NODISCARD constexpr array<remove_cv_t<_Ty>, _Size> to_array(_Ty (&_Array)[_Size]) {
static_assert(!is_array_v<_Ty>, "N4830 [array.creation]/1: "
static_assert(!is_array_v<_Ty>, "N4950 [array.creation]/1: "
"to_array does not accept multidimensional arrays.");
static_assert(is_constructible_v<_Ty, _Ty&>, "N4830 [array.creation]/1: "
static_assert(is_constructible_v<_Ty, _Ty&>, "N4950 [array.creation]/1: "
"to_array requires copy constructible elements.");
return _To_array_lvalue_impl(_Array, make_index_sequence<_Size>{});
}
_EXPORT_STD template <class _Ty, size_t _Size>
_NODISCARD constexpr array<remove_cv_t<_Ty>, _Size> to_array(_Ty (&&_Array)[_Size]) {
static_assert(!is_array_v<_Ty>, "N4830 [array.creation]/4: "
static_assert(!is_array_v<_Ty>, "N4950 [array.creation]/4: "
"to_array does not accept multidimensional arrays.");
static_assert(is_move_constructible_v<_Ty>, "N4830 [array.creation]/4: "
static_assert(is_move_constructible_v<_Ty>, "N4950 [array.creation]/4: "
"to_array requires move constructible elements.");
return _To_array_rvalue_impl(_STD move(_Array), make_index_sequence<_Size>{});
}

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

@ -74,7 +74,7 @@ public:
is_function_v<remove_pointer_t<_Completion_function>> ||
#endif // __cpp_noexcept_function_type
is_nothrow_invocable_v<_Completion_function&>,
"N4861 [thread.barrier.class]/5: is_nothrow_invocable_v<CompletionFunction&> shall be true");
"N4950 [thread.barrier.class]/5: is_nothrow_invocable_v<CompletionFunction&> shall be true");
using arrival_token = _Arrival_token<_Completion_function>;
@ -82,7 +82,7 @@ public:
const ptrdiff_t _Expected, _Completion_function _Fn = _Completion_function()) noexcept /* strengthened */
: _Val(_One_then_variadic_args_t{}, _STD move(_Fn), _Expected << _Barrier_value_shift) {
_STL_VERIFY(_Val._Myval2._Current.load(memory_order_relaxed) >= 0,
"Precondition: expected >= 0 and expected <= max() (N4861 [thread.barrier.class]/9)");
"Precondition: expected >= 0 and expected <= max() (N4950 [thread.barrier.class]/9)");
}
barrier(const barrier&) = delete;
@ -95,11 +95,11 @@ public:
_NODISCARD_BARRIER_TOKEN arrival_token arrive(ptrdiff_t _Update = 1) noexcept /* strengthened */ {
// Shifting before precondition check, so that exceeding max() will trigger precondition check too
_Update <<= _Barrier_value_shift;
_STL_VERIFY(_Update > 0, "Precondition: update > 0 (N4861 [thread.barrier.class]/12)");
_STL_VERIFY(_Update > 0, "Precondition: update > 0 (N4950 [thread.barrier.class]/12)");
// TRANSITION, GH-1133: should be memory_order_release
ptrdiff_t _Current = _Val._Myval2._Current.fetch_sub(_Update) - _Update;
_STL_VERIFY(_Current >= 0, "Precondition: update is less than or equal to the expected count "
"for the current barrier phase (N4861 [thread.barrier.class]/12)");
"for the current barrier phase (N4950 [thread.barrier.class]/12)");
if ((_Current & _Barrier_value_mask) == 0) {
// TRANSITION, GH-1133: should have this fence:
// atomic_thread_fence(memory_order_acquire);
@ -114,14 +114,14 @@ public:
void wait(arrival_token&& _Arrival) const noexcept /* strengthened */ {
_STL_VERIFY((_Arrival._Value & _Barrier_value_mask) == reinterpret_cast<intptr_t>(this),
"Preconditions: arrival is associated with the phase synchronization point for the current phase "
"or the immediately preceding phase of the same barrier object (N4861 [thread.barrier.class]/19)");
"or the immediately preceding phase of the same barrier object (N4950 [thread.barrier.class]/19)");
const ptrdiff_t _Arrival_value = _Arrival._Value & _Barrier_arrival_token_mask;
_Arrival._Value = _Barrier_invalid_token;
for (;;) {
// TRANSITION, GH-1133: should be memory_order_acquire
const ptrdiff_t _Current = _Val._Myval2._Current.load();
_STL_VERIFY(_Current >= 0, "Invariant counter >= 0, possibly caused by preconditions violation "
"(N4861 [thread.barrier.class]/12)");
"(N4950 [thread.barrier.class]/12)");
if ((_Current & _Barrier_arrival_token_mask) != _Arrival_value) {
break;
}
@ -134,7 +134,7 @@ public:
ptrdiff_t _Current = _Val._Myval2._Current.fetch_sub(_Barrier_value_step) - _Barrier_value_step;
const ptrdiff_t _Arrival = _Current & _Barrier_arrival_token_mask;
_STL_VERIFY(_Current >= 0, "Precondition: update is less than or equal to the expected count "
"for the current barrier phase (N4861 [thread.barrier.class]/12)");
"for the current barrier phase (N4950 [thread.barrier.class]/12)");
if ((_Current & _Barrier_value_mask) == 0) {
_Completion(_Current);
return;
@ -145,7 +145,7 @@ public:
// TRANSITION, GH-1133: should be memory_order_acquire
_Current = _Val._Myval2._Current.load();
_STL_VERIFY(_Current >= 0, "Invariant counter >= 0, possibly caused by preconditions violation "
"(N4861 [thread.barrier.class]/12)");
"(N4950 [thread.barrier.class]/12)");
if ((_Current & _Barrier_arrival_token_mask) != _Arrival) {
break;
}
@ -156,7 +156,7 @@ public:
const ptrdiff_t _Rem_count =
_Val._Myval2._Total.fetch_sub(_Barrier_value_step, memory_order_relaxed) - _Barrier_value_step;
_STL_VERIFY(_Rem_count >= 0, "Precondition: The expected count for the current barrier phase "
"is greater than zero (N4861 [thread.barrier.class]/24) "
"is greater than zero (N4950 [thread.barrier.class]/24) "
"(checked initial expected count, which is not less than the current)");
(void) arrive(1);
}
@ -166,7 +166,7 @@ private:
const ptrdiff_t _Rem_count = _Val._Myval2._Total.load(memory_order_relaxed);
_STL_VERIFY(_Rem_count >= 0, "Invariant: initial expected count less than zero, "
"possibly caused by preconditions violation "
"(N4861 [thread.barrier.class]/24)");
"(N4950 [thread.barrier.class]/24)");
_Val._Get_first()();
const ptrdiff_t _New_phase_count = _Rem_count | ((_Current + 1) & _Barrier_arrival_token_mask);
// TRANSITION, GH-1133: should be memory_order_release

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

@ -99,12 +99,12 @@ _NODISCARD constexpr _Ty bit_ceil(const _Ty _Val) noexcept /* strengthened */ {
if constexpr (sizeof(_Ty) < sizeof(unsigned int)) { // for types subject to integral promotion
if (_STD is_constant_evaluated()) {
// Because N4892 [expr.shift]/1 "integral promotions are performed"
// Because N4950 [expr.shift]/1 "integral promotions are performed"
// the compiler will not generate a compile time error for
// uint8_t{1} << 8
// or
// uint16_t{1} << 16
// so we must manually enforce N4892 [bit.pow.two]/5, 8:
// so we must manually enforce N4950 [bit.pow.two]/5, 8:
// "Preconditions: N is representable as a value of type T."
// "Remarks: A function call expression that violates the precondition in the Preconditions: element
// is not a core constant expression (7.7)."

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

@ -304,7 +304,7 @@ _NODISCARD _CONSTEXPR23 from_chars_result _Integer_from_chars(
}
}
_Raw_value = static_cast<_RawTy>(_Value); // implementation-defined for negative, N4713 7.8 [conv.integral]/3
_Raw_value = static_cast<_RawTy>(_Value); // congruent to _Value modulo 2^N for negative, N4950 [conv.integral]/3
return {_Next, errc{}};
}
@ -369,24 +369,27 @@ _EXPORT_STD _CONSTEXPR23 from_chars_result from_chars(const char* const _First,
// array is not necessary: all operations on the _Big_integer_flt type are carefully written to only access elements at
// indices [0, _Myused), and all operations correctly update _Myused as the utilized size increases.
// _Big_integer_flt _Xval{}; is direct-list-initialization (N4750 11.6.4 [dcl.init.list]/1).
// N4750 11.6.4 [dcl.init.list]/3.5:
// _Big_integer_flt _Xval{}; is direct-list-initialization (N4950 [dcl.init.list]/1).
// N4950 [dcl.init.list]/3.5:
// "Otherwise, if the initializer list has no elements and T is a class type with a default constructor,
// the object is value-initialized."
// N4750 11.6 [dcl.init]/8, /8.1:
// N4950 [dcl.init.general]/9, /9.1, /9.1.1:
// "To value-initialize an object of type T means:
// - if T is a (possibly cv-qualified) class type (Clause 12) with either no default constructor (15.1)
// or a default constructor that is user-provided or deleted, then the object is default-initialized;"
// N4750 11.6 [dcl.init]/7, /7.1:
// - if T is a (possibly cv-qualified) class type ([class]), then
// - if T has either no default constructor ([class.default.ctor]) or a default constructor
// that is user-provided or deleted, then the object is default-initialized;"
// N4950 [dcl.init.general]/7, /7.1:
// "To default-initialize an object of type T means:
// - If T is a (possibly cv-qualified) class type (Clause 12), constructors are considered. The applicable constructors
// are enumerated (16.3.1.3), and the best one for the initializer () is chosen through overload resolution (16.3).
// - If T is a (possibly cv-qualified) class type ([class]), constructors are considered. The applicable constructors
// are enumerated ([over.match.ctor]), and the best one for the initializer () is chosen through overload resolution
// ([over.match]).
// The constructor thus selected is called, with an empty argument list, to initialize the object."
// N4750 15.6.2 [class.base.init]/9, /9.3:
// "In a non-delegating constructor, if a given potentially constructed subobject is not designated by a
// mem-initializer-id (including the case where there is no mem-initializer-list because the constructor has no
// ctor-initializer), then [...] - otherwise, the entity is default-initialized (11.6)."
// N4750 11.6 [dcl.init]/7, /7.2, /7.3:
// N4950 [class.base.init]/9, /9.3:
// "In a non-delegating constructor other than an implicitly-defined copy/move constructor ([class.copy.ctor]),
// if a given potentially constructed subobject is not designated by a mem-initializer-id (including the case
// where there is no mem-initializer-list because the constructor has no ctor-initializer), then [...]
// - otherwise, the entity is default-initialized ([dcl.init])."
// N4950 [dcl.init.general]/7, /7.2, /7.3:
// "To default-initialize an object of type T means: [...]
// - If T is an array type, each element is default-initialized.
// - Otherwise, no initialization is performed."
@ -1651,7 +1654,7 @@ _NODISCARD from_chars_result _Ordinary_floating_from_chars(const char* const _Fi
constexpr int _Maximum_temporary_decimal_exponent = 5200;
constexpr int _Minimum_temporary_decimal_exponent = -5200;
if (_Fmt != chars_format::fixed // N4713 23.20.3 [charconv.from.chars]/7.3
if (_Fmt != chars_format::fixed // N4950 [charconv.from.chars]/6.3
// "if fmt has chars_format::fixed set but not chars_format::scientific,
// the optional exponent part shall not appear"
&& _Next != _Last && (static_cast<unsigned char>(*_Next) | 0x20) == _Exponent_prefix) { // found exponent prefix
@ -1690,7 +1693,7 @@ _NODISCARD from_chars_result _Ordinary_floating_from_chars(const char* const _Fi
const char* const _Exponent_end = _Next;
if (_Fmt == chars_format::scientific
&& _Frac_end == _Exponent_end) { // N4713 23.20.3 [charconv.from.chars]/7.2
&& _Frac_end == _Exponent_end) { // N4950 [charconv.from.chars]/6.2
// "if fmt has chars_format::scientific set but not chars_format::fixed,
// the otherwise optional exponent part shall appear"
return {_First, errc::invalid_argument};

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

@ -1575,7 +1575,7 @@ namespace chrono {
class hh_mm_ss {
public:
static_assert(_Is_duration_v<_Duration>,
"N4885 [time.hms.overview]/2 mandates Duration to be a specialization of chrono::duration.");
"N4950 [time.hms.overview]/2 mandates Duration to be a specialization of chrono::duration.");
static constexpr unsigned int fractional_width = [] {
// Returns the number of fractional digits of _Num / _Den in the range [0, 18].
@ -2321,7 +2321,7 @@ namespace chrono {
auto _My_tzdb = static_cast<tzdb_list*>(__std_calloc_crt(1, sizeof(tzdb_list)));
if (_My_tzdb == nullptr) {
_Xruntime_error("bad allocation"); // not bad_alloc, see N4878 [time.zone.db.access]/4
_Xruntime_error("bad allocation"); // not bad_alloc, see N4950 [time.zone.db.access]/4
}
_TRY_BEGIN
@ -2399,7 +2399,7 @@ namespace chrono {
class zoned_time {
private:
static_assert(_Is_duration_v<_Duration>,
"N4885 [time.zone.zonedtime.overview]/2 mandates Duration to be a specialization of chrono::duration.");
"N4950 [time.zone.zonedtime.overview]/2 mandates Duration to be a specialization of chrono::duration.");
using _Traits = zoned_traits<_TimeZonePtr>;
@ -2907,7 +2907,8 @@ namespace chrono {
_NODISCARD auto operator()(const time_point<_SourceClock, _Duration>& _Time) const
noexcept(noexcept(_SourceClock::to_sys(_Time))) /* strengthened */ {
static_assert(_Is_time_point_for_clock<decltype(_SourceClock::to_sys(_Time)), system_clock>,
"N4885 [time.clock.cast.sys]/2: Mandates: SourceClock::to_sys(t) returns a sys_time<Duration>");
"N4950 [time.clock.cast.sys]/2: Mandates: SourceClock::to_sys(t) "
"returns a sys_time<Duration2> for some type Duration2");
return _SourceClock::to_sys(_Time);
}
};
@ -2919,8 +2920,8 @@ namespace chrono {
_NODISCARD auto operator()(const sys_time<_Duration>& _Time) const
noexcept(noexcept(_DestClock::from_sys(_Time))) /* strengthened */ {
static_assert(_Is_time_point_for_clock<decltype(_DestClock::from_sys(_Time)), _DestClock>,
"N4885 [time.clock.cast.sys]/5: Mandates: DestClock::from_sys(t) returns a "
"time_point<DestClock, Duration>");
"N4950 [time.clock.cast.sys]/5: Mandates: DestClock::from_sys(t) "
"returns a time_point<DestClock, Duration2> for some type Duration2");
return _DestClock::from_sys(_Time);
}
};
@ -2935,7 +2936,8 @@ namespace chrono {
_NODISCARD auto operator()(const time_point<_SourceClock, _Duration>& _Time) const
noexcept(noexcept(_SourceClock::to_utc(_Time))) /* strengthened */ {
static_assert(_Is_time_point_for_clock<decltype(_SourceClock::to_utc(_Time)), utc_clock>,
"N4885 [time.clock.cast.utc]/2: Mandates: SourceClock::to_utc(t) returns a utc_time<Duration>");
"N4950 [time.clock.cast.utc]/2: Mandates: SourceClock::to_utc(t) "
"returns a utc_time<Duration2> for some type Duration2");
return _SourceClock::to_utc(_Time);
}
};
@ -2947,8 +2949,8 @@ namespace chrono {
_NODISCARD auto operator()(const utc_time<_Duration>& _Time) const
noexcept(noexcept(_DestClock::from_utc(_Time))) /* strengthened */ {
static_assert(_Is_time_point_for_clock<decltype(_DestClock::from_utc(_Time)), _DestClock>,
"N4885 [time.clock.cast.utc]/5: Mandates: DestClock::from_utc(t) returns a "
"time_point<DestClock, Duration>");
"N4950 [time.clock.cast.utc]/5: Mandates: DestClock::from_utc(t) "
"returns a time_point<DestClock, Duration2> for some type Duration2");
return _DestClock::from_utc(_Time);
}
};
@ -3052,11 +3054,11 @@ namespace chrono {
} else if constexpr (_Strat == _Clock_cast_strategy::_Two_step_ambiguous) {
static_assert(_Always_false<_Duration>,
"A two-step clock time conversion is required to be unique, "
"either through utc_clock or system_clock, but not both (N4878 [time.clock.cast.fn]/2).");
"either through utc_clock or system_clock, but not both (N4950 [time.clock.cast.fn]/2).");
} else if constexpr (_Strat == _Clock_cast_strategy::_Three_step_ambiguous) {
static_assert(_Always_false<_Duration>,
"A three-step clock time conversion is required to be unique, "
"either utc-to-system or system-to-utc, but not both (N4878 [time.clock.cast.fn]/2).");
"either utc-to-system or system-to-utc, but not both (N4950 [time.clock.cast.fn]/2).");
} else {
static_assert(_Always_false<_Duration>, "should be unreachable");
}
@ -4581,7 +4583,7 @@ namespace chrono {
minutes* _Offset = nullptr) {
constexpr auto _Subsecond_precision{hh_mm_ss<_Duration>::fractional_width};
_Time_parse_fields _Time{_Istr, _Fmt, _Abbrev, _Offset, _Subsecond_precision};
// *_Offset is not subtracted from local_time, see N4885 [time.clock.local]/4.
// *_Offset is not subtracted from local_time, see N4950 [time.clock.local]/4.
_Time._Utc_offset.reset();
_Duration _Dur;
if (_Istr && _Time._Make_time_point(_Dur, _Time_parse_fields::_Leap_second_rep::_None)) {
@ -4922,8 +4924,8 @@ namespace chrono {
template <class _CharT, class _Traits>
friend basic_ostream<_CharT, _Traits>& operator<<(
basic_ostream<_CharT, _Traits>& _Os, const _Local_time_format_t& _Val) {
// Doesn't appear in the Standard, but allowed by N4885 [global.functions]/2.
// Implements N4885 [time.zone.zonedtime.nonmembers]/2 for zoned_time.
// Doesn't appear in the Standard, but allowed by N4950 [global.functions]/2.
// Implements N4950 [time.zone.zonedtime.nonmembers]/2 for zoned_time.
return _Os << _STD format(_Os.getloc(), _STATICALLY_WIDEN(_CharT, "{:L%F %T %Z}"), _Val);
}
};
@ -5300,13 +5302,13 @@ namespace chrono {
if constexpr (!treat_as_floating_point_v<typename _Ty::rep>) {
if (_Specs._Precision != -1) {
_THROW(format_error("Precision specification invalid for chrono::duration type with "
"integral representation type, see N4885 [time.format]/1."));
"integral representation type, see N4950 [time.format]/1."));
}
}
} else {
if (_Specs._Precision != -1) {
_THROW(format_error("Precision specification invalid for non-chrono::duration type, "
"see N4885 [time.format]/1."));
"see N4950 [time.format]/1."));
}
}
@ -5420,7 +5422,7 @@ namespace chrono {
_Stream.imbue(_Specs._Localized ? _FormatCtx.locale() : locale::classic());
if (_Specs._Chrono_specs_list.empty()) {
_Stream << _Val; // N4885 [time.format]/6
_Stream << _Val; // N4950 [time.format]/7
} else {
if constexpr (_Is_specialization_v<_Ty, hh_mm_ss>) {
if (_Val.is_negative()) {

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

@ -638,7 +638,7 @@ _STD _Common_float_type_t<_Ty1, _Ty2> remquo(_Ty1 _Left, _Ty2 _Right, int* _Pquo
#define _GENERIC_MATH2I(FUN, CLANG_INTRIN, MSVC_INTRIN) _GENERIC_MATH2_BASE(FUN, _CSTD FUN)
#endif // ^^^ intrinsics unavailable ^^^
// The following order matches N4910 28.7.1 [cmath.syn].
// The following order matches N4950 [cmath.syn].
_GENERIC_MATH1(acos)
_GENERIC_MATH1(asin)
_GENERIC_MATH1(atan)
@ -1348,7 +1348,7 @@ _EXPORT_STD _NODISCARD inline long double hypot(const long double _Dx, const lon
_EXPORT_STD template <class _Ty1, class _Ty2, class _Ty3,
enable_if_t<is_arithmetic_v<_Ty1> && is_arithmetic_v<_Ty2> && is_arithmetic_v<_Ty3>, int> = 0>
_NODISCARD auto hypot(const _Ty1 _Dx, const _Ty2 _Dy, const _Ty3 _Dz) {
// N4910 [cmath.syn]/2 "Sufficient additional overloads"
// N4950 [cmath.syn]/3 "Sufficient additional overloads"
// Note that this template is selected by overload resolution only when at least one
// argument is double/long double/integral but not all three are double or long double.
using _Common = _Common_float_type_t<_Ty1, _Common_float_type_t<_Ty2, _Ty3>>; // TRANSITION, fold expressions

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

@ -4009,7 +4009,7 @@ _Ty _Reduce_move_unchecked(_InIt _First, const _InIt _Last, _Ty _Val, _BinOp _Re
return _Reduce_plus_arithmetic_ranges(_First, _Last, _Val);
} else {
for (; _First != _Last; ++_First) {
_Val = _Reduce_op(_STD move(_Val), _STD move(*_First)); // Requirement missing from N4713
_Val = _Reduce_op(_STD move(_Val), _STD move(*_First)); // Requirement missing from N4950
}
return _Val;
@ -4026,7 +4026,7 @@ _Ty _Reduce_at_least_two(const _FwdIt _First, const _FwdIt _Last, _BinOp _Reduce
auto _Next = _First;
_Ty _Val = _Reduce_op(*_First, *++_Next);
while (++_Next != _Last) {
_Val = _Reduce_op(_STD move(_Val), *_Next); // Requirement missing from N4713
_Val = _Reduce_op(_STD move(_Val), *_Next); // Requirement missing from N4950
}
return _Val;
@ -4137,10 +4137,10 @@ struct _Static_partitioned_transform_reduce_binary2 { // transform-reduction tas
_This->_Basis2._Get_first(_Key._Chunk_number, _This->_Team._Get_chunk_offset(_Key._Chunk_number));
auto _Next1 = _Chunk1._First;
auto _Next2 = _First2;
// Requirement missing from N4713:
// Requirement missing from N4950:
_Ty _Val = _Reduce_op(_Transform_op(*_Chunk1._First, *_First2), _Transform_op(*++_Next1, *++_Next2));
while (++_Next1 != _Chunk1._Last) {
// Requirement missing from N4713:
// Requirement missing from N4950:
_Val = _Reduce_op(_STD move(_Val), _Transform_op(*_Next1, *++_Next2));
}
@ -4151,7 +4151,7 @@ struct _Static_partitioned_transform_reduce_binary2 { // transform-reduction tas
_Next1 = _Chunk1._First;
_Next2 = _First2;
for (; _Next1 != _Chunk1._Last; ++_Next1, (void) ++_Next2) {
// Requirement missing from N4713:
// Requirement missing from N4950:
_Val = _Reduce_op(_STD move(_Val), _Transform_op(*_Next1, *_Next2));
}
}
@ -4287,7 +4287,7 @@ _NODISCARD _Ty transform_reduce(_ExPo&&, const _FwdIt _First, const _FwdIt _Last
// setup complete, hereafter nothrow or terminate
_Work._Submit_for_chunks(_Hw_threads, _Chunks);
while (auto _Stolen_key = _Operation._Team._Get_next_key()) {
// keep processing remaining chunks to comply with N4687 [intro.progress]/14
// keep processing remaining chunks to comply with N4950 [intro.progress]/14
auto _Chunk = _Operation._Basis._Get_chunk(_Stolen_key);
_Val = _STD transform_reduce(_Chunk._First, _Chunk._Last, _STD move(_Val), _Pass_fn(_Reduce_op),
_Pass_fn(_Transform_op));

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

@ -30,12 +30,12 @@ class unexpected;
template <class _Err>
struct _Check_unexpected_argument : true_type {
static_assert(is_object_v<_Err>, "E must be an object type. (N4928 [expected.un.general]/2)");
static_assert(!is_array_v<_Err>, "E must not be an array type. (N4928 [expected.un.general]/2)");
static_assert(!is_const_v<_Err>, "E must not be const. (N4928 [expected.un.general]/2)");
static_assert(!is_volatile_v<_Err>, "E must not be volatile. (N4928 [expected.un.general]/2)");
static_assert(is_object_v<_Err>, "E must be an object type. (N4950 [expected.un.general]/2)");
static_assert(!is_array_v<_Err>, "E must not be an array type. (N4950 [expected.un.general]/2)");
static_assert(!is_const_v<_Err>, "E must not be const. (N4950 [expected.un.general]/2)");
static_assert(!is_volatile_v<_Err>, "E must not be volatile. (N4950 [expected.un.general]/2)");
static_assert(!_Is_specialization_v<_Err, unexpected>,
"E must not be a specialization of unexpected. (N4928 [expected.un.general]/2)");
"E must not be a specialization of unexpected. (N4950 [expected.un.general]/2)");
};
// [expected.un.general]
@ -171,15 +171,15 @@ concept _Is_invoke_constructible = requires(_Fn&& _Func, _Tys&&... _Vals) {
template <class _Ty>
struct _Check_expected_argument : true_type {
static_assert(!is_reference_v<_Ty>, "T must not be a reference type. (N4928 [expected.object.general]/2)");
static_assert(!is_function_v<_Ty>, "T must not be a function type. (N4928 [expected.object.general]/2)");
static_assert(!is_array_v<_Ty>, "T must not be an array type. (N4928 [expected.object.general]/2)");
static_assert(!is_reference_v<_Ty>, "T must not be a reference type. (N4950 [expected.object.general]/2)");
static_assert(!is_function_v<_Ty>, "T must not be a function type. (N4950 [expected.object.general]/2)");
static_assert(!is_array_v<_Ty>, "T must not be an array type. (N4950 [expected.object.general]/2)");
static_assert(!is_same_v<remove_cv_t<_Ty>, in_place_t>,
"T must not be (possibly cv-qualified) in_place_t. (N4928 [expected.object.general]/2)");
"T must not be (possibly cv-qualified) in_place_t. (N4950 [expected.object.general]/2)");
static_assert(!is_same_v<remove_cv_t<_Ty>, unexpect_t>,
"T must not be (possibly cv-qualified) unexpect_t. (N4928 [expected.object.general]/2)");
"T must not be (possibly cv-qualified) unexpect_t. (N4950 [expected.object.general]/2)");
static_assert(!_Is_specialization_v<remove_cv_t<_Ty>, unexpected>,
"T must not be a (possibly cv-qualified) specialization of unexpected. (N4928 [expected.object.general]/2)");
"T must not be a (possibly cv-qualified) specialization of unexpected. (N4950 [expected.object.general]/2)");
};
_EXPORT_STD template <class _Ty, class _Err>
@ -677,9 +677,9 @@ public:
_NODISCARD constexpr _Ty value_or(_Uty&& _Other) const& noexcept(
is_nothrow_copy_constructible_v<_Ty>&& is_nothrow_convertible_v<_Uty, _Ty>) /* strengthened */ {
static_assert(
is_copy_constructible_v<_Ty>, "is_copy_constructible_v<T> must be true. (N4928 [expected.object.obs]/16)");
is_copy_constructible_v<_Ty>, "is_copy_constructible_v<T> must be true. (N4950 [expected.object.obs]/18)");
static_assert(
is_convertible_v<_Uty, _Ty>, "is_convertible_v<U, T> must be true. (N4928 [expected.object.obs]/16)");
is_convertible_v<_Uty, _Ty>, "is_convertible_v<U, T> must be true. (N4950 [expected.object.obs]/18)");
if (_Has_value) {
return _Value;
@ -691,9 +691,9 @@ public:
_NODISCARD constexpr _Ty value_or(_Uty&& _Other) && noexcept(
is_nothrow_move_constructible_v<_Ty>&& is_nothrow_convertible_v<_Uty, _Ty>) /* strengthened */ {
static_assert(
is_move_constructible_v<_Ty>, "is_move_constructible_v<T> must be true. (N4928 [expected.object.obs]/18)");
is_move_constructible_v<_Ty>, "is_move_constructible_v<T> must be true. (N4950 [expected.object.obs]/20)");
static_assert(
is_convertible_v<_Uty, _Ty>, "is_convertible_v<U, T> must be true. (N4928 [expected.object.obs]/18)");
is_convertible_v<_Uty, _Ty>, "is_convertible_v<U, T> must be true. (N4950 [expected.object.obs]/20)");
if (_Has_value) {
return _STD move(_Value);
@ -706,9 +706,9 @@ public:
_NODISCARD constexpr _Err error_or(_Uty&& _Other) const& noexcept(
is_nothrow_copy_constructible_v<_Err>&& is_nothrow_convertible_v<_Uty, _Err>) /* strengthened */ {
static_assert(
is_copy_constructible_v<_Err>, "is_copy_constructible_v<E> must be true. (N4928 [expected.object.obs]/20)");
is_copy_constructible_v<_Err>, "is_copy_constructible_v<E> must be true. (N4950 [expected.object.obs]/22)");
static_assert(
is_convertible_v<_Uty, _Err>, "is_convertible_v<G, E> must be true. (N4928 [expected.object.obs]/20)");
is_convertible_v<_Uty, _Err>, "is_convertible_v<G, E> must be true. (N4950 [expected.object.obs]/22)");
if (_Has_value) {
return _STD forward<_Uty>(_Other);
@ -721,9 +721,9 @@ public:
_NODISCARD constexpr _Err error_or(_Uty&& _Other) && noexcept(
is_nothrow_move_constructible_v<_Err>&& is_nothrow_convertible_v<_Uty, _Err>) /* strengthened */ {
static_assert(
is_move_constructible_v<_Err>, "is_move_constructible_v<E> must be true. (N4928 [expected.object.obs]/22)");
is_move_constructible_v<_Err>, "is_move_constructible_v<E> must be true. (N4950 [expected.object.obs]/24)");
static_assert(
is_convertible_v<_Uty, _Err>, "is_convertible_v<G, E> must be true. (N4928 [expected.object.obs]/22)");
is_convertible_v<_Uty, _Err>, "is_convertible_v<G, E> must be true. (N4950 [expected.object.obs]/24)");
if (_Has_value) {
return _STD forward<_Uty>(_Other);
@ -740,10 +740,10 @@ public:
static_assert(_Is_specialization_v<_Uty, expected>,
"expected<T, E>::and_then(F) requires the return type of F to be a specialization of expected. "
"(N4928 [expected.object.monadic]/3)");
"(N4950 [expected.object.monadic]/3)");
static_assert(is_same_v<typename _Uty::error_type, _Err>,
"expected<T, E>::and_then(F) requires the error type of the return type of F to be E. "
"(N4928 [expected.object.monadic]/3)");
"(N4950 [expected.object.monadic]/3)");
if (_Has_value) {
return _STD invoke(_STD forward<_Fn>(_Func), _Value);
@ -759,10 +759,10 @@ public:
static_assert(_Is_specialization_v<_Uty, expected>,
"expected<T, E>::and_then(F) requires the return type of F to be a specialization of expected. "
"(N4928 [expected.object.monadic]/3)");
"(N4950 [expected.object.monadic]/3)");
static_assert(is_same_v<typename _Uty::error_type, _Err>,
"expected<T, E>::and_then(F) requires the error type of the return type of F to be E. "
"(N4928 [expected.object.monadic]/3)");
"(N4950 [expected.object.monadic]/3)");
if (_Has_value) {
return _STD invoke(_STD forward<_Fn>(_Func), _Value);
@ -778,10 +778,10 @@ public:
static_assert(_Is_specialization_v<_Uty, expected>,
"expected<T, E>::and_then(F) requires the return type of F to be a specialization of expected. "
"(N4928 [expected.object.monadic]/7)");
"(N4950 [expected.object.monadic]/7)");
static_assert(is_same_v<typename _Uty::error_type, _Err>,
"expected<T, E>::and_then(F) requires the error type of the return type of F to be E. "
"(N4928 [expected.object.monadic]/7)");
"(N4950 [expected.object.monadic]/7)");
if (_Has_value) {
return _STD invoke(_STD forward<_Fn>(_Func), _STD move(_Value));
@ -797,10 +797,10 @@ public:
static_assert(_Is_specialization_v<_Uty, expected>,
"expected<T, E>::and_then(F) requires the return type of F to be a specialization of expected. "
"(N4928 [expected.object.monadic]/7)");
"(N4950 [expected.object.monadic]/7)");
static_assert(is_same_v<typename _Uty::error_type, _Err>,
"expected<T, E>::and_then(F) requires the error type of the return type of F to be E. "
"(N4928 [expected.object.monadic]/7)");
"(N4950 [expected.object.monadic]/7)");
if (_Has_value) {
return _STD invoke(_STD forward<_Fn>(_Func), _STD move(_Value));
@ -816,10 +816,10 @@ public:
static_assert(_Is_specialization_v<_Uty, expected>,
"expected<T, E>::or_else(F) requires the return type of F to be a specialization of expected. "
"(N4928 [expected.object.monadic]/11)");
"(N4950 [expected.object.monadic]/11)");
static_assert(is_same_v<typename _Uty::value_type, _Ty>,
"expected<T, E>::or_else(F) requires the value type of the return type of F to be T. "
"(N4928 [expected.object.monadic]/11)");
"(N4950 [expected.object.monadic]/11)");
if (_Has_value) {
return _Uty{in_place, _Value};
@ -835,10 +835,10 @@ public:
static_assert(_Is_specialization_v<_Uty, expected>,
"expected<T, E>::or_else(F) requires the return type of F to be a specialization of expected. "
"(N4928 [expected.object.monadic]/11)");
"(N4950 [expected.object.monadic]/11)");
static_assert(is_same_v<typename _Uty::value_type, _Ty>,
"expected<T, E>::or_else(F) requires the value type of the return type of F to be T. "
"(N4928 [expected.object.monadic]/11)");
"(N4950 [expected.object.monadic]/11)");
if (_Has_value) {
return _Uty{in_place, _Value};
@ -854,10 +854,10 @@ public:
static_assert(_Is_specialization_v<_Uty, expected>,
"expected<T, E>::or_else(F) requires the return type of F to be a specialization of expected. "
"(N4928 [expected.object.monadic]/15)");
"(N4950 [expected.object.monadic]/15)");
static_assert(is_same_v<typename _Uty::value_type, _Ty>,
"expected<T, E>::or_else(F) requires the value type of the return type of F to be T. "
"(N4928 [expected.object.monadic]/15)");
"(N4950 [expected.object.monadic]/15)");
if (_Has_value) {
return _Uty{in_place, _STD move(_Value)};
@ -873,10 +873,10 @@ public:
static_assert(_Is_specialization_v<_Uty, expected>,
"expected<T, E>::or_else(F) requires the return type of F to be a specialization of expected. "
"(N4928 [expected.object.monadic]/15)");
"(N4950 [expected.object.monadic]/15)");
static_assert(is_same_v<typename _Uty::value_type, _Ty>,
"expected<T, E>::or_else(F) requires the value type of the return type of F to be T. "
"(N4928 [expected.object.monadic]/15)");
"(N4950 [expected.object.monadic]/15)");
if (_Has_value) {
return _Uty{in_place, _STD move(_Value)};
@ -889,13 +889,13 @@ public:
requires is_constructible_v<_Err, _Err&>
constexpr auto transform(_Fn&& _Func) & {
static_assert(invocable<_Fn, _Ty&>, "expected<T, E>::transform(F) requires that F is invocable with T. "
"(N4928 [expected.object.monadic]/19)");
"(N4950 [expected.object.monadic]/19)");
using _Uty = remove_cv_t<invoke_result_t<_Fn, _Ty&>>;
if constexpr (!is_void_v<_Uty>) {
static_assert(_Is_invoke_constructible<_Fn, _Ty&>,
"expected<T, E>::transform(F) requires that the return type of F is constructible with the result of "
"invoking f. (N4928 [expected.object.monadic]/19)");
"invoking f. (N4950 [expected.object.monadic]/19)");
}
static_assert(_Check_expected_argument<_Uty>::value);
@ -916,13 +916,13 @@ public:
requires is_copy_constructible_v<_Err>
constexpr auto transform(_Fn&& _Func) const& {
static_assert(invocable<_Fn, const _Ty&>, "expected<T, E>::transform(F) requires that F is invocable with T. "
"(N4928 [expected.object.monadic]/19)");
"(N4950 [expected.object.monadic]/19)");
using _Uty = remove_cv_t<invoke_result_t<_Fn, const _Ty&>>;
if constexpr (!is_void_v<_Uty>) {
static_assert(_Is_invoke_constructible<_Fn, const _Ty&>,
"expected<T, E>::transform(F) requires that the return type of F is constructible with the result of "
"invoking f. (N4928 [expected.object.monadic]/19)");
"invoking f. (N4950 [expected.object.monadic]/19)");
}
static_assert(_Check_expected_argument<_Uty>::value);
@ -943,13 +943,13 @@ public:
requires is_move_constructible_v<_Err>
constexpr auto transform(_Fn&& _Func) && {
static_assert(invocable<_Fn, _Ty>, "expected<T, E>::transform(F) requires that F is invocable with T. "
"(N4928 [expected.object.monadic]/23)");
"(N4950 [expected.object.monadic]/23)");
using _Uty = remove_cv_t<invoke_result_t<_Fn, _Ty>>;
if constexpr (!is_void_v<_Uty>) {
static_assert(_Is_invoke_constructible<_Fn, _Ty>,
"expected<T, E>::transform(F) requires that the return type of F is constructible with the result of "
"invoking f. (N4928 [expected.object.monadic]/23)");
"invoking f. (N4950 [expected.object.monadic]/23)");
}
static_assert(_Check_expected_argument<_Uty>::value);
@ -970,13 +970,13 @@ public:
requires is_constructible_v<_Err, const _Err>
constexpr auto transform(_Fn&& _Func) const&& {
static_assert(invocable<_Fn, const _Ty>, "expected<T, E>::transform(F) requires that F is invocable with T. "
"(N4928 [expected.object.monadic]/23)");
"(N4950 [expected.object.monadic]/23)");
using _Uty = remove_cv_t<invoke_result_t<_Fn, const _Ty>>;
if constexpr (!is_void_v<_Uty>) {
static_assert(_Is_invoke_constructible<_Fn, const _Ty>,
"expected<T, E>::transform(F) requires that the return type of F is constructible with the result of "
"invoking f. (N4928 [expected.object.monadic]/23)");
"invoking f. (N4950 [expected.object.monadic]/23)");
}
static_assert(_Check_expected_argument<_Uty>::value);
@ -997,11 +997,11 @@ public:
requires is_constructible_v<_Ty, _Ty&>
constexpr auto transform_error(_Fn&& _Func) & {
static_assert(invocable<_Fn, _Err&>, "expected<T, E>::transform_error(F) requires that F is invocable with E. "
"(N4928 [expected.object.monadic]/27)");
"(N4950 [expected.object.monadic]/27)");
using _Uty = remove_cv_t<invoke_result_t<_Fn, _Err&>>;
static_assert(_Is_invoke_constructible<_Fn, _Err&>,
"expected<T, E>::transform_error(F) requires that the return type of F is constructible with the result of "
"invoking f. (N4928 [expected.object.monadic]/27)");
"invoking f. (N4950 [expected.object.monadic]/27)");
static_assert(_Check_unexpected_argument<_Uty>::value);
@ -1018,11 +1018,11 @@ public:
constexpr auto transform_error(_Fn&& _Func) const& {
static_assert(invocable<_Fn, const _Err&>,
"expected<T, E>::transform_error(F) requires that F is invocable with E. "
"(N4928 [expected.object.monadic]/27)");
"(N4950 [expected.object.monadic]/27)");
using _Uty = remove_cv_t<invoke_result_t<_Fn, const _Err&>>;
static_assert(_Is_invoke_constructible<_Fn, const _Err&>,
"expected<T, E>::transform_error(F) requires that the return type of F is constructible with the result of "
"invoking f. (N4928 [expected.object.monadic]/27)");
"invoking f. (N4950 [expected.object.monadic]/27)");
static_assert(_Check_unexpected_argument<_Uty>::value);
@ -1038,11 +1038,11 @@ public:
requires is_move_constructible_v<_Ty>
constexpr auto transform_error(_Fn&& _Func) && {
static_assert(invocable<_Fn, _Err>, "expected<T, E>::transform_error(F) requires that F is invocable with E. "
"(N4928 [expected.object.monadic]/31)");
"(N4950 [expected.object.monadic]/31)");
using _Uty = remove_cv_t<invoke_result_t<_Fn, _Err>>;
static_assert(_Is_invoke_constructible<_Fn, _Err>,
"expected<T, E>::transform_error(F) requires that the return type of F is constructible with the result of "
"invoking f. (N4928 [expected.object.monadic]/31)");
"invoking f. (N4950 [expected.object.monadic]/31)");
static_assert(_Check_unexpected_argument<_Uty>::value);
@ -1059,11 +1059,11 @@ public:
constexpr auto transform_error(_Fn&& _Func) const&& {
static_assert(invocable<_Fn, const _Err>,
"expected<T, E>::transform_error(F) requires that F is invocable with E. "
"(N4928 [expected.object.monadic]/31)");
"(N4950 [expected.object.monadic]/31)");
using _Uty = remove_cv_t<invoke_result_t<_Fn, const _Err>>;
static_assert(_Is_invoke_constructible<_Fn, const _Err>,
"expected<T, E>::transform_error(F) requires that the return type of F is constructible with the result of "
"invoking f. (N4928 [expected.object.monadic]/31)");
"invoking f. (N4950 [expected.object.monadic]/31)");
static_assert(_Check_unexpected_argument<_Uty>::value);
@ -1444,9 +1444,9 @@ public:
_NODISCARD constexpr _Err error_or(_Uty&& _Other) const& noexcept(
is_nothrow_copy_constructible_v<_Err>&& is_nothrow_convertible_v<_Uty, _Err>) /* strengthened */ {
static_assert(
is_copy_constructible_v<_Err>, "is_copy_constructible_v<E> must be true. (N4928 [expected.void.obs]/9)");
is_copy_constructible_v<_Err>, "is_copy_constructible_v<E> must be true. (N4950 [expected.void.obs]/9)");
static_assert(
is_convertible_v<_Uty, _Err>, "is_convertible_v<G, E> must be true. (N4928 [expected.void.obs]/9)");
is_convertible_v<_Uty, _Err>, "is_convertible_v<G, E> must be true. (N4950 [expected.void.obs]/9)");
if (_Has_value) {
return _STD forward<_Uty>(_Other);
@ -1459,9 +1459,9 @@ public:
_NODISCARD constexpr _Err error_or(_Uty&& _Other) && noexcept(
is_nothrow_move_constructible_v<_Err>&& is_nothrow_convertible_v<_Uty, _Err>) /* strengthened */ {
static_assert(
is_move_constructible_v<_Err>, "is_move_constructible_v<E> must be true. (N4928 [expected.void.obs]/11)");
is_move_constructible_v<_Err>, "is_move_constructible_v<E> must be true. (N4950 [expected.void.obs]/11)");
static_assert(
is_convertible_v<_Uty, _Err>, "is_convertible_v<G, E> must be true. (N4928 [expected.void.obs]/11)");
is_convertible_v<_Uty, _Err>, "is_convertible_v<G, E> must be true. (N4950 [expected.void.obs]/11)");
if (_Has_value) {
return _STD forward<_Uty>(_Other);
@ -1478,10 +1478,10 @@ public:
static_assert(_Is_specialization_v<_Uty, expected>,
"expected<void, E>::and_then(F) requires the return type of F to be a specialization of expected. "
"(N4928 [expected.void.monadic]/3)");
"(N4950 [expected.void.monadic]/3)");
static_assert(is_same_v<typename _Uty::error_type, _Err>,
"expected<void, E>::and_then(F) requires the error type of the return type of F to be E. "
"(N4928 [expected.void.monadic]/3)");
"(N4950 [expected.void.monadic]/3)");
if (_Has_value) {
return _STD forward<_Fn>(_Func)(); // f() is equivalent to invoke(f)
@ -1497,10 +1497,10 @@ public:
static_assert(_Is_specialization_v<_Uty, expected>,
"expected<void, E>::and_then(F) requires the return type of F to be a specialization of expected. "
"(N4928 [expected.void.monadic]/3)");
"(N4950 [expected.void.monadic]/3)");
static_assert(is_same_v<typename _Uty::error_type, _Err>,
"expected<void, E>::and_then(F) requires the error type of the return type of F to be E. "
"(N4928 [expected.void.monadic]/3)");
"(N4950 [expected.void.monadic]/3)");
if (_Has_value) {
return _STD forward<_Fn>(_Func)(); // f() is equivalent to invoke(f)
@ -1516,10 +1516,10 @@ public:
static_assert(_Is_specialization_v<_Uty, expected>,
"expected<void, E>::and_then(F) requires the return type of F to be a specialization of expected. "
"(N4928 [expected.void.monadic]/7)");
"(N4950 [expected.void.monadic]/7)");
static_assert(is_same_v<typename _Uty::error_type, _Err>,
"expected<void, E>::and_then(F) requires the error type of the return type of F to be E. "
"(N4928 [expected.void.monadic]/7)");
"(N4950 [expected.void.monadic]/7)");
if (_Has_value) {
return _STD forward<_Fn>(_Func)(); // f() is equivalent to invoke(f)
@ -1535,10 +1535,10 @@ public:
static_assert(_Is_specialization_v<_Uty, expected>,
"expected<void, E>::and_then(F) requires the return type of F to be a specialization of expected. "
"(N4928 [expected.void.monadic]/7)");
"(N4950 [expected.void.monadic]/7)");
static_assert(is_same_v<typename _Uty::error_type, _Err>,
"expected<void, E>::and_then(F) requires the error type of the return type of F to be E. "
"(N4928 [expected.void.monadic]/7)");
"(N4950 [expected.void.monadic]/7)");
if (_Has_value) {
return _STD forward<_Fn>(_Func)(); // f() is equivalent to invoke(f)
@ -1553,10 +1553,10 @@ public:
static_assert(_Is_specialization_v<_Uty, expected>,
"expected<void, E>::or_else(F) requires the return type of F to be a specialization of expected. "
"(N4928 [expected.void.monadic]/10)");
"(N4950 [expected.void.monadic]/10)");
static_assert(is_same_v<typename _Uty::value_type, _Ty>,
"expected<void, E>::or_else(F) requires the value type of the return type of F to be T. "
"(N4928 [expected.void.monadic]/10)");
"(N4950 [expected.void.monadic]/10)");
if (_Has_value) {
return _Uty{};
@ -1571,10 +1571,10 @@ public:
static_assert(_Is_specialization_v<_Uty, expected>,
"expected<void, E>::or_else(F) requires the return type of F to be a specialization of expected. "
"(N4928 [expected.void.monadic]/10)");
"(N4950 [expected.void.monadic]/10)");
static_assert(is_same_v<typename _Uty::value_type, _Ty>,
"expected<void, E>::or_else(F) requires the value type of the return type of F to be T. "
"(N4928 [expected.void.monadic]/10)");
"(N4950 [expected.void.monadic]/10)");
if (_Has_value) {
return _Uty{};
@ -1589,10 +1589,10 @@ public:
static_assert(_Is_specialization_v<_Uty, expected>,
"expected<void, E>::or_else(F) requires the return type of F to be a specialization of expected. "
"(N4928 [expected.void.monadic]/13)");
"(N4950 [expected.void.monadic]/13)");
static_assert(is_same_v<typename _Uty::value_type, _Ty>,
"expected<void, E>::or_else(F) requires the value type of the return type of F to be T. "
"(N4928 [expected.void.monadic]/13)");
"(N4950 [expected.void.monadic]/13)");
if (_Has_value) {
return _Uty{};
@ -1607,10 +1607,10 @@ public:
static_assert(_Is_specialization_v<_Uty, expected>,
"expected<void, E>::or_else(F) requires the return type of F to be a specialization of expected. "
"(N4928 [expected.void.monadic]/13)");
"(N4950 [expected.void.monadic]/13)");
static_assert(is_same_v<typename _Uty::value_type, _Ty>,
"expected<void, E>::or_else(F) requires the value type of the return type of F to be T. "
"(N4928 [expected.void.monadic]/13)");
"(N4950 [expected.void.monadic]/13)");
if (_Has_value) {
return _Uty{};
@ -1623,13 +1623,13 @@ public:
requires is_constructible_v<_Err, _Err&>
constexpr auto transform(_Fn&& _Func) & {
static_assert(invocable<_Fn>, "expected<void, E>::transform(F) requires that F is invocable with no arguments. "
"(N4928 [expected.void.monadic]/17)");
"(N4950 [expected.void.monadic]/17)");
using _Uty = remove_cv_t<invoke_result_t<_Fn>>;
if constexpr (!is_void_v<_Uty>) {
static_assert(_Is_invoke_constructible<_Fn>, "expected<void, E>::transform(F) requires that the return "
"type of F is constructible with the result of "
"invoking f. (N4928 [expected.void.monadic]/17)");
"invoking f. (N4950 [expected.void.monadic]/17)");
}
static_assert(_Check_expected_argument<_Uty>::value);
@ -1649,13 +1649,13 @@ public:
requires is_copy_constructible_v<_Err>
constexpr auto transform(_Fn&& _Func) const& {
static_assert(invocable<_Fn>, "expected<void, E>::transform(F) requires that F is invocable with no arguments. "
"(N4928 [expected.void.monadic]/17)");
"(N4950 [expected.void.monadic]/17)");
using _Uty = remove_cv_t<invoke_result_t<_Fn>>;
if constexpr (!is_void_v<_Uty>) {
static_assert(_Is_invoke_constructible<_Fn>, "expected<void, E>::transform(F) requires that the return "
"type of F is constructible with the result of "
"invoking f. (N4928 [expected.void.monadic]/17)");
"invoking f. (N4950 [expected.void.monadic]/17)");
}
static_assert(_Check_expected_argument<_Uty>::value);
@ -1675,13 +1675,13 @@ public:
requires is_move_constructible_v<_Err>
constexpr auto transform(_Fn&& _Func) && {
static_assert(invocable<_Fn>, "expected<void, E>::transform(F) requires that F is invocable with no arguments. "
"(N4928 [expected.void.monadic]/21)");
"(N4950 [expected.void.monadic]/21)");
using _Uty = remove_cv_t<invoke_result_t<_Fn>>;
if constexpr (!is_void_v<_Uty>) {
static_assert(_Is_invoke_constructible<_Fn>, "expected<void, E>::transform(F) requires that the return "
"type of F is constructible with the result of "
"invoking f. (N4928 [expected.void.monadic]/21)");
"invoking f. (N4950 [expected.void.monadic]/21)");
}
static_assert(_Check_expected_argument<_Uty>::value);
@ -1701,13 +1701,13 @@ public:
requires is_constructible_v<_Err, const _Err>
constexpr auto transform(_Fn&& _Func) const&& {
static_assert(invocable<_Fn>, "expected<void, E>::transform(F) requires that F is invocable with no arguments. "
"(N4928 [expected.void.monadic]/21)");
"(N4950 [expected.void.monadic]/21)");
using _Uty = remove_cv_t<invoke_result_t<_Fn>>;
if constexpr (!is_void_v<_Uty>) {
static_assert(_Is_invoke_constructible<_Fn>, "expected<void, E>::transform(F) requires that the return "
"type of F is constructible with the result of "
"invoking f. (N4928 [expected.void.monadic]/21)");
"invoking f. (N4950 [expected.void.monadic]/21)");
}
static_assert(_Check_expected_argument<_Uty>::value);
@ -1727,11 +1727,11 @@ public:
constexpr auto transform_error(_Fn&& _Func) & {
static_assert(invocable<_Fn, _Err&>,
"expected<void, E>::transform_error(F) requires that F is invocable with E. "
"(N4928 [expected.void.monadic]/24)");
"(N4950 [expected.void.monadic]/24)");
using _Uty = remove_cv_t<invoke_result_t<_Fn, _Err&>>;
static_assert(_Is_invoke_constructible<_Fn, _Err&>, "expected<void, E>::transform_error(F) requires that the "
"return type of F is constructible with the result of "
"invoking f. (N4928 [expected.void.monadic]/24)");
"invoking f. (N4950 [expected.void.monadic]/24)");
static_assert(_Check_unexpected_argument<_Uty>::value);
@ -1747,12 +1747,12 @@ public:
constexpr auto transform_error(_Fn&& _Func) const& {
static_assert(invocable<_Fn, const _Err&>,
"expected<void, E>::transform_error(F) requires that F is invocable with E. "
"(N4928 [expected.void.monadic]/24)");
"(N4950 [expected.void.monadic]/24)");
using _Uty = remove_cv_t<invoke_result_t<_Fn, const _Err&>>;
static_assert(_Is_invoke_constructible<_Fn, const _Err&>,
"expected<void, E>::transform_error(F) requires that the "
"return type of F is constructible with the result of "
"invoking f. (N4928 [expected.void.monadic]/24)");
"invoking f. (N4950 [expected.void.monadic]/24)");
static_assert(_Check_unexpected_argument<_Uty>::value);
@ -1768,11 +1768,11 @@ public:
constexpr auto transform_error(_Fn&& _Func) && {
static_assert(invocable<_Fn, _Err>,
"expected<void, E>::transform_error(F) requires that F is invocable with E. "
"(N4928 [expected.void.monadic]/27)");
"(N4950 [expected.void.monadic]/27)");
using _Uty = remove_cv_t<invoke_result_t<_Fn, _Err>>;
static_assert(_Is_invoke_constructible<_Fn, _Err>, "expected<void, E>::transform_error(F) requires that the "
"return type of F is constructible with the result of "
"invoking f. (N4928 [expected.void.monadic]/27)");
"invoking f. (N4950 [expected.void.monadic]/27)");
static_assert(_Check_unexpected_argument<_Uty>::value);
@ -1788,12 +1788,12 @@ public:
constexpr auto transform_error(_Fn&& _Func) const&& {
static_assert(invocable<_Fn, const _Err>,
"expected<void, E>::transform_error(F) requires that F is invocable with E. "
"(N4928 [expected.void.monadic]/27)");
"(N4950 [expected.void.monadic]/27)");
using _Uty = remove_cv_t<invoke_result_t<_Fn, const _Err>>;
static_assert(_Is_invoke_constructible<_Fn, const _Err>,
"expected<void, E>::transform_error(F) requires that the "
"return type of F is constructible with the result of "
"invoking f. (N4928 [expected.void.monadic]/27)");
"invoking f. (N4950 [expected.void.monadic]/27)");
static_assert(_Check_unexpected_argument<_Uty>::value);

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

@ -205,7 +205,7 @@ namespace filesystem {
template <class _Conversion>
_NODISCARD wstring _Convert_stringoid_to_wide(const wstring_view _Input, _Conversion) {
static_assert(
is_same_v<_Conversion, _Normal_conversion>, "invalid value_type, see N4810 D.17 [depr.fs.path.factory]/1");
is_same_v<_Conversion, _Normal_conversion>, "invalid value_type, see N4950 [depr.fs.path.factory]/1");
return wstring{_Input};
}
@ -222,14 +222,14 @@ namespace filesystem {
template <class _Conversion>
_NODISCARD wstring _Convert_stringoid_to_wide(const u16string_view _Input, _Conversion) {
static_assert(
is_same_v<_Conversion, _Normal_conversion>, "invalid value_type, see N4810 D.17 [depr.fs.path.factory]/1");
is_same_v<_Conversion, _Normal_conversion>, "invalid value_type, see N4950 [depr.fs.path.factory]/1");
return wstring{_Input.data(), _Input.data() + _Input.size()};
}
template <class _Conversion>
_NODISCARD wstring _Convert_stringoid_to_wide(const u32string_view _Input, _Conversion) {
static_assert(
is_same_v<_Conversion, _Normal_conversion>, "invalid value_type, see N4810 D.17 [depr.fs.path.factory]/1");
is_same_v<_Conversion, _Normal_conversion>, "invalid value_type, see N4950 [depr.fs.path.factory]/1");
return _Convert_utf32_to_wide(_Input);
}
@ -327,7 +327,7 @@ namespace filesystem {
return _Output;
case codecvt_base::partial:
// N4810 28.4.1.4.2 [locale.codecvt.virtuals]/5:
// N4950 [locale.codecvt.virtuals]/5:
// "A return value of partial, if (from_next == from_end), indicates that either the
// destination sequence has not absorbed all the available destination elements,
// or that additional source elements are needed before another destination element can be produced."
@ -653,7 +653,7 @@ namespace filesystem {
template <class _InIt>
path(_InIt _First, _InIt _Last, format = auto_format) : _Text(_Convert_range_to_wide(_First, _Last)) {
// format has no meaning for this implementation, as the generic grammar is acceptable as a native path
static_assert(_Is_EcharT<_Iter_value_t<_InIt>>, "invalid value_type, see N4810 29.11.4 [fs.req]/3");
static_assert(_Is_EcharT<_Iter_value_t<_InIt>>, "invalid value_type, see N4950 [fs.req]/3");
}
template <class _Src, enable_if_t<_Is_Source<_Src>, int> = 0>
@ -662,15 +662,14 @@ namespace filesystem {
// format has no meaning for this implementation, as the generic grammar is acceptable as a native path
using _Stringoid = decltype(_Stringoid_from_Source(_Source));
static_assert(is_same_v<typename _Stringoid::value_type, char>,
"invalid value_type, see N4810 29.11.7.4.1 [fs.path.construct]/6");
"invalid value_type, see N4950 [fs.path.construct]/5");
}
template <class _InIt>
path(_InIt _First, _InIt _Last, const locale& _Loc, format = auto_format)
: _Text(_Convert_stringoid_with_locale_to_wide(_Stringoid_from_range(_First, _Last), _Loc)) {
// format has no meaning for this implementation, as the generic grammar is acceptable as a native path
static_assert(is_same_v<_Iter_value_t<_InIt>, char>,
"invalid value_type, see N4810 29.11.7.4.1 [fs.path.construct]/6");
static_assert(is_same_v<_Iter_value_t<_InIt>, char>, "invalid value_type, see N4950 [fs.path.construct]/5");
}
path& operator=(string_type&& _Source) noexcept /* strengthened */ {
@ -699,7 +698,7 @@ namespace filesystem {
template <class _InIt>
path& assign(_InIt _First, _InIt _Last) { // set native() to [_First, _Last)
static_assert(_Is_EcharT<_Iter_value_t<_InIt>>, "invalid value_type, see N4810 29.11.4 [fs.req]/3");
static_assert(_Is_EcharT<_Iter_value_t<_InIt>>, "invalid value_type, see N4950 [fs.req]/3");
_Text = _Convert_range_to_wide(_First, _Last);
return *this;
}
@ -782,7 +781,7 @@ namespace filesystem {
template <class _InIt>
path& append(_InIt _First, _InIt _Last) {
static_assert(_Is_EcharT<_Iter_value_t<_InIt>>, "invalid value_type, see N4810 29.11.4 [fs.req]/3");
static_assert(_Is_EcharT<_Iter_value_t<_InIt>>, "invalid value_type, see N4950 [fs.req]/3");
return operator/=(path{_First, _Last});
}
@ -831,7 +830,7 @@ namespace filesystem {
template <class _InIt>
path& concat(_InIt _First, _InIt _Last) { // concat [_First, _Last) to native()
static_assert(_Is_EcharT<_Iter_value_t<_InIt>>, "invalid value_type, see N4810 29.11.4 [fs.req]/3");
static_assert(_Is_EcharT<_Iter_value_t<_InIt>>, "invalid value_type, see N4950 [fs.req]/3");
return operator+=(path{_First, _Last}._Text);
}
@ -1189,7 +1188,7 @@ namespace filesystem {
constexpr wstring_view _Dot = L"."sv;
constexpr wstring_view _Dot_dot = L".."sv;
// N4810 29.11.7.1 [fs.path.generic]/6:
// N4950 [fs.path.generic]/6:
// "Normalization of a generic format pathname means:"
// "1. If the path is empty, stop."
@ -1328,7 +1327,7 @@ namespace filesystem {
// extract a path from a stream
basic_string<_Elem, _Traits> _Tmp;
_Istr >> _STD quoted(_Tmp);
_Path = _STD move(_Tmp); // obvious optimization not depicted in N4810 29.11.7.6 [fs.path.io]/3
_Path = _STD move(_Tmp); // obvious optimization not depicted in N4950 [fs.path.io]/3
return _Istr;
}
@ -1380,7 +1379,7 @@ namespace filesystem {
_EXPORT_STD template <class _InIt>
_CXX20_DEPRECATE_U8PATH _NODISCARD path u8path(_InIt _First, _InIt _Last) {
// construct a path from UTF-8 [_First, _Last)
static_assert(_Is_EcharT<_Iter_value_t<_InIt>>, "invalid value_type, see N4810 29.11.4 [fs.req]/3");
static_assert(_Is_EcharT<_Iter_value_t<_InIt>>, "invalid value_type, see N4950 [fs.req]/3");
return path{_Convert_range_to_wide(_First, _Last, _Utf8_conversion{})};
}
@ -1388,7 +1387,7 @@ namespace filesystem {
class _Path_iterator { // almost bidirectional iterator for path
public:
// Note that the path::iterator can be decremented and can be dereferenced multiple times,
// but doesn't actually meet the forward iterator requirements. See N4810 29.11.7.5 [fs.path.itr]/2:
// but doesn't actually meet the forward iterator requirements. See N4950 [fs.path.itr]/2:
// ... for dereferenceable iterators a and b of type path::iterator with a == b, there is no requirement
// that *a and *b are bound to the same object
// This means that you can't give path::iterator to std::reverse_iterator, as operator* there ends
@ -1678,7 +1677,7 @@ namespace filesystem {
return _Result;
}
{ // Skip root-name and root-directory elements, N4810 29.11.7.5 [fs.path.itr]/4.1, 4.2
{ // Skip root-name and root-directory elements, N4950 [fs.path.itr]/4.1, 4.2
ptrdiff_t _B_dist = _STD distance(_Base_begin, _B_iter);
const ptrdiff_t _Base_root_dist =
@ -1695,8 +1694,8 @@ namespace filesystem {
for (; _B_iter != _Base_end; ++_B_iter) {
const path& _Elem = *_B_iter;
if (_Elem.empty()) { // skip empty element, N4810 29.11.7.5 [fs.path.itr]/4.4
} else if (_Elem == _Dot) { // skip filename elements that are dot, N4810 29.11.7.4.11 [fs.path.gen]/4.2
if (_Elem.empty()) { // skip empty element, N4950 [fs.path.itr]/4.4
} else if (_Elem == _Dot) { // skip filename elements that are dot, N4950 [fs.path.gen]/3.6
} else if (_Elem == _Dot_dot) {
--_Num;
} else {
@ -4172,7 +4171,7 @@ namespace filesystem {
_EXPORT_STD _NODISCARD inline path proximate(const path& _Path, error_code& _Ec) {
// eventually calls GetFinalPathNameByHandleW
const path _Base = _STD filesystem::current_path(_Ec);
// N4810 29.11.14.27 [fs.op.proximate]/1 incorrectly calls current_path()
// N4950 [fs.op.proximate]/1 incorrectly calls current_path()
if (_Ec) {
return {};
}
@ -4208,7 +4207,7 @@ namespace filesystem {
_EXPORT_STD _NODISCARD inline path relative(const path& _Path, error_code& _Ec) {
// eventually calls GetFinalPathNameByHandleW
const path _Base = _STD filesystem::current_path(_Ec);
// N4810 29.11.14.29 [fs.op.relative]/1 incorrectly calls current_path()
// N4950 [fs.op.relative]/1 incorrectly calls current_path()
if (_Ec) {
return {};
}
@ -4219,7 +4218,7 @@ namespace filesystem {
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
// Standard quotes herein are relative to N4810
// Standard quotes herein are relative to N4950
// The following parts of LWG-3057 are implemented:
// * guarding equivalent() from nonexistent to
// * replacing unspecified recursion prevention tag with copy_options::directories_only

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

@ -3516,7 +3516,7 @@ inline namespace __p2286 {
#endif // _HAS_CXX23
// Generic formatter definition, the deleted default constructor
// makes it "disabled" as per N4928 [format.formatter.spec]/5
// makes it "disabled" as per N4950 [format.formatter.spec]/5
_EXPORT_STD template <class _Ty, class _CharT>
struct formatter {
formatter() = delete;

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

@ -1165,7 +1165,7 @@ struct _Deduce_signature {}; // can't deduce signature when &_Fx::operator() is
template <class _Fx>
struct _Deduce_signature<_Fx, void_t<decltype(&_Fx::operator())>>
: _Is_memfunptr<decltype(&_Fx::operator())>::_Guide_type {}; // N4842 [func.wrap.func.con]/12
: _Is_memfunptr<decltype(&_Fx::operator())>::_Guide_type {}; // N4950 [func.wrap.func.con]/16.1
template <class _Fx>
function(_Fx) -> function<typename _Deduce_signature<_Fx>::type>;
@ -1249,7 +1249,7 @@ inline constexpr size_t _Minimum_function_size = 2 * sizeof(void*);
template <class _Rx, class... _Types>
[[noreturn]] _Rx __stdcall _Function_not_callable(const _Move_only_function_data&, _Types&&...) noexcept {
_CSTD abort(); // Unlike std::function, move_only_function doesn't throw bad_function_call
// (N4901 [func.wrap.move.inv]/2)
// (N4950 [func.wrap.move.inv]/2)
}
template <class _Vt, class _VtInvQuals, class _Rx, bool _Noex, class... _Types>
@ -1438,7 +1438,7 @@ public:
}
void _Move_assign(_Move_only_function_base&& _Other) noexcept {
// As specified in N4901 [func.wrap.move.ctor]/22, we are expected to first move the new target,
// As specified in N4950 [func.wrap.move.ctor]/22, we are expected to first move the new target,
// then finally destroy the old target.
// It is more efficient to do the reverse - this way no temporary storage for the old target will be used.
// In some cases when some operations are trivial, it can be optimized,
@ -1802,7 +1802,7 @@ public:
move_only_function(_Fn&& _Callable) {
using _Vt = decay_t<_Fn>;
static_assert(is_constructible_v<_Vt, _Fn>, "_Vt should be constructible from _Fn. "
"(N4901 [func.wrap.move.ctor]/6)");
"(N4950 [func.wrap.move.ctor]/6)");
if constexpr (is_member_pointer_v<_Vt> || is_pointer_v<_Vt> || _Is_specialization_v<_Vt, move_only_function>) {
if (_Callable == nullptr) {
@ -1818,7 +1818,7 @@ public:
template <class _Fn, class... _CTypes, enable_if_t<_Enable_in_place_constructor<_Fn, _CTypes...>, int> = 0>
explicit move_only_function(in_place_type_t<_Fn>, _CTypes&&... _Args) {
using _Vt = decay_t<_Fn>;
static_assert(is_same_v<_Vt, _Fn>, "_Vt should be the same type as _Fn. (N4901 [func.wrap.move.ctor]/12)");
static_assert(is_same_v<_Vt, _Fn>, "_Vt should be the same type as _Fn. (N4950 [func.wrap.move.ctor]/12)");
using _VtInvQuals = typename _Call::template _VtInvQuals<_Vt>;
this->template _Construct_with_fn<_Vt, _VtInvQuals>(_STD forward<_CTypes>(_Args)...);
@ -1828,7 +1828,7 @@ public:
enable_if_t<_Enable_in_place_list_constructor<_Fn, _Ux, _CTypes...>, int> = 0>
explicit move_only_function(in_place_type_t<_Fn>, initializer_list<_Ux> _Li, _CTypes&&... _Args) {
using _Vt = decay_t<_Fn>;
static_assert(is_same_v<_Vt, _Fn>, "_Vt should be the same type as _Fn. (N4901 [func.wrap.move.ctor]/18)");
static_assert(is_same_v<_Vt, _Fn>, "_Vt should be the same type as _Fn. (N4950 [func.wrap.move.ctor]/18)");
using _VtInvQuals = typename _Call::template _VtInvQuals<_Vt>;
this->template _Construct_with_fn<_Vt, _VtInvQuals>(_Li, _STD forward<_CTypes>(_Args)...);
@ -1846,7 +1846,9 @@ public:
return *this;
}
move_only_function& operator=(move_only_function&& _Other) {
move_only_function& operator=(move_only_function&& _Other)
// intentionally noexcept(false), leaving the door open to adding allocator support in the future; see GH-2278
{
if (this != _STD addressof(_Other)) {
this->_Move_assign(_STD move(_Other));
}

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

@ -290,7 +290,7 @@ public:
}
// TRANSITION: `_Retrieved` should be assigned before `_Exception` is thrown so that a `future::get`
// that throws a stored exception invalidates the future (N4928 [futures.unique.future]/17)
// that throws a stored exception invalidates the future (N4950 [futures.unique.future]/17)
_Retrieved = true;
_Maybe_run_deferred_function(_Lock);
while (!_Ready) {
@ -361,7 +361,7 @@ public:
}
_STL_ASSERT(_Exc != nullptr, "promise<T>::set_exception/set_exception_at_thread_exit called with a null "
"std::exception_ptr, which is invalid per N4928 [futures.promise]/20");
"std::exception_ptr, which is invalid per N4950 [futures.promise]/20");
_Exception = _Exc;
_Do_notify(_Lock, _At_thread_exit);
}
@ -879,7 +879,7 @@ private:
public:
static_assert(!is_array_v<_Ty> && is_object_v<_Ty> && is_destructible_v<_Ty>,
"T in future<T> must meet the Cpp17Destructible requirements (N4928 [futures.unique.future]/4).");
"T in future<T> must meet the Cpp17Destructible requirements (N4950 [futures.unique.future]/4).");
future() = default;
@ -967,7 +967,7 @@ private:
public:
static_assert(!is_array_v<_Ty> && is_object_v<_Ty> && is_destructible_v<_Ty>,
"T in shared_future<T> must meet the Cpp17Destructible requirements (N4928 [futures.shared.future]/4).");
"T in shared_future<T> must meet the Cpp17Destructible requirements (N4950 [futures.shared.future]/4).");
shared_future() = default;
@ -1106,7 +1106,7 @@ _EXPORT_STD template <class _Ty>
class promise { // class that defines an asynchronous provider that holds a value
public:
static_assert(!is_array_v<_Ty> && is_object_v<_Ty> && is_destructible_v<_Ty>,
"T in promise<T> must meet the Cpp17Destructible requirements (N4928 [futures.promise]/1).");
"T in promise<T> must meet the Cpp17Destructible requirements (N4950 [futures.promise]/1).");
promise() : _MyPromise(new _Associated_state<_Ty>) {}

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

@ -247,7 +247,7 @@ public:
static_assert(conjunction_v<is_default_constructible<_Ty>, is_copy_constructible<_Ty>, is_copy_assignable<_Ty>>,
"istream_iterator<T> requires T to be default constructible, copy constructible, and copy assignable. "
"(N4835 [istream.iterator]/2)");
"(N4950 [istream.iterator]/2)");
constexpr istream_iterator() noexcept(is_nothrow_default_constructible_v<_Ty>) /* strengthened */ {}
@ -1378,7 +1378,7 @@ public:
(void) _Right;
#else // ^^^ workaround / no workaround vvv
// Per N4901 [counted.iterator]/3, two counted_iterators x and y refer to elements of the same sequence iff
// Per N4950 [counted.iterator]/3, two counted_iterators x and y refer to elements of the same sequence iff
// for some integer n, next(x.base(), x.count() + n) and next(y.base(), y.count() + n)
// "refer to the same (possibly past-the-end) element".
// Iterator equality is a fair proxy for the vaguely-defined "refer to the same element".

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

@ -36,20 +36,20 @@ public:
}
constexpr explicit latch(const ptrdiff_t _Expected) noexcept /* strengthened */ : _Counter{_Expected} {
_STL_VERIFY(_Expected >= 0, "Precondition: expected >= 0 (N4861 [thread.latch.class]/4)");
_STL_VERIFY(_Expected >= 0, "Precondition: expected >= 0 (N4950 [thread.latch.class]/4)");
}
latch(const latch&) = delete;
latch& operator=(const latch&) = delete;
void count_down(const ptrdiff_t _Update = 1) noexcept /* strengthened */ {
_STL_VERIFY(_Update >= 0, "Precondition: update >= 0 (N4861 [thread.latch.class]/7)");
_STL_VERIFY(_Update >= 0, "Precondition: update >= 0 (N4950 [thread.latch.class]/7)");
// TRANSITION, GH-1133: should be memory_order_release
const ptrdiff_t _Current = _Counter.fetch_sub(_Update) - _Update;
if (_Current == 0) {
_Counter.notify_all();
} else {
_STL_VERIFY(_Current >= 0, "Precondition: update <= counter (N4861 [thread.latch.class]/7)");
_STL_VERIFY(_Current >= 0, "Precondition: update <= counter (N4950 [thread.latch.class]/7)");
}
}
@ -66,20 +66,20 @@ public:
return;
} else {
_STL_VERIFY(_Current > 0, "Invariant counter >= 0, possibly caused by preconditions violation "
"(N4861 [thread.latch.class]/7)");
"(N4950 [thread.latch.class]/7)");
}
_Counter.wait(_Current, memory_order_relaxed);
}
}
void arrive_and_wait(const ptrdiff_t _Update = 1) noexcept /* strengthened */ {
_STL_VERIFY(_Update >= 0, "Precondition: update >= 0 (N4861 [thread.latch.class]/7)");
_STL_VERIFY(_Update >= 0, "Precondition: update >= 0 (N4950 [thread.latch.class]/7)");
// TRANSITION, GH-1133: should be memory_order_acq_rel
const ptrdiff_t _Current = _Counter.fetch_sub(_Update) - _Update;
if (_Current == 0) {
_Counter.notify_all();
} else {
_STL_VERIFY(_Current > 0, "Precondition: update <= counter (N4861 [thread.latch.class]/7)");
_STL_VERIFY(_Current > 0, "Precondition: update <= counter (N4950 [thread.latch.class]/7)");
_Counter.wait(_Current, memory_order_relaxed);
wait();
}

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

@ -1510,24 +1510,24 @@ struct _SP_convertible<_Yty, _Uty[_Ext]> : is_convertible<_Yty (*)[_Ext], _Uty (
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
// with a pointer type T* " "when either Y* is convertible to T* ..."
// N4950 [util.smartptr.shared.general]/6 "a pointer type Y* is said to be compatible
// with a pointer type T* when either Y* is convertible to T* ..."
};
template <class _Uty, size_t _Ext>
struct _SP_pointer_compatible<_Uty[_Ext], _Uty[]> : true_type {
// N4659 [util.smartptr.shared]/5 "... or Y is U[N] and T is cv U[]."
// N4950 [util.smartptr.shared.general]/6 "... or Y is U[N] and T is cv U[]."
};
template <class _Uty, size_t _Ext>
struct _SP_pointer_compatible<_Uty[_Ext], const _Uty[]> : true_type {
// N4659 [util.smartptr.shared]/5 "... or Y is U[N] and T is cv U[]."
// N4950 [util.smartptr.shared.general]/6 "... or Y is U[N] and T is cv U[]."
};
template <class _Uty, size_t _Ext>
struct _SP_pointer_compatible<_Uty[_Ext], volatile _Uty[]> : true_type {
// N4659 [util.smartptr.shared]/5 "... or Y is U[N] and T is cv U[]."
// N4950 [util.smartptr.shared.general]/6 "... or Y is U[N] and T is cv U[]."
};
template <class _Uty, size_t _Ext>
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[]."
// N4950 [util.smartptr.shared.general]/6 "... or Y is U[N] and T is cv U[]."
};
template <class _Ux>
@ -2108,7 +2108,7 @@ public:
~_Ref_count_obj2() noexcept override { // TRANSITION, should be non-virtual
// nothing to do, _Storage._Value was already destroyed in _Destroy
// N4849 [class.dtor]/7:
// N4950 [class.dtor]/7:
// "A defaulted destructor for a class X is defined as deleted if:
// X is a union-like class that has a variant member with a non-trivial destructor"
}
@ -2371,7 +2371,7 @@ private:
~_Ref_count_unbounded_array() noexcept override { // TRANSITION, should be non-virtual
// nothing to do, _Ty is trivially destructible
// See N4849 [class.dtor]/7.
// See N4950 [class.dtor]/7.
}
void _Destroy() noexcept override { // destroy managed resource
@ -2419,7 +2419,7 @@ private:
~_Ref_count_unbounded_array() noexcept override { // TRANSITION, should be non-virtual
// nothing to do, _Storage was already destroyed in _Destroy
// See N4849 [class.dtor]/7.
// See N4950 [class.dtor]/7.
}
void _Destroy() noexcept override { // destroy managed resource
@ -2457,11 +2457,13 @@ private:
~_Ref_count_bounded_array() noexcept override { // TRANSITION, should be non-virtual
// nothing to do, _Storage was already destroyed in _Destroy
// See N4849 [class.dtor]/7.
// See N4950 [class.dtor]/7.
}
void _Destroy() noexcept override { // destroy managed resource
_Destroy_in_place(_Storage); // not _Storage._Value, see N4849 [expr.prim.id.dtor]
// not _Storage._Value as _Ty is an array type (not a class type or a scalar type),
// and thus cannot be used as a pseudo-destructor (N4950 [expr.prim.id.dtor]).
_Destroy_in_place(_Storage);
}
void _Delete_this() noexcept override { // destroy self
@ -2502,7 +2504,7 @@ private:
~_Ref_count_obj_alloc3() noexcept override { // TRANSITION, should be non-virtual
// nothing to do; _Storage._Value already destroyed by _Destroy()
// See N4849 [class.dtor]/7.
// See N4950 [class.dtor]/7.
}
void _Destroy() noexcept override { // destroy managed resource
@ -2689,7 +2691,7 @@ private:
~_Ref_count_unbounded_array_alloc() noexcept override { // TRANSITION, should be non-virtual
// nothing to do; _Storage._Value already destroyed by _Destroy()
// See N4849 [class.dtor]/7.
// See N4950 [class.dtor]/7.
}
void _Destroy() noexcept override { // destroy managed resource
@ -2749,7 +2751,7 @@ private:
~_Ref_count_bounded_array_alloc() noexcept override { // TRANSITION, should be non-virtual
// nothing to do; _Storage._Value already destroyed by _Destroy()
// See N4849 [class.dtor]/7.
// See N4950 [class.dtor]/7.
}
void _Destroy() noexcept override { // destroy managed resource
@ -2786,7 +2788,7 @@ struct _NODISCARD _Global_delete_guard {
_Refc* _Target;
~_Global_delete_guard() {
// While this branch is technically unnecessary because N4849 [new.delete.single]/17 requires
// While this branch is technically unnecessary because N4950 [new.delete.single]/16 requires
// `::operator delete(nullptr)` to be a no-op, it's here to help optimizers see that after
// `_Guard._Target = nullptr;`, this destructor can be eliminated.
if (_Target) {
@ -3006,7 +3008,7 @@ class weak_ptr : public _Ptr_base<_Ty> { // class for pointer to reference count
public:
#ifndef _M_CEE_PURE
// When a constructor is converting from weak_ptr<_Ty2> to weak_ptr<_Ty>, the below type trait intentionally asks
// whether it would be possible to static_cast from _Ty* to const _Ty2*; see N4901 [expr.static.cast]/11.
// whether it would be possible to static_cast from _Ty* to const _Ty2*; see N4950 [expr.static.cast]/12.
// Primary template, the value is used when the substitution fails.
template <class _Ty2, class = const _Ty2*>
@ -4181,7 +4183,7 @@ concept _Resettable_pointer = requires(_SmartPtr& _Smart_ptr, _Pointer _Ptr, _Ar
_EXPORT_STD template <class _SmartPtr, class _Pointer, class... _ArgsT>
class out_ptr_t {
static_assert(!_Is_specialization_v<_SmartPtr, shared_ptr> || sizeof...(_ArgsT) != 0,
"out_ptr_t with shared_ptr requires a deleter (N4892 [out.ptr.t]/3)");
"out_ptr_t with shared_ptr requires a deleter (N4950 [out.ptr.t]/3)");
public:
explicit out_ptr_t(_SmartPtr& _Smart_ptr_, _ArgsT... _Args_) noexcept(
@ -4210,7 +4212,7 @@ public:
if constexpr (_Resettable_pointer<_SmartPtr, _Sp, _Pointer, _ArgsT...>) {
_Smart_ptr.reset(static_cast<_Sp>(_Get_ptr()), _STD forward<_ArgsT>(_Args_)...);
} else {
static_assert(is_constructible_v<_SmartPtr, _Sp, _ArgsT...>, "(N4892 [out.ptr.t]/9.3)");
static_assert(is_constructible_v<_SmartPtr, _Sp, _ArgsT...>, "(N4950 [out.ptr.t]/9.3)");
_Smart_ptr = _SmartPtr(static_cast<_Sp>(_Get_ptr()), _STD forward<_ArgsT>(_Args_)...);
}
},
@ -4225,7 +4227,7 @@ public:
requires (!is_same_v<_Pointer, void*>)
{
static_assert(is_pointer_v<_Pointer>, "conversion of out_ptr_t<Smart, Pointer, Args...> to void** requires "
"Pointer to be a raw pointer (N4892 [out.ptr.t]/13)");
"Pointer to be a raw pointer (N4950 [out.ptr.t]/13)");
return reinterpret_cast<void**>(_STD addressof(_Get_ptr()));
}
@ -4254,7 +4256,7 @@ _NODISCARD auto out_ptr(_SmartPtr& _Smart_ptr, _ArgsT&&... _Args) {
_EXPORT_STD template <class _SmartPtr, class _Pointer, class... _ArgsT>
class inout_ptr_t {
static_assert(!_Is_specialization_v<_SmartPtr, shared_ptr>,
"inout_ptr_t doesn't work with shared_ptr (N4892 [inout.ptr.t]/3)");
"inout_ptr_t doesn't work with shared_ptr (N4950 [inout.ptr.t]/3)");
private:
_NODISCARD static auto _Get_ptr_from_smart(_SmartPtr& _Smart_ptr) noexcept
@ -4294,7 +4296,7 @@ public:
} else if constexpr (_Resettable_pointer<_SmartPtr, _Sp, _Pointer, _ArgsT...>) {
_Smart_ptr.reset(static_cast<_Sp>(_Get_ptr()), _STD forward<_ArgsT>(_Args_)...);
} else {
static_assert(is_constructible_v<_SmartPtr, _Sp, _ArgsT...>, "(N4892 [inout.ptr.t]/11.4)");
static_assert(is_constructible_v<_SmartPtr, _Sp, _ArgsT...>, "(N4950 [inout.ptr.t]/11.4)");
_Smart_ptr = _SmartPtr(static_cast<_Sp>(_Get_ptr()), _STD forward<_ArgsT>(_Args_)...);
}
},
@ -4309,7 +4311,7 @@ public:
requires (!is_same_v<_Pointer, void*>)
{
static_assert(is_pointer_v<_Pointer>, "conversion of inout_ptr_t<Smart, Pointer, Args...> to void** requires "
"Pointer to be a raw pointer (N4892 [inout.ptr.t]/15)");
"Pointer to be a raw pointer (N4950 [inout.ptr.t]/15)");
return reinterpret_cast<void**>(_STD addressof(_Get_ptr()));
}

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

@ -234,14 +234,12 @@ namespace pmr {
unsynchronized_pool_resource(
const pool_options& _Opts, memory_resource* const _Resource) noexcept // strengthened
: _Options(_Opts), _Pools{_Resource} { // initialize pool with options _Opts and upstream _Resource
_STL_ASSERT(
_Resource, "Upstream memory resource must be a valid resource (N4810 20.12.5.3 [mem.res.pool.ctor]/1)");
_STL_ASSERT(_Resource, "Upstream memory resource must be a valid resource (N4950 [mem.res.pool.ctor]/1)");
_Setup_options();
}
explicit unsynchronized_pool_resource(memory_resource* const _Resource) noexcept // strengthened
: _Pools{_Resource} { // initialize pool with default options and upstream _Resource
_STL_ASSERT(
_Resource, "Upstream memory resource must be a valid resource (N4810 20.12.5.3 [mem.res.pool.ctor]/1)");
_STL_ASSERT(_Resource, "Upstream memory resource must be a valid resource (N4950 [mem.res.pool.ctor]/1)");
_Setup_options();
}
explicit unsynchronized_pool_resource(const pool_options& _Opts) noexcept // strengthened

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

@ -74,12 +74,12 @@ public:
void lock() {
if (_Mtx_lock(_Mymtx()) != _Thrd_success) {
// undefined behavior, only occurs for plain mutexes (N4928 [thread.mutex.requirements.mutex.general]/6)
// undefined behavior, only occurs for plain mutexes (N4950 [thread.mutex.requirements.mutex.general]/6)
_STD _Throw_Cpp_error(_RESOURCE_DEADLOCK_WOULD_OCCUR);
}
if (!_Verify_ownership_levels()) {
// only occurs for recursive mutexes (N4928 [thread.mutex.recursive]/3)
// only occurs for recursive mutexes (N4950 [thread.mutex.recursive]/3)
// POSIX specifies EAGAIN in the corresponding situation:
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_mutex_lock.html
_STD _Throw_Cpp_error(_RESOURCE_UNAVAILABLE_TRY_AGAIN);
@ -87,7 +87,7 @@ public:
}
_NODISCARD_TRY_CHANGE_STATE bool try_lock() noexcept /* strengthened */ {
// false may be from undefined behavior for plain mutexes (N4928 [thread.mutex.requirements.mutex.general]/6)
// false may be from undefined behavior for plain mutexes (N4950 [thread.mutex.requirements.mutex.general]/6)
return _Mtx_trylock(_Mymtx()) == _Thrd_success;
}
@ -104,7 +104,7 @@ public:
protected:
_NODISCARD_TRY_CHANGE_STATE bool _Verify_ownership_levels() noexcept {
if (_Mtx_storage_mirror._Count == INT_MAX) {
// only occurs for recursive mutexes (N4928 [thread.mutex.recursive]/3)
// only occurs for recursive mutexes (N4950 [thread.mutex.recursive]/3)
--_Mtx_storage_mirror._Count;
return false;
}

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

@ -94,7 +94,7 @@ _EXPORT_STD inline constexpr destroying_delete_t destroying_delete{};
_EXPORT_STD template <class _Ty>
_NODISCARD_LAUNDER constexpr _Ty* launder(_Ty* _Ptr) noexcept {
static_assert(!is_function_v<_Ty> && !is_void_v<_Ty>,
"N4727 21.6.4 [ptr.launder]/3: The program is ill-formed if T is a function type or cv void.");
"N4950 [ptr.launder]/1: Mandates: !is_function_v<T> && !is_void_v<T> is true.");
return __builtin_launder(_Ptr);
}

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

@ -30,7 +30,7 @@ namespace numbers {
template <class _Ty>
struct _Invalid {
static_assert(_Always_false<_Ty>, "A program that instantiates a primary template of a mathematical constant "
"variable template is ill-formed. (N4944 [math.constants]/3)");
"variable template is ill-formed. (N4950 [math.constants]/3)");
};
_EXPORT_STD template <class _Ty>
@ -90,7 +90,7 @@ namespace numbers {
template <class _Ty>
struct _Reject_invalid {
static_assert(is_floating_point_v<_Ty>, "A program that instantiates a primary template of a mathematical "
"constant variable template is ill-formed. (N4944 [math.constants]/3)");
"constant variable template is ill-formed. (N4950 [math.constants]/3)");
using type = _Ty;
};

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

@ -83,7 +83,7 @@ _NODISCARD _CONSTEXPR20 _Ty reduce(const _InIt _First, const _InIt _Last, _Ty _V
}
for (; _UFirst != _ULast; ++_UFirst) {
_Val = _Reduce_op(_STD move(_Val), *_UFirst); // Requirement missing from N4713
_Val = _Reduce_op(_STD move(_Val), *_UFirst); // Requirement missing from N4950
}
return _Val;
@ -133,9 +133,9 @@ _NODISCARD _CONSTEXPR20 _Ty inner_product(
auto _UFirst2 = _Get_unwrapped_n(_First2, _Idl_distance<_InIt1>(_UFirst1, _ULast1));
for (; _UFirst1 != _ULast1; ++_UFirst1, (void) ++_UFirst2) {
#if _HAS_CXX20
_Val = _Reduce_op(_STD move(_Val), _Transform_op(*_UFirst1, *_UFirst2)); // Requirement missing from N4713
_Val = _Reduce_op(_STD move(_Val), _Transform_op(*_UFirst1, *_UFirst2)); // Requirement missing from N4950
#else // ^^^ _HAS_CXX20 / !_HAS_CXX20 vvv
_Val = _Reduce_op(_Val, _Transform_op(*_UFirst1, *_UFirst2)); // Requirement missing from N4713
_Val = _Reduce_op(_Val, _Transform_op(*_UFirst1, *_UFirst2)); // Requirement missing from N4950
#endif // _HAS_CXX20
}
@ -193,7 +193,7 @@ _NODISCARD _CONSTEXPR20 _Ty transform_reduce(
}
for (; _UFirst1 != _ULast1; ++_UFirst1, (void) ++_UFirst2) {
_Val = _Reduce_op(_STD move(_Val), _Transform_op(*_UFirst1, *_UFirst2)); // Requirement missing from N4713
_Val = _Reduce_op(_STD move(_Val), _Transform_op(*_UFirst1, *_UFirst2)); // Requirement missing from N4950
}
return _Val;
}
@ -213,7 +213,7 @@ _NODISCARD _CONSTEXPR20 _Ty transform_reduce(
auto _UFirst = _Get_unwrapped(_First);
const auto _ULast = _Get_unwrapped(_Last);
for (; _UFirst != _ULast; ++_UFirst) {
_Val = _Reduce_op(_STD move(_Val), _Transform_op(*_UFirst)); // Requirement missing from N4713
_Val = _Reduce_op(_STD move(_Val), _Transform_op(*_UFirst)); // Requirement missing from N4950
}
return _Val;
@ -293,7 +293,7 @@ _CONSTEXPR20 _OutIt exclusive_scan(const _InIt _First, const _InIt _Last, _OutIt
break;
}
_Val = _STD move(_Tmp); // Requirement missing from N4713
_Val = _STD move(_Tmp); // Requirement missing from N4950
}
}
@ -327,7 +327,7 @@ _CONSTEXPR20 _OutIt inclusive_scan(const _InIt _First, const _InIt _Last, _OutIt
const auto _ULast = _Get_unwrapped(_Last);
auto _UDest = _Get_unwrapped_n(_Dest, _Idl_distance<_InIt>(_UFirst, _ULast));
for (; _UFirst != _ULast; ++_UFirst) {
_Val = _Reduce_op(_STD move(_Val), *_UFirst); // Requirement missing from N4713
_Val = _Reduce_op(_STD move(_Val), *_UFirst); // Requirement missing from N4950
*_UDest = _Val;
++_UDest;
}
@ -344,7 +344,7 @@ _CONSTEXPR20 _OutIt inclusive_scan(const _InIt _First, const _InIt _Last, _OutIt
const auto _ULast = _Get_unwrapped(_Last);
auto _UDest = _Get_unwrapped_n(_Dest, _Idl_distance<_InIt>(_UFirst, _ULast));
if (_UFirst != _ULast) {
_Iter_value_t<_InIt> _Val = *_UFirst; // Requirement missing from N4713
_Iter_value_t<_InIt> _Val = *_UFirst; // Requirement missing from N4950
for (;;) {
*_UDest = _Val;
++_UDest;
@ -353,7 +353,7 @@ _CONSTEXPR20 _OutIt inclusive_scan(const _InIt _First, const _InIt _Last, _OutIt
break;
}
_Val = _Reduce_op(_STD move(_Val), *_UFirst); // Requirement missing from N4713
_Val = _Reduce_op(_STD move(_Val), *_UFirst); // Requirement missing from N4950
}
}
@ -401,7 +401,7 @@ _CONSTEXPR20 _OutIt transform_exclusive_scan(
break;
}
_Val = _STD move(_Tmp); // Requirement missing from N4713
_Val = _STD move(_Tmp); // Requirement missing from N4950
}
}
@ -423,7 +423,7 @@ _CONSTEXPR20 _OutIt transform_inclusive_scan(
const auto _ULast = _Get_unwrapped(_Last);
auto _UDest = _Get_unwrapped_n(_Dest, _Idl_distance<_InIt>(_UFirst, _ULast));
for (; _UFirst != _ULast; ++_UFirst) {
_Val = _Reduce_op(_STD move(_Val), _Transform_op(*_UFirst)); // Requirement missing from N4713
_Val = _Reduce_op(_STD move(_Val), _Transform_op(*_UFirst)); // Requirement missing from N4950
*_UDest = _Val;
++_UDest;
}
@ -441,7 +441,7 @@ _CONSTEXPR20 _OutIt transform_inclusive_scan(
const auto _ULast = _Get_unwrapped(_Last);
auto _UDest = _Get_unwrapped_n(_Dest, _Idl_distance<_InIt>(_UFirst, _ULast));
if (_UFirst != _ULast) {
auto _Val = _Transform_op(*_UFirst); // Requirement missing from N4713, also type to use unclear
auto _Val = _Transform_op(*_UFirst); // Requirement missing from N4950, also type to use unclear
for (;;) {
*_UDest = _Val;
++_UDest;
@ -450,7 +450,7 @@ _CONSTEXPR20 _OutIt transform_inclusive_scan(
break;
}
_Val = _Reduce_op(_STD move(_Val), _Transform_op(*_UFirst)); // Requirement missing from N4713
_Val = _Reduce_op(_STD move(_Val), _Transform_op(*_UFirst)); // Requirement missing from N4950
}
}

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

@ -217,9 +217,9 @@ private:
public:
static_assert(!_Is_any_of_v<remove_cv_t<_Ty>, nullopt_t, in_place_t>,
"T in optional<T> must be a type other than nullopt_t or in_place_t (N4828 [optional.optional]/3).");
"T in optional<T> must be a type other than nullopt_t or in_place_t (N4950 [optional.optional.general]/3).");
static_assert(is_object_v<_Ty> && is_destructible_v<_Ty> && !is_array_v<_Ty>,
"T in optional<T> must meet the Cpp17Destructible requirements (N4828 [optional.optional]/3).");
"T in optional<T> must meet the Cpp17Destructible requirements (N4950 [optional.optional.general]/3).");
using value_type = _Ty;
@ -348,9 +348,9 @@ public:
_CONSTEXPR20 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).");
"optional<T>::swap requires T to be move constructible (N4950 [optional.swap]/1).");
static_assert(!is_move_constructible_v<_Ty> || is_swappable_v<_Ty>,
"optional<T>::swap requires T to be swappable (N4828 [optional.swap]/1).");
"optional<T>::swap requires T to be swappable (N4950 [optional.swap]/2).");
if constexpr (_Is_trivially_swappable_v<_Ty>) {
using _TrivialBaseTy = _Optional_destruct_base<_Ty>;
_STD swap(static_cast<_TrivialBaseTy&>(*this), static_cast<_TrivialBaseTy&>(_Right));
@ -424,9 +424,9 @@ public:
_NODISCARD constexpr remove_cv_t<_Ty> value_or(_Ty2&& _Right) const& {
static_assert(is_convertible_v<const _Ty&, remove_cv_t<_Ty>>,
"The const overload of optional<T>::value_or requires const T& to be convertible to remove_cv_t<T> "
"(N4885 [optional.observe]/17 as modified by LWG-3424).");
"(N4950 [optional.observe]/15 as modified by LWG-3424).");
static_assert(is_convertible_v<_Ty2, _Ty>,
"optional<T>::value_or(U) requires U to be convertible to T (N4828 [optional.observe]/18).");
"optional<T>::value_or(U) requires U to be convertible to T (N4950 [optional.observe]/15).");
if (this->_Has_value) {
return static_cast<const _Ty&>(this->_Value);
@ -438,9 +438,9 @@ public:
_NODISCARD constexpr remove_cv_t<_Ty> value_or(_Ty2&& _Right) && {
static_assert(is_convertible_v<_Ty, remove_cv_t<_Ty>>,
"The rvalue overload of optional<T>::value_or requires T to be convertible to remove_cv_t<T> "
"(N4885 [optional.observe]/19 as modified by LWG-3424).");
"(N4950 [optional.observe]/17 as modified by LWG-3424).");
static_assert(is_convertible_v<_Ty2, _Ty>,
"optional<T>::value_or(U) requires U to be convertible to T (N4828 [optional.observe]/20).");
"optional<T>::value_or(U) requires U to be convertible to T (N4950 [optional.observe]/17).");
if (this->_Has_value) {
return static_cast<_Ty&&>(this->_Value);
@ -456,7 +456,7 @@ public:
static_assert(_Is_specialization_v<remove_cvref_t<_Uty>, optional>,
"optional<T>::and_then(F) requires the return type of F to be a specialization of optional "
"(N4901 [optional.monadic]/2).");
"(N4950 [optional.monadic]/2).");
if (this->_Has_value) {
return _STD invoke(_STD forward<_Fn>(_Func), static_cast<_Ty&>(this->_Value));
@ -471,7 +471,7 @@ public:
static_assert(_Is_specialization_v<remove_cvref_t<_Uty>, optional>,
"optional<T>::and_then(F) requires the return type of F to be a specialization of optional "
"(N4901 [optional.monadic]/2).");
"(N4950 [optional.monadic]/2).");
if (this->_Has_value) {
return _STD invoke(_STD forward<_Fn>(_Func), static_cast<const _Ty&>(this->_Value));
@ -486,7 +486,7 @@ public:
static_assert(_Is_specialization_v<remove_cvref_t<_Uty>, optional>,
"optional<T>::and_then(F) requires the return type of F to be a specialization of optional "
"(N4901 [optional.monadic]/5).");
"(N4950 [optional.monadic]/5).");
if (this->_Has_value) {
return _STD invoke(_STD forward<_Fn>(_Func), static_cast<_Ty&&>(this->_Value));
@ -501,7 +501,7 @@ public:
static_assert(_Is_specialization_v<remove_cvref_t<_Uty>, optional>,
"optional<T>::and_then(F) requires the return type of F to be a specialization of optional "
"(N4901 [optional.monadic]/5).");
"(N4950 [optional.monadic]/5).");
if (this->_Has_value) {
return _STD invoke(_STD forward<_Fn>(_Func), static_cast<const _Ty&&>(this->_Value));
@ -516,10 +516,10 @@ public:
static_assert(!_Is_any_of_v<_Uty, nullopt_t, in_place_t>,
"optional<T>::transform(F) requires the return type of F to be a type other than nullopt_t or in_place_t "
"(N4901 [optional.monadic]/8).");
"(N4950 [optional.monadic]/8).");
static_assert(is_object_v<_Uty> && !is_array_v<_Uty>,
"optional<T>::transform(F) requires the return type of F to be a non-array object type "
"(N4901 [optional.monadic]/8).");
"(N4950 [optional.monadic]/8).");
if (this->_Has_value) {
return optional<_Uty>{
@ -535,10 +535,10 @@ public:
static_assert(!_Is_any_of_v<_Uty, nullopt_t, in_place_t>,
"optional<T>::transform(F) requires the return type of F to be a type other than nullopt_t or in_place_t "
"(N4901 [optional.monadic]/8).");
"(N4950 [optional.monadic]/8).");
static_assert(is_object_v<_Uty> && !is_array_v<_Uty>,
"optional<T>::transform(F) requires the return type of F to be a non-array object type "
"(N4901 [optional.monadic]/8).");
"(N4950 [optional.monadic]/8).");
if (this->_Has_value) {
return optional<_Uty>{
@ -554,10 +554,10 @@ public:
static_assert(!_Is_any_of_v<_Uty, nullopt_t, in_place_t>,
"optional<T>::transform(F) requires the return type of F to be a type other than nullopt_t or in_place_t "
"(N4901 [optional.monadic]/11).");
"(N4950 [optional.monadic]/11).");
static_assert(is_object_v<_Uty> && !is_array_v<_Uty>,
"optional<T>::transform(F) requires the return type of F to be a non-array object type "
"(N4901 [optional.monadic]/11).");
"(N4950 [optional.monadic]/11).");
if (this->_Has_value) {
return optional<_Uty>{
@ -573,10 +573,10 @@ public:
static_assert(!_Is_any_of_v<_Uty, nullopt_t, in_place_t>,
"optional<T>::transform(F) requires the return type of F to be a type other than nullopt_t or in_place_t "
"(N4901 [optional.monadic]/11).");
"(N4950 [optional.monadic]/11).");
static_assert(is_object_v<_Uty> && !is_array_v<_Uty>,
"optional<T>::transform(F) requires the return type of F to be a non-array object type "
"(N4901 [optional.monadic]/11).");
"(N4950 [optional.monadic]/11).");
if (this->_Has_value) {
return optional<_Uty>{
@ -591,7 +591,7 @@ public:
requires copy_constructible<_Ty>
constexpr optional or_else(_Fn&& _Func) const& {
static_assert(is_same_v<remove_cvref_t<invoke_result_t<_Fn>>, optional>,
"optional<T>::or_else(F) requires F to return an optional<T> (N4901 [optional.monadic]/14).");
"optional<T>::or_else(F) requires F to return an optional<T> (N4950 [optional.monadic]/14).");
if (this->_Has_value) {
return *this;
@ -604,7 +604,7 @@ public:
requires move_constructible<_Ty>
constexpr optional or_else(_Fn&& _Func) && {
static_assert(is_same_v<remove_cvref_t<invoke_result_t<_Fn>>, optional>,
"optional<T>::or_else(F) requires F to return an optional<T> (N4901 [optional.monadic]/17).");
"optional<T>::or_else(F) requires F to return an optional<T> (N4950 [optional.monadic]/17).");
if (this->_Has_value) {
return _STD move(*this);

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

@ -1114,7 +1114,7 @@ void _Vprint_nonunicode_impl(
_State |= ios_base::badbit;
} else [[likely]] {
// This is intentionally kept outside of the try/catch block in _Print_noformat_nonunicode()
// (see N4928 [ostream.formatted.print]/3.2).
// (see N4950 [ostream.formatted.print]/3.2).
string _Output_str = _STD vformat(_Ostr.getloc(), _Fmt_str, _Fmt_args);
if (_Add_nl == _Add_newline::_Yes) {
_Output_str.push_back('\n');
@ -1206,7 +1206,7 @@ void _Vprint_unicode_impl(
_State |= ios_base::badbit;
} else [[likely]] {
// This is intentionally kept outside of the try/catch block in _Print_noformat_unicode()
// (see N4928 [ostream.formatted.print]/3.2).
// (see N4950 [ostream.formatted.print]/3.2).
string _Output_str = _STD vformat(_Ostr.getloc(), _Fmt_str, _Fmt_args);
if (_Add_nl == _Add_newline::_Yes) {
_Output_str.push_back('\n');
@ -1241,7 +1241,7 @@ void _Print_impl(const _Add_newline _Add_nl, ostream& _Ostr, const format_string
constexpr bool _Has_format_args = sizeof...(_Types) > 0;
// This is intentionally kept outside of the try/catch block in _Print_noformat_*()
// (see N4928 [ostream.formatted.print]/3.2).
// (see N4950 [ostream.formatted.print]/3.2).
if constexpr (_Has_format_args) {
if constexpr (_STD _Is_ordinary_literal_encoding_utf8()) {

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

@ -36,22 +36,23 @@ _STD_BEGIN
static_assert(!_Is_character<_CheckedType>::value, \
"note: char, signed char, unsigned char, char8_t, int8_t, and uint8_t are not allowed")
#define _RNG_REQUIRE_REALTYPE(_RandType, _CheckedType) \
static_assert(_Is_any_of_v<_CheckedType, float, double, long double>, \
"invalid template argument for " #_RandType ": N4659 29.6.1.1 [rand.req.genl]/1d requires one of " \
"float, double, or long double")
#define _RNG_REQUIRE_REALTYPE(_RandType, _CheckedType) \
static_assert(_Is_any_of_v<_CheckedType, float, double, long double>, \
"invalid template argument for " #_RandType \
": N4950 [rand.req.genl]/1.4 requires one of float, double, or long double")
#define _RNG_REQUIRE_INTTYPE(_RandType, _CheckedType) \
static_assert(_Is_any_of_v<_CheckedType, short, int, long, long long, unsigned short, unsigned int, unsigned long, \
unsigned long long>, \
"invalid template argument for " #_RandType ": N4659 29.6.1.1 [rand.req.genl]/1e requires one of " \
"short, int, long, long long, unsigned short, unsigned int, unsigned long, or unsigned long long"); \
"invalid template argument for " #_RandType \
": N4950 [rand.req.genl]/1.5 requires one of short, int, long, long long, unsigned short, unsigned int, " \
"unsigned long, or unsigned long long"); \
_RNG_PROHIBIT_CHAR(_CheckedType)
#define _RNG_REQUIRE_UINTTYPE(_RandType, _CheckedType) \
static_assert(_Is_any_of_v<_CheckedType, unsigned short, unsigned int, unsigned long, unsigned long long>, \
"invalid template argument for " #_RandType ": N4659 29.6.1.1 [rand.req.genl]/1f requires one of " \
"unsigned short, unsigned int, unsigned long, or unsigned long long"); \
#define _RNG_REQUIRE_UINTTYPE(_RandType, _CheckedType) \
static_assert(_Is_any_of_v<_CheckedType, unsigned short, unsigned int, unsigned long, unsigned long long>, \
"invalid template argument for " #_RandType ": N4950 [rand.req.genl]/1.6 requires one of unsigned short, " \
"unsigned int, unsigned long, or unsigned long long"); \
_RNG_PROHIBIT_CHAR(_CheckedType)
template <class _Seed_seq, class _Self, class _Engine = _Self>
@ -295,7 +296,7 @@ _NODISCARD _Real generate_canonical(_Gen& _Gx) { // build a floating-point value
template <class _Gen, class = void>
struct _Has_static_min_max : false_type {};
// This checks a requirement of N4901 [rand.req.urng] `concept uniform_random_bit_generator` but doesn't attempt
// This checks a requirement of N4950 [rand.req.urng] `concept uniform_random_bit_generator` but doesn't attempt
// to implement the whole concept - we just need to distinguish Standard machinery from tr1 machinery.
template <class _Gen>
struct _Has_static_min_max<_Gen, void_t<decltype(bool_constant<(_Gen::min)() < (_Gen::max)()>::value)>> : true_type {};
@ -352,9 +353,9 @@ _NODISCARD _Uint _Next_linear_congruential_value(_Uint _Prev) noexcept {
// _Cx <= numeric_limits<T>::max()
// && (_Mx - 1) <= (numeric_limits<T>::max() - _Cx) / _Ax
if constexpr (_Ax == 0) { // degenerate case; avoid divide by 0
return static_cast<_Uint>(_Cx); // relies on _Mx == 0 || _Cx <= _Mx, N4741 [rand.eng.lcong]/3
return static_cast<_Uint>(_Cx); // relies on _Mx == 0 || _Cx <= _Mx, N4950 [rand.eng.lcong]/3
} else if constexpr (_Mx == 0) {
// N4762 [rand.eng.lcong]/2: "If the template parameter m is 0, the modulus m
// N4950 [rand.eng.lcong]/2: "If the template parameter m is 0, the modulus m
// used throughout this subclause [rand.eng.lcong] is
// numeric_limits<result_type>::max() plus 1." That is: Just do the multiply
// and let normal unsigned modulo take care of it
@ -395,7 +396,7 @@ _NODISCARD constexpr unsigned long long _Seed_seq_to_ull(_Seed_seq& _Seq) {
}
template <class _Uint, _Uint _Cx, _Uint _Mx>
_NODISCARD constexpr _Uint _Get_linear_congruential_seed(_Uint _Sx) noexcept { // N4741 [rand.eng.lcong]/5
_NODISCARD constexpr _Uint _Get_linear_congruential_seed(_Uint _Sx) noexcept { // N4950 [rand.eng.lcong]/5
if constexpr (_Mx != 0) {
_Sx %= _Mx;
}
@ -410,7 +411,7 @@ _NODISCARD constexpr _Uint _Get_linear_congruential_seed(_Uint _Sx) noexcept { /
}
template <class _Uint, _Uint _Cx, _Uint _Mx, class _Seed_seq>
_NODISCARD _Uint _Get_linear_congruential_seed_from_seq(_Seed_seq& _Seq) { // N4741 [rand.eng.lcong]/6
_NODISCARD _Uint _Get_linear_congruential_seed_from_seq(_Seed_seq& _Seq) { // N4950 [rand.eng.lcong]/6
_Uint _Sx;
if constexpr (_Mx == 0) {
if constexpr (sizeof(_Uint) <= sizeof(unsigned int)) {

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

@ -1339,7 +1339,7 @@ namespace ranges {
is_nothrow_move_constructible_v<_Wi>&& is_nothrow_move_constructible_v<_Bo>) // strengthened
: _Value(_STD move(_Value_)), _Bound(_STD move(_Bound_)) {
if constexpr (totally_ordered_with<_Wi, _Bo>) {
_STL_ASSERT(_Value_ <= _Bound_, "Per N4928 [range.iota.view]/8, the first argument must precede the "
_STL_ASSERT(_Value_ <= _Bound_, "Per N4950 [range.iota.view]/8, the first argument must precede the "
"second when their types are totally ordered.");
}
}
@ -2290,7 +2290,7 @@ namespace ranges {
_NODISCARD constexpr _Iterator begin() {
#if _CONTAINER_DEBUG_LEVEL > 0
_STL_VERIFY(
_Pred, "N4928 [range.filter.view]/3 forbids calling begin on a filter_view that holds no predicate");
_Pred, "N4950 [range.filter.view]/3 forbids calling begin on a filter_view that holds no predicate");
#endif // _CONTAINER_DEBUG_LEVEL > 0
if constexpr (forward_range<_Vw>) {
if (this->_Has_cache()) {
@ -3291,7 +3291,7 @@ namespace ranges {
is_nothrow_move_constructible_v<_Vw>) // strengthened
: _Range(_STD move(_Range_)), _Count{_Count_} {
#if _CONTAINER_DEBUG_LEVEL > 0
_STL_VERIFY(_Count_ >= 0, "Number of elements to drop must be non-negative (N4928 [range.drop.view]/1");
_STL_VERIFY(_Count_ >= 0, "Number of elements to drop must be non-negative (N4950 [range.drop.view]/1");
#endif // _CONTAINER_DEBUG_LEVEL > 0
}
@ -3515,7 +3515,7 @@ namespace ranges {
_NODISCARD constexpr auto begin() {
#if _CONTAINER_DEBUG_LEVEL > 0
_STL_VERIFY(
_Pred, "N4928 [range.drop.while.view]/3 forbids calling begin on a drop_while_view with no predicate");
_Pred, "N4950 [range.drop.while.view]/3 forbids calling begin on a drop_while_view with no predicate");
#endif // _CONTAINER_DEBUG_LEVEL > 0
if constexpr (forward_range<_Vw>) {
if (this->_Has_cache()) {
@ -7212,7 +7212,7 @@ namespace ranges {
is_nothrow_move_constructible_v<_Vw>) /* strengthened */
: _Range(_STD move(_Range_)), _Count{_Count_} {
#if _CONTAINER_DEBUG_LEVEL > 0
_STL_VERIFY(_Count > 0, "The window size must be positive (N4928 [range.slide.view]/1)");
_STL_VERIFY(_Count > 0, "The window size must be positive (N4950 [range.slide.view]/1)");
#endif // _CONTAINER_DEBUG_LEVEL > 0
}
@ -8770,7 +8770,7 @@ namespace ranges {
static constexpr bool _Enable_cpo = []() noexcept {
if constexpr (sizeof...(_Types) == 0) {
// This is a more efficient implementation of the CPO requirements listed in
// N4928 [range.zip.transform.overview]/2.1.1.
// N4950 [range.zip.transform.overview]/2.1.1.
using _Decayed_func = decay_t<_Func>;
if constexpr (move_constructible<_Decayed_func> && regular_invocable<_Decayed_func&>) {
return !is_void_v<invoke_result_t<_Decayed_func&>>;
@ -9767,13 +9767,13 @@ namespace ranges {
#if _ITERATOR_DEBUG_LEVEL != 0
const auto _It_off = static_cast<_Diff>(_It - _RANGES begin(_Range));
_STL_VERIFY(_It_off + _Off >= 0, "Cannot advance cartesian_product_view iterator before begin "
"(N4928 [range.cartesian.iterator]/19).");
"(N4950 [range.cartesian.iterator]/19).");
if constexpr (sized_range<decltype(_Range)>) {
const auto _Size = static_cast<_Diff>(_RANGES ssize(_Range));
_STL_VERIFY(_It_off + _Off < _Size
|| (_It_off + _Off == _Size
&& _Entire_tail_at_begin(make_index_sequence<sizeof...(_Rest)>{})),
"Cannot advance cartesian_product_view iterator past end (N4928 "
"Cannot advance cartesian_product_view iterator past end (N4950 "
"[range.cartesian.iterator]/19).");
}
#endif // _ITERATOR_DEBUG_LEVEL != 0
@ -9805,7 +9805,7 @@ namespace ranges {
_Mul_overflow(_Size, _Distance_from<_Index - 1>(_Tpl), _Result)
|| _Add_overflow(_Result, _Diff, _Result);
#if _ITERATOR_DEBUG_LEVEL != 0
_STL_VERIFY(!_Overflow, "Scaled-sum cannot be represented by difference_type (N4928 "
_STL_VERIFY(!_Overflow, "Scaled-sum cannot be represented by difference_type (N4950 "
"[range.cartesian.iterator]/8).");
#endif // _ITERATOR_DEBUG_LEVEL != 0
return _Result;
@ -10063,7 +10063,7 @@ namespace ranges {
(_Mul_overflow(
_Product, static_cast<_Size_type<false>>(_RANGES size(_STD get<_Indices>(_Bases))), _Product)
|| ...);
_STL_VERIFY(!_Overflow, "Size of cartesian product cannot be represented by size type (N4928 "
_STL_VERIFY(!_Overflow, "Size of cartesian product cannot be represented by size type (N4950 "
"[range.cartesian.view]/10).");
return _Product;
#else // ^^^ _CONTAINER_DEBUG_LEVEL > 0 / _CONTAINER_DEBUG_LEVEL == 0 vvv
@ -10083,7 +10083,7 @@ namespace ranges {
(_Mul_overflow(
_Product, static_cast<_Size_type<true>>(_RANGES size(_STD get<_Indices>(_Bases))), _Product)
|| ...);
_STL_VERIFY(!_Overflow, "Size of cartesian product cannot be represented by size type (N4928 "
_STL_VERIFY(!_Overflow, "Size of cartesian product cannot be represented by size type (N4950 "
"[range.cartesian.view]/10).");
return _Product;
#else // ^^^ _CONTAINER_DEBUG_LEVEL > 0 / _CONTAINER_DEBUG_LEVEL == 0 vvv
@ -10195,7 +10195,7 @@ namespace ranges {
};
return _RANGES to<_Container>(views::transform(_Range, _Xform), _STD forward<_Types>(_Args)...);
} else {
static_assert(_Always_false<_Container>, "the program is ill-formed per N4910 [range.utility.conv.to]/1.3");
static_assert(_Always_false<_Container>, "the program is ill-formed per N4950 [range.utility.conv.to]/2.3");
}
}

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

@ -65,7 +65,7 @@ public:
constexpr explicit counting_semaphore(const ptrdiff_t _Desired) noexcept /* strengthened */
: _Counter(_Desired) {
_STL_VERIFY(_Desired >= 0 && _Desired <= _Least_max_value,
"Precondition: desired >= 0, and desired <= max() (N4861 [thread.sema.cnt]/5)");
"Precondition: desired >= 0, and desired <= max() (N4950 [thread.sema.cnt]/5)");
}
counting_semaphore(const counting_semaphore&) = delete;
@ -76,7 +76,7 @@ public:
return;
}
_STL_VERIFY(_Update > 0 && _Update <= _Least_max_value,
"Precondition: update >= 0, and update <= max() - counter (N4861 [thread.sema.cnt]/8)");
"Precondition: update >= 0, and update <= max() - counter (N4950 [thread.sema.cnt]/8)");
// We need to notify (wake) at least _Update waiting threads.
// Errors towards waking more cannot be always avoided, but they are performance issues.
@ -92,7 +92,7 @@ public:
const ptrdiff_t _Prev = _Counter.fetch_add(static_cast<ptrdiff_t>(_Update));
_STL_VERIFY(_Prev + _Update > 0 && _Prev + _Update <= _Least_max_value,
"Precondition: update <= max() - counter (N4861 [thread.sema.cnt]/8)");
"Precondition: update <= max() - counter (N4950 [thread.sema.cnt]/8)");
const ptrdiff_t _Waiting_upper_bound = _Waiting.load();
@ -130,7 +130,7 @@ public:
}
_STL_VERIFY(_Current > 0 && _Current <= _Least_max_value,
"Invariant: counter >= 0, and counter <= max() "
"possibly caused by preconditions violation (N4861 [thread.sema.cnt]/8)");
"possibly caused by preconditions violation (N4950 [thread.sema.cnt]/8)");
// "happens after release" ordering is provided by this CAS, so loads and waits can be relaxed
if (_Counter.compare_exchange_weak(_Current, _Current - 1)) {
@ -146,7 +146,7 @@ public:
}
_STL_VERIFY(_Current > 0 && _Current <= _Least_max_value,
"Invariant: counter >= 0, and counter <= max() "
"possibly caused by preconditions violation (N4861 [thread.sema.cnt]/8)");
"possibly caused by preconditions violation (N4950 [thread.sema.cnt]/8)");
return _Counter.compare_exchange_weak(_Current, _Current - 1);
}
@ -166,7 +166,7 @@ public:
}
_STL_VERIFY(_Current > 0 && _Current <= _Least_max_value,
"Invariant: counter >= 0, and counter <= max() "
"possibly caused by preconditions violation (N4861 [thread.sema.cnt]/8)");
"possibly caused by preconditions violation (N4950 [thread.sema.cnt]/8)");
// "happens after release" ordering is provided by this CAS, so loads and waits can be relaxed
if (_Counter.compare_exchange_weak(_Current, _Current - 1)) {
@ -190,7 +190,7 @@ public:
}
_STL_VERIFY(_Current > 0 && _Current <= _Least_max_value,
"Invariant: counter >= 0, and counter <= max() "
"possibly caused by preconditions violation (N4861 [thread.sema.cnt]/8)");
"possibly caused by preconditions violation (N4950 [thread.sema.cnt]/8)");
// "happens after release" ordering is provided by this CAS, so loads and waits can be relaxed
if (_Counter.compare_exchange_weak(_Current, _Current - 1)) {
@ -214,7 +214,7 @@ public:
constexpr explicit counting_semaphore(const ptrdiff_t _Desired) noexcept /* strengthened */
: _Counter(static_cast<unsigned char>(_Desired)) {
_STL_VERIFY((_Desired & ~1) == 0, "Precondition: desired >= 0, and desired <= max() "
"(N4861 [thread.sema.cnt]/5)");
"(N4950 [thread.sema.cnt]/5)");
}
counting_semaphore(const counting_semaphore&) = delete;
@ -225,7 +225,7 @@ public:
return;
}
_STL_VERIFY(_Update == 1, "Precondition: update >= 0, "
"and update <= max() - counter (N4861 [thread.sema.cnt]/8)");
"and update <= max() - counter (N4950 [thread.sema.cnt]/8)");
// TRANSITION, GH-1133: should be memory_order_release
_Counter.store(1);
_Counter.notify_one();

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

@ -44,7 +44,7 @@ public:
using off_type = typename _Traits::off_type;
using traits_type = _Traits;
// N4928 [spanbuf.cons], constructors
// N4950 [spanbuf.cons], constructors
basic_spanbuf() = default;
explicit basic_spanbuf(ios_base::openmode _Which) : _Mysb(), _Mode(_Which) {}
@ -61,7 +61,7 @@ public:
_Right.setg(nullptr, nullptr, nullptr);
}
// N4928 [spanbuf.assign], assignment and swap
// N4950 [spanbuf.assign], assignment and swap
basic_spanbuf& operator=(const basic_spanbuf&) = delete;
basic_spanbuf& operator=(basic_spanbuf&& _Right) noexcept /* strengthened */ {
@ -80,7 +80,7 @@ public:
_STD swap(_Buf, _Right._Buf);
}
// N4928 [spanbuf.members], member functions
// N4950 [spanbuf.members], member functions
_NODISCARD _STD span<_Elem> span() const noexcept {
if (_Mode & ios_base::out) {
return _STD span<_Elem>{_Mysb::pbase(), _Mysb::pptr()};
@ -107,22 +107,22 @@ public:
}
protected:
// N4928 [spanbuf.virtuals], overridden virtual functions
// N4950 [spanbuf.virtuals], overridden virtual functions
pos_type seekoff(
off_type _Off, ios_base::seekdir _Way, ios_base::openmode _Which = ios_base::in | ios_base::out) override {
const bool _Sequence_in = _Which & ios_base::in;
const bool _Sequence_out = _Which & ios_base::out;
switch (_Way) {
case ios_base::beg:
// N4928 [spanbuf.virtuals]/4.1 baseoff = 0
// N4950 [spanbuf.virtuals]/4.1 baseoff = 0
if (static_cast<size_t>(_Off) > _Buf.size()) { // negative wraparound to positive to save a compare
return pos_type{off_type{-1}}; // N4928 [spanbuf.virtuals]/5 report failure
return pos_type{off_type{-1}}; // N4950 [spanbuf.virtuals]/5 report failure
}
break;
case ios_base::end:
{
// N4928 [spanbuf.virtuals]/4.3 baseoff =
// N4950 [spanbuf.virtuals]/4.3 baseoff =
const auto _Baseoff = (_Mode & ios_base::out) && !(_Mode & ios_base::in)
? static_cast<off_type>(_Mysb::pptr() - _Mysb::pbase())
: static_cast<off_type>(_Buf.size());
@ -132,7 +132,7 @@ protected:
_Off += _Baseoff;
if (static_cast<size_t>(_Off) > _Buf.size()) { // negative wraparound to positive to save a compare
return pos_type{off_type{-1}}; // N4928 [spanbuf.virtuals]/5 report failure
return pos_type{off_type{-1}}; // N4950 [spanbuf.virtuals]/5 report failure
}
break;
@ -157,7 +157,7 @@ protected:
return pos_type{off_type{-1}}; // report failure
}
// N4928 [spanbuf.virtuals]/4: For a sequence to be positioned, if its next pointer is a null pointer and newoff
// N4950 [spanbuf.virtuals]/4: For a sequence to be positioned, if its next pointer is a null pointer and newoff
// is not equal to 0, the positioning operation fails.
if (_Off != 0 && ((_Sequence_in && !_Mysb::gptr()) || (_Sequence_out && !_Mysb::pptr()))) {
return pos_type{off_type{-1}}; // report failure
@ -206,7 +206,7 @@ public:
using off_type = typename _Traits::off_type;
using traits_type = _Traits;
// N4928 [ispanstream.cons], constructors
// N4950 [ispanstream.cons], constructors
explicit basic_ispanstream(_STD span<_Elem> _Span, ios_base::openmode _Which = ios_base::in)
: _Mybase(_STD addressof(_Buf)), _Buf(_Span, _Which | ios_base::in) {}
@ -235,13 +235,13 @@ public:
return *this;
}
// N4928 [ispanstream.swap], swap
// N4950 [ispanstream.swap], swap
void swap(basic_ispanstream& _Right) noexcept /* strengthened */ {
_Mybase::swap(_Right);
_Buf.swap(_Right._Buf);
}
// N4928 [ispanstream.members], member functions
// N4950 [ispanstream.members], member functions
_NODISCARD _Mysb* rdbuf() const noexcept {
return const_cast<_Mysb*>(_STD addressof(_Buf));
}
@ -289,7 +289,7 @@ public:
using off_type = typename _Traits::off_type;
using traits_type = _Traits;
// N4928 [ospanstream.cons], constructors
// N4950 [ospanstream.cons], constructors
explicit basic_ospanstream(_STD span<_Elem> _Span, ios_base::openmode _Which = ios_base::out)
: _Mybase(_STD addressof(_Buf)), _Buf(_Span, _Which | ios_base::out) {}
@ -307,13 +307,13 @@ public:
return *this;
}
// N4928 [ospanstream.swap], swap
// N4950 [ospanstream.swap], swap
void swap(basic_ospanstream& _Right) noexcept /* strengthened */ {
_Mybase::swap(_Right);
_Buf.swap(_Right._Buf);
}
// N4928 [ospanstream.members], member functions
// N4950 [ospanstream.members], member functions
_NODISCARD _Mysb* rdbuf() const noexcept {
return const_cast<_Mysb*>(_STD addressof(_Buf));
}
@ -349,7 +349,7 @@ public:
using off_type = typename _Traits::off_type;
using traits_type = _Traits;
// N4928 [spanstream.cons], constructors
// N4950 [spanstream.cons], constructors
explicit basic_spanstream(_STD span<_Elem> _Span, ios_base::openmode _Which = ios_base::out | ios_base::in)
: _Mybase(_STD addressof(_Buf)), _Buf(_Span, _Which) {}
@ -367,13 +367,13 @@ public:
return *this;
}
// N4928 [spanstream.swap], swap
// N4950 [spanstream.swap], swap
void swap(basic_spanstream& _Right) noexcept /* strengthened */ {
_Mybase::swap(_Right);
_Buf.swap(_Right._Buf);
}
// N4928 [spanstream.members], member functions
// N4950 [spanstream.members], member functions
_NODISCARD _Mysb* rdbuf() const noexcept {
return const_cast<_Mysb*>(_STD addressof(_Buf));
}

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

@ -354,7 +354,7 @@ protected:
case ios_base::cur:
{
constexpr auto _Both = ios_base::in | ios_base::out;
if ((_Mode & _Both) != _Both) { // prohibited by N4928 [tab:stringbuf.seekoff.pos]
if ((_Mode & _Both) != _Both) { // prohibited by N4950 [tab:stringbuf.seekoff.pos]
if (_Mode & ios_base::in) {
if (_Gptr_old || !_Seeklow) {
_Newoff = _Gptr_old - _Seeklow;

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

@ -21,7 +21,7 @@ _STL_DISABLE_CLANG_WARNINGS
#undef new
// We don't support any optional extended floating-point types, but we do need to provide an empty `namespace std`.
// We don't need to `export` it for modules, as the other headers will implicitly do so (N4928 [module.interface]/2.1).
// We don't need to `export` it for modules, as the other headers will implicitly do so (N4950 [module.interface]/2.1).
_STD_BEGIN
_STD_END

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

@ -240,7 +240,7 @@ protected:
}
if ((_Which & ios_base::in && !gptr())
|| (_Which & ios_base::out && !pptr())) { // N4928 [depr.strstreambuf.virtuals]/15:
|| (_Which & ios_base::out && !pptr())) { // N4950 [depr.strstreambuf.virtuals]/15:
// For a sequence to be positioned, if its next pointer
// is a null pointer, the positioning operation fails.
return pos_type{off_type{-1}};
@ -249,7 +249,7 @@ protected:
const auto _Seeklow = eback();
const auto _Seekdist = _Seekhigh - _Seeklow;
// N4928 [depr.strstreambuf.virtuals]/16 effectively says check that the result will be in range
// N4950 [depr.strstreambuf.virtuals]/16 effectively says check that the result will be in range
// [_Seeklow, _Seekhigh]; but we want to calculate this without potential integer overflow
switch (_Way) {
case ios_base::beg:
@ -271,7 +271,7 @@ protected:
case ios_base::cur:
{
constexpr auto _Both = ios_base::in | ios_base::out;
if ((_Which & _Both) == _Both) { // prohibited by N4928 [tab:depr.strstreambuf.seekoff.pos]
if ((_Which & _Both) == _Both) { // prohibited by N4950 [tab:depr.strstreambuf.seekoff.pos]
return pos_type{off_type{-1}};
}

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

@ -716,7 +716,7 @@ _STD_BEGIN
// 1. We would like to keep the definition of __std_win_error in xfilesystem_abi.h
// 2. and xfilesystem_abi.h cannot include <system_error>
// 3. and specialization of is_error_code_enum and overload of make_error_code
// need to be kept together with the enum (see limerick in N4810 [temp.expl.spec]/7)
// need to be kept together with the enum (see limerick in N4950 [temp.expl.spec]/8)
// we resort to using this _Make_ec helper.
_NODISCARD inline error_code _Make_ec(__std_win_error _Errno) noexcept { // make an error_code
return {static_cast<int>(_Errno), _STD system_category()};

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

@ -290,7 +290,7 @@ public:
#if _HAS_CXX23 && defined(__cpp_lib_concepts)
template <_Tuple_like _Other>
_NODISCARD_FRIEND constexpr bool operator==(const tuple&, const _Other&) noexcept /* strengthened */ {
static_assert(tuple_size_v<_Other> == 0, "Cannot compare tuples of different sizes (N4928 [tuple.rel]/2).");
static_assert(tuple_size_v<_Other> == 0, "Cannot compare tuples of different sizes (N4950 [tuple.rel]/2).");
return true;
}
@ -790,10 +790,10 @@ public:
template <_Tuple_like _Other>
_NODISCARD_FRIEND constexpr bool operator==(const tuple& _Left, const _Other& _Right) {
static_assert(1 + sizeof...(_Rest) == tuple_size_v<_Other>,
"Cannot compare tuples of different sizes (N4928 [tuple.rel]/2).");
"Cannot compare tuples of different sizes (N4950 [tuple.rel]/2).");
#if defined(__clang__) || defined(__EDG__) // TRANSITION, VSO-1753916
static_assert(_Can_equal_compare_with_tuple_like_v<_Other>,
"For all i, where 0 <= i < sizeof...(TTypes), get<i>(t) == get<i>(u) must be a valid expression (N4928 "
"For all i, where 0 <= i < sizeof...(TTypes), get<i>(t) == get<i>(u) must be a valid expression (N4950 "
"[tuple.rel]/2).");
#endif // ^^^ no workaround ^^^
return _Left._Equals_to_tuple_like(_Right, make_index_sequence<1 + sizeof...(_Rest)>{});
@ -871,7 +871,7 @@ tuple(allocator_arg_t, _Alloc, tuple<_Types...>) -> tuple<_Types...>;
_EXPORT_STD 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 (N4928 [tuple.rel]/2).");
sizeof...(_Types1) == sizeof...(_Types2), "Cannot compare tuples of different sizes (N4950 [tuple.rel]/2).");
return _Left._Equals(_Right);
}
@ -1098,7 +1098,7 @@ constexpr _Ty _Make_from_tuple_impl(_Tuple&& _Tpl, index_sequence<_Indices...>)
is_nothrow_constructible_v<_Ty, decltype(_STD get<_Indices>(_STD forward<_Tuple>(_Tpl)))...>) {
// construct _Ty from the elements of _Tpl
static_assert(is_constructible_v<_Ty, decltype(_STD get<_Indices>(_STD forward<_Tuple>(_Tpl)))...>,
"the target type must be constructible from the fields of the argument tuple (N4892 [tuple.apply]/2).");
"the target type must be constructible from the fields of the argument tuple (N4950 [tuple.apply]/4).");
return _Ty(_STD get<_Indices>(_STD forward<_Tuple>(_Tpl))...);
}

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

@ -145,7 +145,7 @@ using add_rvalue_reference_t = typename _Add_reference<_Ty>::_Rvalue;
_EXPORT_STD template <class _Ty>
add_rvalue_reference_t<_Ty> declval() noexcept {
static_assert(_Always_false<_Ty>, "Calling declval is ill-formed, see N4928 [declval]/2.");
static_assert(_Always_false<_Ty>, "Calling declval is ill-formed, see N4950 [declval]/2.");
}
_EXPORT_STD template <class _Ty>
@ -1333,7 +1333,7 @@ using _Conditional_type = decltype(false ? _STD declval<_Ty1>() : _STD declval<_
template <class _Ty1, class _Ty2, class = void>
struct _Const_lvalue_cond_oper {};
// N4928 [meta.trans.other]/3.3.4 (per the proposed resolution of LWG-3205): "Otherwise, if remove_cvref_t</**/> denotes
// N4950 [meta.trans.other]/3.3.4 (per the proposed resolution of LWG-3205): "Otherwise, if remove_cvref_t</**/> denotes
// a type..."
template <class _Ty1, class _Ty2>
struct _Const_lvalue_cond_oper<_Ty1, _Ty2, void_t<_Conditional_type<const _Ty1&, const _Ty2&>>> {
@ -1411,11 +1411,11 @@ struct _Copy_cv_impl<const volatile _From> {
using _Apply = const volatile _To;
};
template <class _From, class _To>
using _Copy_cv = // N4928 [meta.trans.other]/2.3
using _Copy_cv = // N4950 [meta.trans.other]/2.3
typename _Copy_cv_impl<_From>::template _Apply<_To>;
template <class _Ty1>
struct _Add_qualifiers { // _Add_qualifiers<A>::template _Apply is XREF(A) from N4928 [meta.trans.other]/2.2
struct _Add_qualifiers { // _Add_qualifiers<A>::template _Apply is XREF(A) from N4950 [meta.trans.other]/2.2
template <class _Ty2>
using _Apply = _Copy_cv<_Ty1, _Ty2>;
};
@ -1432,7 +1432,7 @@ struct _Add_qualifiers<_Ty1&&> {
#if !defined(__EDG__) && !defined(__clang__) // TRANSITION, DevCom-10095944
template <class _Ty1, class _Ty2>
using _Cond_res_if_right = // N4928 [meta.trans.other]/2.4
using _Cond_res_if_right = // N4950 [meta.trans.other]/2.4
decltype(false ? _Returns_exactly<_Ty1>() : _Returns_exactly<_Ty2>());
template <class _Ty>
@ -1454,7 +1454,7 @@ template <class _Ty1, class _Ty2>
using _Cond_res = typename _Cond_res_workaround<_Ty1, _Ty2>::type;
#else // ^^^ workaround / no workaround vvv
template <class _Ty1, class _Ty2>
using _Cond_res = // N4928 [meta.trans.other]/2.4
using _Cond_res = // N4950 [meta.trans.other]/2.4
decltype(false ? _Returns_exactly<_Ty1>() : _Returns_exactly<_Ty2>());
#endif // ^^^ no workaround ^^^
@ -1464,30 +1464,30 @@ struct common_reference;
_EXPORT_STD template <class... _Types>
using common_reference_t = typename common_reference<_Types...>::type;
// N4928 [meta.trans.other]/5.1: "If sizeof...(T) is zero ..."
// N4950 [meta.trans.other]/5.1: "If sizeof...(T) is zero ..."
template <>
struct common_reference<> {};
// N4928 [meta.trans.other]/5.2: "...if sizeof...(T) is one ..."
// N4950 [meta.trans.other]/5.2: "...if sizeof...(T) is one ..."
template <class _Ty>
struct common_reference<_Ty> {
using type = _Ty;
};
// N4928 [meta.trans.other]/5.3: "...if sizeof...(T) is two..."
// N4950 [meta.trans.other]/5.3: "...if sizeof...(T) is two..."
// N4928 [meta.trans.other]/5.3.4: "if common_type_t<T1, T2> is well-formed..."
// N4928 [meta.trans.other]/5.3.5: "Otherwise, there shall be no member type."
// N4950 [meta.trans.other]/5.3.4: "if common_type_t<T1, T2> is well-formed..."
// N4950 [meta.trans.other]/5.3.5: "Otherwise, there shall be no member type."
template <class _Ty1, class _Ty2, class = void>
struct _Common_reference2C : common_type<_Ty1, _Ty2> {};
// N4928 [meta.trans.other]/5.3.3: "if COND_RES(T1, T2) is well-formed..."
// N4950 [meta.trans.other]/5.3.3: "if COND_RES(T1, T2) is well-formed..."
template <class _Ty1, class _Ty2>
struct _Common_reference2C<_Ty1, _Ty2, void_t<_Cond_res<_Ty1, _Ty2>>> {
using type = _Cond_res<_Ty1, _Ty2>;
};
// N4928 [meta.trans.other]/5.3.2: "if basic_common_reference<[...]>::type is well-formed..."
// N4950 [meta.trans.other]/5.3.2: "if basic_common_reference<[...]>::type is well-formed..."
template <class _Ty1, class _Ty2>
using _Basic_specialization = typename basic_common_reference<remove_cvref_t<_Ty1>, remove_cvref_t<_Ty2>,
_Add_qualifiers<_Ty1>::template _Apply, _Add_qualifiers<_Ty2>::template _Apply>::type;
@ -1500,10 +1500,9 @@ struct _Common_reference2B<_Ty1, _Ty2, void_t<_Basic_specialization<_Ty1, _Ty2>>
using type = _Basic_specialization<_Ty1, _Ty2>;
};
// N4928 [meta.trans.other]/5.3.1 as updated by P2655R3 (TRANSITION, cite new WP here):
// "Let R be COMMON-REF(T1, T2). If T1 and T2 are reference types, R is well-formed, and
// is_convertible_v<add_pointer_t<T1>, add_pointer_t<R>> && is_convertible_v<add_pointer_t<T2>, add_pointer_t<R>>
// is true, then the member typedef type denotes R."
// N4950 [meta.trans.other]/5.3.1: "Let R be COMMON-REF(T1, T2). If T1 and T2 are reference types, R is well-formed, and
// is_convertible_v<add_pointer_t<T1>, add_pointer_t<R>> && is_convertible_v<add_pointer_t<T2>, add_pointer_t<R>> is
// true, then the member typedef type denotes R."
template <class _Ty1, class _Ty2, class = void>
struct _Common_reference2A : _Common_reference2B<_Ty1, _Ty2> {};
@ -1516,17 +1515,17 @@ struct _Common_reference2AX {};
template <class _Ty1, class _Ty2>
struct _Common_reference2AX<_Ty1&, _Ty2&, void_t<_LL_common_ref<_Ty1, _Ty2>>> {
using type = _LL_common_ref<_Ty1, _Ty2>; // "both lvalues" case from N4928 [meta.trans.other]/2.5
using type = _LL_common_ref<_Ty1, _Ty2>; // "both lvalues" case from N4950 [meta.trans.other]/2.5
};
template <class _Ty1, class _Ty2>
struct _Common_reference2AX<_Ty1&&, _Ty2&, enable_if_t<is_convertible_v<_Ty1&&, _LL_common_ref<const _Ty1, _Ty2>>>> {
using type = _LL_common_ref<const _Ty1, _Ty2>; // "rvalue and lvalue" case from N4928 [meta.trans.other]/2.7
using type = _LL_common_ref<const _Ty1, _Ty2>; // "rvalue and lvalue" case from N4950 [meta.trans.other]/2.7
};
template <class _Ty1, class _Ty2>
struct _Common_reference2AX<_Ty1&, _Ty2&&, enable_if_t<is_convertible_v<_Ty2&&, _LL_common_ref<const _Ty2, _Ty1>>>> {
using type = _LL_common_ref<const _Ty2, _Ty1>; // "lvalue and rvalue" case from N4928 [meta.trans.other]/2.8
using type = _LL_common_ref<const _Ty2, _Ty1>; // "lvalue and rvalue" case from N4950 [meta.trans.other]/2.8
};
template <class _Ty1, class _Ty2>
@ -1536,7 +1535,7 @@ template <class _Ty1, class _Ty2>
struct _Common_reference2AX<_Ty1&&, _Ty2&&,
enable_if_t<is_convertible_v<_Ty1&&, _RR_common_ref<_Ty1, _Ty2>>
&& is_convertible_v<_Ty2&&, _RR_common_ref<_Ty1, _Ty2>>>> {
using type = _RR_common_ref<_Ty1, _Ty2>; // "both rvalues" case from N4928 [meta.trans.other]/2.6
using type = _RR_common_ref<_Ty1, _Ty2>; // "both rvalues" case from N4950 [meta.trans.other]/2.6
};
template <class _Ty1, class _Ty2>
@ -1552,7 +1551,7 @@ struct _Common_reference2A<_Ty1, _Ty2,
template <class _Ty1, class _Ty2>
struct common_reference<_Ty1, _Ty2> : _Common_reference2A<_Ty1, _Ty2> {};
// N4928 [meta.trans.other]/5.4: "if sizeof...(T) is greater than two..."
// N4950 [meta.trans.other]/5.4: "if sizeof...(T) is greater than two..."
template <class _Void, class _Ty1, class _Ty2, class... _Types>
struct _Fold_common_reference {};
template <class _Ty1, class _Ty2, class... _Types>
@ -1637,7 +1636,7 @@ _EXPORT_STD template <class _Ty>
class reference_wrapper;
// std::invoke isn't constexpr in C++17, and normally implementers are forbidden from "strengthening" constexpr
// (N4928 [constexpr.functions]/1), yet both std::apply and std::visit are required to be constexpr and have
// (N4950 [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.
enum class _Invoker_strategy {

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

@ -856,7 +856,7 @@ _NODISCARD consteval _Ty _Min_limit() noexcept { // same as (numeric_limits<_Ty>
static_assert(_Is_standard_integer<_Ty>); // doesn't attempt to handle all types
if constexpr (is_signed_v<_Ty>) {
constexpr auto _Unsigned_max = static_cast<make_unsigned_t<_Ty>>(-1);
return static_cast<_Ty>((_Unsigned_max >> 1) + 1); // well-defined, N4861 [conv.integral]/3
return static_cast<_Ty>((_Unsigned_max >> 1) + 1); // well-defined, N4950 [conv.integral]/3
} else {
return 0;
}

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

@ -1166,7 +1166,7 @@ _NODISCARD valarray<_Ty> abs(const valarray<_Ty>& _Left) {
const size_t _Size = _Left.size();
valarray<_Ty> _Ans(_Size);
for (size_t _Idx = 0; _Idx < _Size; ++_Idx) {
_Ans[_Idx] = abs(_Left[_Idx]); // intentional ADL, N4835 [valarray.transcend]/1
_Ans[_Idx] = abs(_Left[_Idx]); // intentional ADL, N4950 [valarray.transcend]/1
}
return _Ans;
}
@ -1176,7 +1176,7 @@ _NODISCARD valarray<_Ty> acos(const valarray<_Ty>& _Left) {
const size_t _Size = _Left.size();
valarray<_Ty> _Ans(_Size);
for (size_t _Idx = 0; _Idx < _Size; ++_Idx) {
_Ans[_Idx] = acos(_Left[_Idx]); // intentional ADL, N4835 [valarray.transcend]/1
_Ans[_Idx] = acos(_Left[_Idx]); // intentional ADL, N4950 [valarray.transcend]/1
}
return _Ans;
}
@ -1186,7 +1186,7 @@ _NODISCARD valarray<_Ty> asin(const valarray<_Ty>& _Left) {
const size_t _Size = _Left.size();
valarray<_Ty> _Ans(_Size);
for (size_t _Idx = 0; _Idx < _Size; ++_Idx) {
_Ans[_Idx] = asin(_Left[_Idx]); // intentional ADL, N4835 [valarray.transcend]/1
_Ans[_Idx] = asin(_Left[_Idx]); // intentional ADL, N4950 [valarray.transcend]/1
}
return _Ans;
}
@ -1196,7 +1196,7 @@ _NODISCARD valarray<_Ty> atan(const valarray<_Ty>& _Left) {
const size_t _Size = _Left.size();
valarray<_Ty> _Ans(_Size);
for (size_t _Idx = 0; _Idx < _Size; ++_Idx) {
_Ans[_Idx] = atan(_Left[_Idx]); // intentional ADL, N4835 [valarray.transcend]/1
_Ans[_Idx] = atan(_Left[_Idx]); // intentional ADL, N4950 [valarray.transcend]/1
}
return _Ans;
}
@ -1206,7 +1206,7 @@ _NODISCARD valarray<_Ty> atan2(const valarray<_Ty>& _Left, const valarray<_Ty>&
const size_t _Size = _Left.size();
valarray<_Ty> _Ans(_Size);
for (size_t _Idx = 0; _Idx < _Size; ++_Idx) {
_Ans[_Idx] = atan2(_Left[_Idx], _Right[_Idx]); // intentional ADL, N4835 [valarray.transcend]/1
_Ans[_Idx] = atan2(_Left[_Idx], _Right[_Idx]); // intentional ADL, N4950 [valarray.transcend]/1
}
return _Ans;
}
@ -1216,7 +1216,7 @@ _NODISCARD valarray<_Ty> atan2(const valarray<_Ty>& _Left, const typename valarr
const size_t _Size = _Left.size();
valarray<_Ty> _Ans(_Size);
for (size_t _Idx = 0; _Idx < _Size; ++_Idx) {
_Ans[_Idx] = atan2(_Left[_Idx], _Right); // intentional ADL, N4835 [valarray.transcend]/1
_Ans[_Idx] = atan2(_Left[_Idx], _Right); // intentional ADL, N4950 [valarray.transcend]/1
}
return _Ans;
}
@ -1226,7 +1226,7 @@ _NODISCARD valarray<_Ty> atan2(const typename valarray<_Ty>::value_type& _Left,
const size_t _Size = _Right.size();
valarray<_Ty> _Ans(_Size);
for (size_t _Idx = 0; _Idx < _Size; ++_Idx) {
_Ans[_Idx] = atan2(_Left, _Right[_Idx]); // intentional ADL, N4835 [valarray.transcend]/1
_Ans[_Idx] = atan2(_Left, _Right[_Idx]); // intentional ADL, N4950 [valarray.transcend]/1
}
return _Ans;
}
@ -1236,7 +1236,7 @@ _NODISCARD valarray<_Ty> cos(const valarray<_Ty>& _Left) {
const size_t _Size = _Left.size();
valarray<_Ty> _Ans(_Size);
for (size_t _Idx = 0; _Idx < _Size; ++_Idx) {
_Ans[_Idx] = cos(_Left[_Idx]); // intentional ADL, N4835 [valarray.transcend]/1
_Ans[_Idx] = cos(_Left[_Idx]); // intentional ADL, N4950 [valarray.transcend]/1
}
return _Ans;
}
@ -1246,7 +1246,7 @@ _NODISCARD valarray<_Ty> cosh(const valarray<_Ty>& _Left) {
const size_t _Size = _Left.size();
valarray<_Ty> _Ans(_Size);
for (size_t _Idx = 0; _Idx < _Size; ++_Idx) {
_Ans[_Idx] = cosh(_Left[_Idx]); // intentional ADL, N4835 [valarray.transcend]/1
_Ans[_Idx] = cosh(_Left[_Idx]); // intentional ADL, N4950 [valarray.transcend]/1
}
return _Ans;
}
@ -1256,7 +1256,7 @@ _NODISCARD valarray<_Ty> exp(const valarray<_Ty>& _Left) {
const size_t _Size = _Left.size();
valarray<_Ty> _Ans(_Size);
for (size_t _Idx = 0; _Idx < _Size; ++_Idx) {
_Ans[_Idx] = exp(_Left[_Idx]); // intentional ADL, N4835 [valarray.transcend]/1
_Ans[_Idx] = exp(_Left[_Idx]); // intentional ADL, N4950 [valarray.transcend]/1
}
return _Ans;
}
@ -1266,7 +1266,7 @@ _NODISCARD valarray<_Ty> log(const valarray<_Ty>& _Left) {
const size_t _Size = _Left.size();
valarray<_Ty> _Ans(_Size);
for (size_t _Idx = 0; _Idx < _Size; ++_Idx) {
_Ans[_Idx] = log(_Left[_Idx]); // intentional ADL, N4835 [valarray.transcend]/1
_Ans[_Idx] = log(_Left[_Idx]); // intentional ADL, N4950 [valarray.transcend]/1
}
return _Ans;
}
@ -1276,7 +1276,7 @@ _NODISCARD valarray<_Ty> log10(const valarray<_Ty>& _Left) {
const size_t _Size = _Left.size();
valarray<_Ty> _Ans(_Size);
for (size_t _Idx = 0; _Idx < _Size; ++_Idx) {
_Ans[_Idx] = log10(_Left[_Idx]); // intentional ADL, N4835 [valarray.transcend]/1
_Ans[_Idx] = log10(_Left[_Idx]); // intentional ADL, N4950 [valarray.transcend]/1
}
return _Ans;
}
@ -1286,7 +1286,7 @@ _NODISCARD valarray<_Ty> pow(const valarray<_Ty>& _Left, const valarray<_Ty>& _R
const size_t _Size = _Left.size();
valarray<_Ty> _Ans(_Size);
for (size_t _Idx = 0; _Idx < _Size; ++_Idx) {
_Ans[_Idx] = pow(_Left[_Idx], _Right[_Idx]); // intentional ADL, N4835 [valarray.transcend]/1
_Ans[_Idx] = pow(_Left[_Idx], _Right[_Idx]); // intentional ADL, N4950 [valarray.transcend]/1
}
return _Ans;
}
@ -1296,7 +1296,7 @@ _NODISCARD valarray<_Ty> pow(const valarray<_Ty>& _Left, const typename valarray
const size_t _Size = _Left.size();
valarray<_Ty> _Ans(_Size);
for (size_t _Idx = 0; _Idx < _Size; ++_Idx) {
_Ans[_Idx] = pow(_Left[_Idx], _Right); // intentional ADL, N4835 [valarray.transcend]/1
_Ans[_Idx] = pow(_Left[_Idx], _Right); // intentional ADL, N4950 [valarray.transcend]/1
}
return _Ans;
}
@ -1306,7 +1306,7 @@ _NODISCARD valarray<_Ty> pow(const typename valarray<_Ty>::value_type& _Left, co
const size_t _Size = _Right.size();
valarray<_Ty> _Ans(_Size);
for (size_t _Idx = 0; _Idx < _Size; ++_Idx) {
_Ans[_Idx] = pow(_Left, _Right[_Idx]); // intentional ADL, N4835 [valarray.transcend]/1
_Ans[_Idx] = pow(_Left, _Right[_Idx]); // intentional ADL, N4950 [valarray.transcend]/1
}
return _Ans;
}
@ -1316,7 +1316,7 @@ _NODISCARD valarray<_Ty> sin(const valarray<_Ty>& _Left) {
const size_t _Size = _Left.size();
valarray<_Ty> _Ans(_Size);
for (size_t _Idx = 0; _Idx < _Size; ++_Idx) {
_Ans[_Idx] = sin(_Left[_Idx]); // intentional ADL, N4835 [valarray.transcend]/1
_Ans[_Idx] = sin(_Left[_Idx]); // intentional ADL, N4950 [valarray.transcend]/1
}
return _Ans;
}
@ -1326,7 +1326,7 @@ _NODISCARD valarray<_Ty> sinh(const valarray<_Ty>& _Left) {
const size_t _Size = _Left.size();
valarray<_Ty> _Ans(_Size);
for (size_t _Idx = 0; _Idx < _Size; ++_Idx) {
_Ans[_Idx] = sinh(_Left[_Idx]); // intentional ADL, N4835 [valarray.transcend]/1
_Ans[_Idx] = sinh(_Left[_Idx]); // intentional ADL, N4950 [valarray.transcend]/1
}
return _Ans;
}
@ -1336,7 +1336,7 @@ _NODISCARD valarray<_Ty> sqrt(const valarray<_Ty>& _Left) {
const size_t _Size = _Left.size();
valarray<_Ty> _Ans(_Size);
for (size_t _Idx = 0; _Idx < _Size; ++_Idx) {
_Ans[_Idx] = sqrt(_Left[_Idx]); // intentional ADL, N4835 [valarray.transcend]/1
_Ans[_Idx] = sqrt(_Left[_Idx]); // intentional ADL, N4950 [valarray.transcend]/1
}
return _Ans;
}
@ -1346,7 +1346,7 @@ _NODISCARD valarray<_Ty> tan(const valarray<_Ty>& _Left) {
const size_t _Size = _Left.size();
valarray<_Ty> _Ans(_Size);
for (size_t _Idx = 0; _Idx < _Size; ++_Idx) {
_Ans[_Idx] = tan(_Left[_Idx]); // intentional ADL, N4835 [valarray.transcend]/1
_Ans[_Idx] = tan(_Left[_Idx]); // intentional ADL, N4950 [valarray.transcend]/1
}
return _Ans;
}
@ -1356,7 +1356,7 @@ _NODISCARD valarray<_Ty> tanh(const valarray<_Ty>& _Left) {
const size_t _Size = _Left.size();
valarray<_Ty> _Ans(_Size);
for (size_t _Idx = 0; _Idx < _Size; ++_Idx) {
_Ans[_Idx] = tanh(_Left[_Idx]); // intentional ADL, N4835 [valarray.transcend]/1
_Ans[_Idx] = tanh(_Left[_Idx]); // intentional ADL, N4950 [valarray.transcend]/1
}
return _Ans;
}

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

@ -967,9 +967,9 @@ class variant : private _SMF_control<_Variant_destroy_layer<_Types...>, _Types..
public:
static_assert(conjunction_v<is_object<_Types>..., negation<is_array<_Types>>..., is_destructible<_Types>...>,
"variant<Types...> requires all of the Types to meet the Cpp17Destructible requirements "
"N4828 [variant.variant]/2.");
"(N4950 [variant.variant.general]/2).");
static_assert(sizeof...(_Types) > 0,
"variant<> (with no template arguments) may not be instantiated (N4835 [variant.variant]/3).");
"variant<> (with no template arguments) may not be instantiated (N4950 [variant.variant.general]/3).");
using _Mybase = _SMF_control<_Variant_destroy_layer<_Types...>, _Types...>;
template <class _First = _Meta_front<variant>, enable_if_t<is_default_constructible_v<_First>, int> = 0>
@ -1095,9 +1095,9 @@ public:
// exchange the contained values if *this and _That hold the same alternative, otherwise exchange the values of
// the variants themselves
static_assert(conjunction_v<is_move_constructible<_Types>...>,
"variant<Types...>::swap requires all of the Types... to be move constructible. (N4835 [variant.swap]/1)");
"variant<Types...>::swap requires all of the Types... to be move constructible. (N4950 [variant.swap]/1)");
static_assert(disjunction_v<negation<is_move_constructible<_Types>>..., conjunction<is_swappable<_Types>...>>,
"variant<Types...>::swap requires all of the Types... to be swappable. (N4835 [variant.swap]/1)");
"variant<Types...>::swap requires all of the Types... to be swappable. (N4950 [variant.swap]/2)");
if constexpr (conjunction_v<_Is_trivially_swappable<_Types>...>) {
using _BaseTy = _Variant_base<_Types...>;
_STD swap(static_cast<_BaseTy&>(*this), static_cast<_BaseTy&>(_That));
@ -1190,7 +1190,7 @@ _NODISCARD constexpr bool holds_alternative(const variant<_Types...>& _Var) noex
// true iff _Var holds alternative _Ty
constexpr size_t _Idx = _Meta_find_unique_index<variant<_Types...>, _Ty>::value;
static_assert(_Idx != _Meta_npos, "holds_alternative<T>(const variant<Types...>&) requires T to occur exactly "
"once in Types. (N4835 [variant.get]/1)");
"once in Types. (N4950 [variant.get]/1)");
return _Var.index() == _Idx;
}
@ -1240,7 +1240,7 @@ _NODISCARD constexpr decltype(auto) get(variant<_Types...>& _Var) {
// access the contained value of _Var if its alternative _Ty is active
constexpr size_t _Idx = _Meta_find_unique_index<variant<_Types...>, _Ty>::value;
static_assert(_Idx < sizeof...(_Types),
"get<T>(variant<Types...>&) requires T to occur exactly once in Types. (N4835 [variant.get]/5)");
"get<T>(variant<Types...>&) requires T to occur exactly once in Types. (N4950 [variant.get]/5)");
return _STD get<_Idx>(_Var);
}
_EXPORT_STD template <class _Ty, class... _Types>
@ -1248,7 +1248,7 @@ _NODISCARD constexpr decltype(auto) get(variant<_Types...>&& _Var) {
// access the contained value of _Var if its alternative _Ty is active
constexpr size_t _Idx = _Meta_find_unique_index<variant<_Types...>, _Ty>::value;
static_assert(_Idx < sizeof...(_Types),
"get<T>(variant<Types...>&&) requires T to occur exactly once in Types. (N4835 [variant.get]/5)");
"get<T>(variant<Types...>&&) requires T to occur exactly once in Types. (N4950 [variant.get]/5)");
return _STD get<_Idx>(_STD move(_Var));
}
_EXPORT_STD template <class _Ty, class... _Types>
@ -1256,7 +1256,7 @@ _NODISCARD constexpr decltype(auto) get(const variant<_Types...>& _Var) {
// access the contained value of _Var if its alternative _Ty is active
constexpr size_t _Idx = _Meta_find_unique_index<variant<_Types...>, _Ty>::value;
static_assert(_Idx < sizeof...(_Types),
"get<T>(const variant<Types...>&) requires T to occur exactly once in Types. (N4835 [variant.get]/5)");
"get<T>(const variant<Types...>&) requires T to occur exactly once in Types. (N4950 [variant.get]/5)");
return _STD get<_Idx>(_Var);
}
_EXPORT_STD template <class _Ty, class... _Types>
@ -1264,7 +1264,7 @@ _NODISCARD constexpr decltype(auto) get(const variant<_Types...>&& _Var) {
// access the contained value of _Var if its alternative _Ty is active
constexpr size_t _Idx = _Meta_find_unique_index<variant<_Types...>, _Ty>::value;
static_assert(_Idx < sizeof...(_Types),
"get<T>(const variant<Types...>&&) requires T to occur exactly once in Types. (N4835 [variant.get]/5)");
"get<T>(const variant<Types...>&&) requires T to occur exactly once in Types. (N4950 [variant.get]/5)");
return _STD get<_Idx>(_STD move(_Var));
}
@ -1286,7 +1286,7 @@ _NODISCARD constexpr add_pointer_t<_Ty> get_if(variant<_Types...>* _Ptr) noexcep
// get the address of *_Ptr's contained value if it holds alternative _Ty
constexpr size_t _Idx = _Meta_find_unique_index<variant<_Types...>, _Ty>::value;
static_assert(_Idx != _Meta_npos,
"get_if<T>(variant<Types...> *) requires T to occur exactly once in Types. (N4835 [variant.get]/9)");
"get_if<T>(variant<Types...> *) requires T to occur exactly once in Types. (N4950 [variant.get]/9)");
return _STD get_if<_Idx>(_Ptr);
}
_EXPORT_STD template <class _Ty, class... _Types>
@ -1294,7 +1294,7 @@ _NODISCARD constexpr add_pointer_t<const _Ty> get_if(const variant<_Types...>* _
// get the address of *_Ptr's contained value if it holds alternative _Ty
constexpr size_t _Idx = _Meta_find_unique_index<variant<_Types...>, _Ty>::value;
static_assert(_Idx != _Meta_npos,
"get_if<T>(const variant<Types...> *) requires T to occur exactly once in Types. (N4835 [variant.get]/9)");
"get_if<T>(const variant<Types...> *) requires T to occur exactly once in Types. (N4950 [variant.get]/9)");
return _STD get_if<_Idx>(_Ptr);
}
@ -1612,7 +1612,7 @@ constexpr _Variant_visit_result_t<_Callable, _As_variant<_Variants>...> visit(_C
using _Ret = _Variant_visit_result_t<_Callable, _As_variant<_Variants>...>;
static_assert(_Variant_all_visit_results_same<_Ret, _Callable, _Meta_list<>, _As_variant<_Variants>...>,
"visit() requires the result of all potential invocations to have the same type and value category "
"(N4835 [variant.visit]/2).");
"(N4950 [variant.visit]/5).");
return _STD _Visit_impl<_Size, _Ret, _ListOfIndexVectors>(
static_cast<_Callable&&>(_Obj), static_cast<_Variants&&>(_Args)...);
@ -1657,7 +1657,7 @@ constexpr _Ret visit(_Callable&& _Obj, _Variants&&... _Args) {
if constexpr (!is_void_v<_Ret>) {
static_assert(_Variant_all_visit_results_convertible<_Ret, _Callable, _Meta_list<>, _As_variant<_Variants>...>,
"visit<R>() requires the result of all potential invocations to be implicitly convertible to R "
"(N4835 [variant.visit]/2).");
"(N4950 [variant.visit]/5).");
}
return _STD _Visit_impl<_Size, _Ret, _ListOfIndexVectors>(

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

@ -884,7 +884,7 @@ private:
// insert range [_First, _Last) at end
// For one-at-back, provide strong guarantee.
// Otherwise, provide basic guarantee (despite N4928 [vector.modifiers]/2).
// Otherwise, provide basic guarantee (despite N4950 [vector.modifiers]/2).
// Performance note: except for one-at-back, _Emplace_one_at_back()'s strong guarantee is unnecessary here.
for (; _First != _Last; ++_First) {
@ -1766,7 +1766,7 @@ public:
if (_Myfirst == _Mylast) { // already empty, nothing to do
// This is an optimization for debug mode: we can avoid taking the debug lock to invalidate iterators.
// Note that when clearing an empty vector, this will preserve past-the-end iterators, which is allowed by
// N4928 [sequence.reqmts]/54 "a.clear() [...] may invalidate the past-the-end iterator".
// N4950 [sequence.reqmts]/54 "a.clear() [...] may invalidate the past-the-end iterator".
return;
}

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

@ -1999,7 +1999,7 @@ protected:
};
#if _HAS_CXX17
// For constraining deduction guides (N4892 [unord.req]/18.3)
// For constraining deduction guides (N4950 [unord.req.general]/243.3)
template <class _Hasher>
using _Is_hasher = negation<disjunction<is_integral<_Hasher>, _Is_allocator<_Hasher>>>;
#endif // _HAS_CXX17

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

@ -568,8 +568,8 @@ protected:
int _Errno;
char* _Ep;
_Val = _STD _Stofx_v3(_Ac, &_Ep, &_Errno); // convert
if (_Ep == _Ac || _Errno != 0 // N4944 [facet.num.get.virtuals]/3
|| _Parse_result._Bad_grouping) { // N4944 [facet.num.get.virtuals]/4
if (_Ep == _Ac || _Errno != 0 // N4950 [facet.num.get.virtuals]/3
|| _Parse_result._Bad_grouping) { // N4950 [facet.num.get.virtuals]/4
_State = ios_base::failbit;
}
}
@ -594,8 +594,8 @@ protected:
int _Errno;
char* _Ep;
_Val = _STD _Stodx_v3(_Ac, &_Ep, &_Errno); // convert
if (_Ep == _Ac || _Errno != 0 // N4944 [facet.num.get.virtuals]/3
|| _Parse_result._Bad_grouping) { // N4944 [facet.num.get.virtuals]/4
if (_Ep == _Ac || _Errno != 0 // N4950 [facet.num.get.virtuals]/3
|| _Parse_result._Bad_grouping) { // N4950 [facet.num.get.virtuals]/4
_State = ios_base::failbit;
}
}
@ -1175,7 +1175,7 @@ __PURE_APPDOMAIN_GLOBAL locale::id num_get<_Elem, _InIt>::id;
template <class _Ty>
int _Float_put_desired_precision(const streamsize _Precision, const ios_base::fmtflags _Float_flags) {
// return the effective precision determined by N4944 [facet.num.put.virtuals]/2.1 and printf's rules
// return the effective precision determined by N4950 [facet.num.put.virtuals]/2.1 and printf's rules
const bool _Is_hex = _Float_flags == (ios_base::fixed | ios_base::scientific);
if (_Is_hex) {
// return the number of hexits needed (after the radix point) to represent the floating-point value exactly

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

@ -157,11 +157,11 @@ public:
for (; _Fmtfirst != _Fmtlast; ++_Fmtfirst) {
if (_State != ios_base::goodbit) {
// N4878 [locale.time.get.members]/8.2
// N4950 [locale.time.get.members]/8.2
// _State is fail, eof, or bad. Do not proceed to the next fields. Return with current _State.
break;
} else if (_First == _Last) {
// N4878 [locale.time.get.members]/8.3
// N4950 [locale.time.get.members]/8.3
_State = ios_base::eofbit | ios_base::failbit;
break;
} else if (_Ctype_fac.narrow(*_Fmtfirst) != '%') { // match literal element
@ -176,7 +176,7 @@ public:
++_First;
}
} else if (++_Fmtfirst == _Fmtlast) {
// N4878 [locale.time.get.members]/8.4: "If the number of elements in the range [fmt, fmtend) is not
// N4950 [locale.time.get.members]/8.4: "If the number of elements in the range [fmt, fmtend) is not
// sufficient to unambiguously determine whether the conversion specification is complete and valid,
// the function evaluates err = ios_base::failbit."
_State = ios_base::failbit;

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

@ -1043,7 +1043,7 @@ _NODISCARD bool operator!=(const allocator<_Ty>&, const allocator<_Other>&) noex
#endif // !_HAS_CXX20
#if _HAS_CXX17
// See N4892 [unord.map.overview]/4
// See N4950 [unord.map.overview]/4
template <class _Alloc>
using _Guide_size_type_t =
typename allocator_traits<conditional_t<_Is_allocator<_Alloc>::value, _Alloc, allocator<int>>>::size_type;

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

@ -32,14 +32,14 @@ void _Uses_alloc_construct_non_pair(_Ty* const _Ptr, _Outer_alloc& _Outer, _Inne
_Outer, _Ptr, allocator_arg, _Inner, _STD forward<_Types>(_Args)...);
} else {
static_assert(is_constructible_v<_Ty, _Types..., _Inner_alloc&>,
"N4928 [allocator.uses.trait]/1 requires "
"N4950 [allocator.uses.trait]/1 requires "
"is_constructible_v<T, Args..., Alloc&> when uses_allocator_v<remove_cv_t<T>, Alloc> is true and "
"is_constructible_v<T, allocator_arg_t, Alloc&, Args...> is false");
allocator_traits<_Outer_alloc>::construct(_Outer, _Ptr, _STD forward<_Types>(_Args)..., _Inner);
}
} else {
static_assert(is_constructible_v<_Ty, _Types...>,
"N4928 [allocator.uses.trait]/1 requires "
"N4950 [allocator.uses.trait]/1 requires "
"is_constructible_v<T, Args...> when uses_allocator_v<remove_cv_t<T>, Alloc> is false");
allocator_traits<_Outer_alloc>::construct(_Outer, _Ptr, _STD forward<_Types>(_Args)...);
}
@ -211,7 +211,7 @@ namespace pmr {
/* implicit */ polymorphic_allocator(memory_resource* const _Resource_) noexcept // strengthened
: _Resource{_Resource_} { // initialize with _Resource_
_STL_ASSERT(_Resource,
"Cannot initialize polymorphic_allocator with null resource (N4928 [mem.poly.allocator.ctor]/2)");
"Cannot initialize polymorphic_allocator with null resource (N4950 [mem.poly.allocator.ctor]/2)");
}
polymorphic_allocator(const polymorphic_allocator&) = default;

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

@ -576,7 +576,7 @@ constexpr size_t _Traits_find(_In_reads_(_Hay_size) const _Traits_ptr_t<_Traits>
// search [_Haystack, _Haystack + _Hay_size) for [_Needle, _Needle + _Needle_size), at/after _Start_at
if (_Needle_size > _Hay_size || _Start_at > _Hay_size - _Needle_size) {
// xpos cannot exist, report failure
// N4910 23.3.3.8 [string.view.find]/3 says:
// N4950 [string.view.find]/3 says:
// 1. _Start_at <= xpos
// 2. xpos + _Needle_size <= _Hay_size;
// therefore:
@ -1170,12 +1170,12 @@ _EXPORT_STD template <class _Elem, class _Traits>
class basic_string_view { // wrapper for any kind of contiguous character buffer
public:
static_assert(is_same_v<_Elem, typename _Traits::char_type>,
"Bad char_traits for basic_string_view; N4910 23.3.3.1 [string.view.template.general]/1 "
"Bad char_traits for basic_string_view; N4950 [string.view.template.general]/1 "
"\"The program is ill-formed if traits::char_type is not the same type as charT.\"");
static_assert(!is_array_v<_Elem> && is_trivial_v<_Elem> && is_standard_layout_v<_Elem>,
"The character type of basic_string_view must be a non-array trivial standard-layout type. See N4910 "
"23.1 [strings.general]/1.");
"The character type of basic_string_view must be a non-array trivial standard-layout type. See N4950 "
"[strings.general]/1.");
using traits_type = _Traits;
using value_type = _Elem;
@ -1767,7 +1767,7 @@ struct _Get_comparison_category<_Traits, void_t<typename _Traits::comparison_cat
using type = typename _Traits::comparison_category;
static_assert(_Is_any_of_v<type, partial_ordering, weak_ordering, strong_ordering>,
"N4910 23.3.5 [string.view.comparison]/4: Mandates: R denotes a comparison category type.");
"N4950 [string.view.comparison]/4: Mandates: R denotes a comparison category type.");
};
template <class _Traits>
@ -2335,12 +2335,12 @@ private:
_MISMATCHED_ALLOCATOR_MESSAGE("basic_string<T, Traits, Allocator>", "T"));
static_assert(is_same_v<_Elem, typename _Traits::char_type>,
"N4910 23.4.3.2 [string.require]/3 requires that the supplied "
"N4950 [string.require]/3 requires that the supplied "
"char_traits character type match the string's character type.");
static_assert(!is_array_v<_Elem> && is_trivial_v<_Elem> && is_standard_layout_v<_Elem>,
"The character type of basic_string must be a non-array trivial standard-layout type. See N4910 "
"23.1 [strings.general]/1.");
"The character type of basic_string must be a non-array trivial standard-layout type. See N4950 "
"[strings.general]/1.");
public:
using traits_type = _Traits;
@ -2369,7 +2369,7 @@ private:
// _String_val::_Bx::_Ptr (type is pointer)
// _String_val::_Mysize (type is size_type)
// _String_val::_Myres (type is size_type)
// N4910 23.1 [strings.general]/1 says _Elem must be trivial standard-layout, so memcpy is safe.
// N4950 [strings.general]/1 says _Elem must be trivial standard-layout, so memcpy is safe.
// We need to ask if pointer is safe to memcpy.
// size_type must be an unsigned integral type so memcpy is safe.
// We also need to disable memcpy if the user has supplied _Traits, since
@ -4970,10 +4970,10 @@ _NODISCARD _CONSTEXPR20 basic_string<_Elem, _Traits, _Alloc> operator+(
basic_string<_Elem, _Traits, _Alloc>&& _Left, basic_string<_Elem, _Traits, _Alloc>&& _Right) {
#if _ITERATOR_DEBUG_LEVEL == 2
_STL_VERIFY(_STD addressof(_Left) != _STD addressof(_Right),
"You cannot concatenate the same moved string to itself. See N4910 16.4.5.9 [res.on.arguments]/1.3: "
"You cannot concatenate the same moved string to itself. See N4950 [res.on.arguments]/1.3: "
"If a function argument is bound to an rvalue reference parameter, the implementation may assume that "
"this parameter is a unique reference to this argument, except that the argument passed to "
"a move-assignment operator may be a reference to *this (16.4.6.15 [lib.types.movedfrom]).");
"a move-assignment operator may be a reference to *this ([lib.types.movedfrom]).");
#endif // _ITERATOR_DEBUG_LEVEL == 2
return {_String_constructor_concat_tag{}, _Left, _Right};
}

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

@ -325,8 +325,7 @@ inline constexpr bool
_EXPORT_STD template <class _Ty>
_NODISCARD constexpr _Ty* to_address(_Ty* const _Val) noexcept {
static_assert(!is_function_v<_Ty>,
"N4810 20.10.4 [pointer.conversion]/2: The program is ill-formed if T is a function type.");
static_assert(!is_function_v<_Ty>, "N4950 [pointer.conversion]/1: Mandates: T is not a function type.");
return _Val;
}
@ -1270,9 +1269,9 @@ struct _Is_allocator : false_type {}; // selected when _Ty can't possibly be an
template <class _Ty>
struct _Is_allocator<_Ty, void_t<typename _Ty::value_type, decltype(_STD declval<_Ty&>().deallocate(
_STD declval<_Ty&>().allocate(size_t{1}), size_t{1}))>>
: true_type {}; // selected when _Ty resembles an allocator, N4687 26.2.1 [container.requirements.general]/17
: true_type {}; // selected when _Ty resembles an allocator, N4950 [container.reqmts]/69
// deduction guide utilities (N4892 [associative.general]/2)
// deduction guide utilities (N4950 [associative.general]/2)
template <class _Iter>
using _Guide_key_t =
#if _HAS_CXX23
@ -1306,7 +1305,7 @@ _EXPORT_STD template <class _Ty>
inline constexpr bool is_execution_policy_v = is_execution_policy<_Ty>::value;
// Note: The noexcept specifiers on all parallel algorithm overloads enforce termination as per
// N4713 23.19.4 [execpol.seq]/2, 23.19.5 [execpol.par]/2, and 23.19.6 [execpol.parunseq]/2
// N4950 [execpol.seq]/2, [execpol.par]/2, [execpol.parunseq]/2, and [execpol.unseq]/2
template <class _ExPo>
using _Enable_if_execution_policy_t = typename remove_reference_t<_ExPo>::_Standard_execution_policy;
@ -3528,17 +3527,19 @@ namespace ranges {
private:
_NODISCARD constexpr _Derived& _Cast() noexcept {
static_assert(derived_from<_Derived, view_interface>,
"view_interface's template argument D must derive from view_interface<D> (N4849 [view.interface]/2).");
"view_interface's template argument D must derive from view_interface<D> "
"(N4950 [view.interface.general]/2).");
static_assert(view<_Derived>,
"view_interface's template argument must model the view concept (N4849 [view.interface]/2).");
"view_interface's template argument must model the view concept (N4950 [view.interface.general]/2).");
return static_cast<_Derived&>(*this);
}
_NODISCARD constexpr const _Derived& _Cast() const noexcept {
static_assert(derived_from<_Derived, view_interface>,
"view_interface's template argument D must derive from view_interface<D> (N4849 [view.interface]/2).");
"view_interface's template argument D must derive from view_interface<D> "
"(N4950 [view.interface.general]/2).");
static_assert(view<_Derived>,
"view_interface's template argument must model the view concept (N4849 [view.interface]/2).");
"view_interface's template argument must model the view concept (N4950 [view.interface.general]/2).");
return static_cast<const _Derived&>(*this);
}
@ -3899,7 +3900,7 @@ namespace ranges {
if constexpr (sized_sentinel_for<_Se, _It>) {
_STL_ASSERT(_Size_ == static_cast<_Size_type>(_Last - _First),
"This constructor's third argument should be equal to the distance "
"between the first and second arguments (N4849 [range.subrange.ctor]/3).");
"between the first and second arguments (N4950 [range.subrange.ctor]/3).");
}
}
@ -6909,7 +6910,7 @@ namespace ranges {
const auto _First = _Range.begin();
const auto _Last = _Range.end();
_STL_ASSERT(_First != _Last,
"An initializer_list passed to std::ranges::max must not be empty. (N4861 [alg.min.max]/13)");
"An initializer_list passed to std::ranges::max must not be empty. (N4950 [alg.min.max]/13)");
return *_RANGES _Max_element_unchecked(_First, _Last, _Pass_fn(_Pred), _Pass_fn(_Proj));
}
@ -6920,7 +6921,7 @@ namespace ranges {
auto _UFirst = _Ubegin(_Range);
auto _ULast = _Uend(_Range);
_STL_ASSERT(
_UFirst != _ULast, "A range passed to std::ranges::max must not be empty. (N4861 [alg.min.max]/13)");
_UFirst != _ULast, "A range passed to std::ranges::max must not be empty. (N4950 [alg.min.max]/13)");
if constexpr (forward_range<_Rng> && _Prefer_iterator_copies<iterator_t<_Rng>>) {
return static_cast<range_value_t<_Rng>>(*_RANGES _Max_element_unchecked(
_STD move(_UFirst), _STD move(_ULast), _Pass_fn(_Pred), _Pass_fn(_Proj)));
@ -7097,7 +7098,7 @@ namespace ranges {
const auto _First = _Range.begin();
const auto _Last = _Range.end();
_STL_ASSERT(_First != _Last,
"An initializer_list passed to std::ranges::min must not be empty. (N4861 [alg.min.max]/5)");
"An initializer_list passed to std::ranges::min must not be empty. (N4950 [alg.min.max]/5)");
return *_RANGES _Min_element_unchecked(_First, _Last, _Pass_fn(_Pred), _Pass_fn(_Proj));
}
@ -7108,7 +7109,7 @@ namespace ranges {
auto _UFirst = _Ubegin(_Range);
auto _ULast = _Uend(_Range);
_STL_ASSERT(
_UFirst != _ULast, "A range passed to std::ranges::min must not be empty. (N4861 [alg.min.max]/5)");
_UFirst != _ULast, "A range passed to std::ranges::min must not be empty. (N4950 [alg.min.max]/5)");
if constexpr (forward_range<_Rng> && _Prefer_iterator_copies<iterator_t<_Rng>>) {
return static_cast<range_value_t<_Rng>>(*_RANGES _Min_element_unchecked(
_STD move(_UFirst), _STD move(_ULast), _Pass_fn(_Pred), _Pass_fn(_Proj)));

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

@ -863,7 +863,7 @@ _EMIT_STL_ERROR(STL1001, "Unexpected compiler version, expected MSVC 19.36 or ne
#error /GR implies _HAS_STATIC_RTTI.
#endif // defined(_CPPRTTI) && !_HAS_STATIC_RTTI
// N4842 [dcl.constexpr]/1: "A function or static data member declared with the
// N4950 [dcl.constexpr]/1: "A function or static data member declared with the
// constexpr or consteval specifier is implicitly an inline function or variable"
// Functions that became constexpr in C++17
@ -960,10 +960,9 @@ _EMIT_STL_ERROR(STL1004, "C++98 unexpected() is incompatible with C++23 unexpect
#define _ENFORCE_MATCHING_ALLOCATORS _HAS_CXX17
#endif // _ENFORCE_MATCHING_ALLOCATORS
#define _MISMATCHED_ALLOCATOR_MESSAGE(_CONTAINER, _VALUE_TYPE) \
_CONTAINER " requires that Allocator's value_type match " _VALUE_TYPE \
" (See N4659 26.2.1 [container.requirements.general]/16 allocator_type)" \
" Either fix the allocator value_type or define _ENFORCE_MATCHING_ALLOCATORS=0" \
#define _MISMATCHED_ALLOCATOR_MESSAGE(_CONTAINER, _VALUE_TYPE) \
_CONTAINER " requires that Allocator's value_type match " _VALUE_TYPE " (See N4950 [container.alloc.reqmts]/5)" \
" Either fix the allocator value_type or define _ENFORCE_MATCHING_ALLOCATORS=0" \
" to suppress this error."
// Enforcement of Standard facet specializations
@ -972,7 +971,7 @@ _EMIT_STL_ERROR(STL1004, "C++98 unexpected() is incompatible with C++23 unexpect
#endif // _ENFORCE_FACET_SPECIALIZATIONS
#define _FACET_SPECIALIZATION_MESSAGE \
"Unsupported facet specialization; see N4800 27.3.1.1.1 [locale.category]. " \
"Unsupported facet specialization; see N4950 [locale.category]. " \
"Either use a Standard specialization or define _ENFORCE_FACET_SPECIALIZATIONS=0 " \
"to suppress this error."
@ -1197,7 +1196,7 @@ _EMIT_STL_ERROR(STL1004, "C++98 unexpected() is incompatible with C++23 unexpect
// P0482R6 Library Support For char8_t
// Other C++20 deprecation warnings
// N4810 D.16 [depr.locale.category]
// N4868 D.23 [depr.locale.category]
#if _HAS_CXX20 && !defined(_SILENCE_CXX20_CODECVT_FACETS_DEPRECATION_WARNING) \
&& !defined(_SILENCE_ALL_CXX20_DEPRECATION_WARNINGS)
#define _CXX20_DEPRECATE_CODECVT_FACETS \
@ -1211,7 +1210,7 @@ _EMIT_STL_ERROR(STL1004, "C++98 unexpected() is incompatible with C++23 unexpect
#define _CXX20_DEPRECATE_CODECVT_FACETS
#endif // ^^^ warning disabled ^^^
// N4810 D.17 [depr.fs.path.factory]
// N4868 D.24 [depr.fs.path.factory]
#if _HAS_CXX20 && defined(__cpp_char8_t) && !defined(_SILENCE_CXX20_U8PATH_DEPRECATION_WARNING) \
&& !defined(_SILENCE_ALL_CXX20_DEPRECATION_WARNINGS)
#define _CXX20_DEPRECATE_U8PATH \

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

@ -177,7 +177,7 @@ namespace {
return {};
}
// For vprint_unicode(), N4928 [ostream.formatted.print]/4 suggests replacing invalid code units with U+FFFD.
// For vprint_unicode(), N4950 [ostream.formatted.print]/4 suggests replacing invalid code units with U+FFFD.
// This is done automatically by MultiByteToWideChar(), so long as we do not use the MB_ERR_INVALID_CHARS flag.
// We transcode up to 8,192 bytes per segment, which easily fits in an int.
const int32_t _Num_chars_required =

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

@ -109,7 +109,7 @@ _MRTIMP2 _Success_(return >= 0) int __cdecl _Mbrtowc(
if (trailingUtf8Units > 2) { // this would result in a UTF-16 surrogate pair, which we can't emit in our
// singular output wchar_t, so fail
// see N4750 [locale.codecvt.virtuals]/3
// see N4950 [locale.codecvt.virtuals]/3
errno = EILSEQ;
return -1;
}