зеркало из https://github.com/microsoft/STL.git
Add `__cpp_lib_concepts` guard for `__cpp_lib_move_iterator_concept` (#2994)
This commit is contained in:
Родитель
1fe625d713
Коммит
b52e35bcc0
|
@ -5190,7 +5190,7 @@ _FwdIt shift_right(_ExPo&&, _FwdIt _First, _FwdIt _Last, _Iter_diff_t<_FwdIt> _P
|
|||
}
|
||||
#endif // _HAS_CXX20
|
||||
|
||||
#if _HAS_CXX23 && defined(__cpp_lib_concepts)
|
||||
#if _HAS_CXX23 && defined(__cpp_lib_concepts) // TRANSITION, GH-395
|
||||
namespace ranges {
|
||||
class _Shift_left_fn : private _Not_quite_object {
|
||||
public:
|
||||
|
|
|
@ -4114,7 +4114,7 @@ public:
|
|||
};
|
||||
#endif // _HAS_CXX20
|
||||
|
||||
#if _HAS_CXX23 && defined(__cpp_lib_concepts)
|
||||
#if _HAS_CXX23 && defined(__cpp_lib_concepts) // TRANSITION, GH-395
|
||||
template <class _Ty>
|
||||
struct _Pointer_of_helper {};
|
||||
|
||||
|
|
|
@ -523,7 +523,7 @@ _CONSTEXPR20 void iota(_FwdIt _First, _FwdIt _Last, _Ty _Val) {
|
|||
}
|
||||
}
|
||||
|
||||
#if _HAS_CXX23 && defined(__cpp_lib_concepts)
|
||||
#if _HAS_CXX23 && defined(__cpp_lib_concepts) // TRANSITION, GH-395
|
||||
namespace ranges {
|
||||
template <class _Out, class _Ty>
|
||||
using iota_result = out_value_result<_Out, _Ty>;
|
||||
|
|
|
@ -861,7 +861,7 @@ _INLINE_VAR constexpr bool _Is_cpp17_random_iter_v = is_convertible_v<_Iter_cat_
|
|||
|
||||
template <class _Iter>
|
||||
_INLINE_VAR constexpr bool _Is_ranges_random_iter_v =
|
||||
#if defined(__cpp_lib_concepts)
|
||||
#ifdef __cpp_lib_concepts
|
||||
random_access_iterator<_Iter> ||
|
||||
#endif
|
||||
_Is_cpp17_random_iter_v<_Iter>;
|
||||
|
|
|
@ -1386,13 +1386,13 @@ _EMIT_STL_ERROR(STL1004, "C++98 unexpected() is incompatible with C++23 unexpect
|
|||
#endif // __cpp_impl_coroutine
|
||||
|
||||
#if _HAS_CXX20
|
||||
#if !defined(__EDG__) || defined(__INTELLISENSE__) // TRANSITION, EDG concepts support
|
||||
#if !defined(__EDG__) || defined(__INTELLISENSE__) // TRANSITION, GH-395
|
||||
#define __cpp_lib_concepts 202002L
|
||||
#endif // !defined(__EDG__) || defined(__INTELLISENSE__)
|
||||
|
||||
#if defined(__cpp_lib_concepts)
|
||||
#ifdef __cpp_lib_concepts // TRANSITION, GH-395
|
||||
#define __cpp_lib_algorithm_iterator_requirements 202207L
|
||||
#endif
|
||||
#endif // __cpp_lib_concepts
|
||||
|
||||
#define __cpp_lib_assume_aligned 201811L
|
||||
#define __cpp_lib_atomic_flag_test 201907L
|
||||
|
@ -1422,9 +1422,9 @@ _EMIT_STL_ERROR(STL1004, "C++98 unexpected() is incompatible with C++23 unexpect
|
|||
#define __cpp_lib_endian 201907L
|
||||
#define __cpp_lib_erase_if 202002L
|
||||
|
||||
#if defined(__cpp_lib_concepts) // TRANSITION, GH-395
|
||||
#ifdef __cpp_lib_concepts // TRANSITION, GH-395
|
||||
#define __cpp_lib_format 202110L
|
||||
#endif // defined(__cpp_lib_concepts)
|
||||
#endif // __cpp_lib_concepts
|
||||
|
||||
#define __cpp_lib_generic_unordered_lookup 201811L
|
||||
#define __cpp_lib_int_pow2 202002L
|
||||
|
@ -1450,12 +1450,16 @@ _EMIT_STL_ERROR(STL1004, "C++98 unexpected() is incompatible with C++23 unexpect
|
|||
#define __cpp_lib_latch 201907L
|
||||
#define __cpp_lib_list_remove_return_type 201806L
|
||||
#define __cpp_lib_math_constants 201907L
|
||||
#define __cpp_lib_move_iterator_concept 202207L
|
||||
#define __cpp_lib_polymorphic_allocator 201902L
|
||||
|
||||
#if defined(__cpp_lib_concepts) // TRANSITION, GH-395
|
||||
#ifdef __cpp_lib_concepts // TRANSITION, GH-395
|
||||
#define __cpp_lib_move_iterator_concept 202207L
|
||||
#endif // __cpp_lib_concepts
|
||||
|
||||
#define __cpp_lib_polymorphic_allocator 201902L
|
||||
|
||||
#ifdef __cpp_lib_concepts // TRANSITION, GH-395
|
||||
#define __cpp_lib_ranges 202110L
|
||||
#endif // defined(__cpp_lib_concepts)
|
||||
#endif // __cpp_lib_concepts
|
||||
|
||||
#define __cpp_lib_remove_cvref 201711L
|
||||
#define __cpp_lib_semaphore 201907L
|
||||
|
@ -1551,7 +1555,7 @@ _EMIT_STL_ERROR(STL1004, "C++98 unexpected() is incompatible with C++23 unexpect
|
|||
#endif // language mode
|
||||
#endif // _M_CEE
|
||||
|
||||
#if _HAS_CXX23 && defined(__cpp_lib_concepts)
|
||||
#if _HAS_CXX23 && defined(__cpp_lib_concepts) // TRANSITION, GH-395
|
||||
#define __cpp_lib_optional 202110L // P0798R8 Monadic Operations For optional
|
||||
#elif _HAS_CXX20 // ^^^ _HAS_CXX23 / _HAS_CXX20 vvv
|
||||
#define __cpp_lib_optional 202106L // P2231R1 Completing constexpr In optional And variant
|
||||
|
@ -1565,7 +1569,7 @@ _EMIT_STL_ERROR(STL1004, "C++98 unexpected() is incompatible with C++23 unexpect
|
|||
#define __cpp_lib_shared_ptr_arrays 201611L // P0497R0 Fixing shared_ptr For Arrays
|
||||
#endif // _HAS_CXX20
|
||||
|
||||
#if _HAS_CXX23 && defined(__cpp_lib_concepts)
|
||||
#if _HAS_CXX23 && defined(__cpp_lib_concepts) // TRANSITION, GH-395
|
||||
#define __cpp_lib_shift 202202L // P2440R1 ranges::shift_left, ranges::shift_right
|
||||
#elif _HAS_CXX20 // ^^^ _HAS_CXX23 / _HAS_CXX20 vvv
|
||||
#define __cpp_lib_shift 201806L // P0769R2 shift_left(), shift_right()
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
// Copyright (c) Microsoft Corporation.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
|
||||
#include <version> // TRANSITION, EDG support for concepts
|
||||
#ifdef __cpp_lib_concepts // TRANSITION, EDG support for concepts
|
||||
#include <version> // TRANSITION, GH-395
|
||||
#ifdef __cpp_lib_concepts // TRANSITION, GH-395
|
||||
|
||||
#include <ranges>
|
||||
|
||||
|
@ -10,6 +10,6 @@
|
|||
|
||||
static_assert(std::is_eq(std::partial_ordering::equivalent));
|
||||
|
||||
#endif // TRANSITION, EDG support for concepts
|
||||
#endif // TRANSITION, GH-395
|
||||
|
||||
void test_ranges() {}
|
||||
|
|
|
@ -343,7 +343,7 @@ constexpr bool test_case_contiguous_constructor() {
|
|||
}
|
||||
|
||||
constexpr bool test_case_range_constructor() {
|
||||
#if _HAS_CXX23 && defined(__cpp_lib_concepts)
|
||||
#if _HAS_CXX23 && defined(__cpp_lib_concepts) // TRANSITION, GH-395
|
||||
const array expectedData{'n', 'o', ' ', 'n', 'u', 'l', 'l'};
|
||||
// Also tests the corresponding deduction guide:
|
||||
same_as<string_view> auto sv = basic_string_view(expectedData);
|
||||
|
|
|
@ -165,10 +165,9 @@ struct string_view_convertible {
|
|||
}
|
||||
};
|
||||
|
||||
// TRANSITION, EDG concepts support
|
||||
template <class Range1, class Range2>
|
||||
constexpr bool equalRanges(const Range1& range1, const Range2& range2) noexcept {
|
||||
#ifdef __cpp_lib_concepts
|
||||
#ifdef __cpp_lib_concepts // TRANSITION, GH-395 (equalRanges should be replaced by direct calls to ranges::equal)
|
||||
return ranges::equal(range1, range2);
|
||||
#else // ^^^ __cpp_lib_concepts ^^^ / vvv !__cpp_lib_concepts vvv
|
||||
return equal(begin(range1), end(range1), begin(range2), end(range2));
|
||||
|
|
|
@ -30,7 +30,7 @@ STATIC_ASSERT(__cpp_lib_adaptor_iterator_pair_constructor == 202106L);
|
|||
STATIC_ASSERT(__cpp_lib_addressof_constexpr == 201603L);
|
||||
#endif
|
||||
|
||||
#if _HAS_CXX20 && !defined(__EDG__) // TRANSITION, EDG concepts support
|
||||
#if _HAS_CXX20 && defined(__cpp_lib_concepts) // TRANSITION, GH-395
|
||||
#ifndef __cpp_lib_algorithm_iterator_requirements
|
||||
#error __cpp_lib_algorithm_iterator_requirements is not defined
|
||||
#elif __cpp_lib_algorithm_iterator_requirements != 202207L
|
||||
|
@ -44,7 +44,7 @@ STATIC_ASSERT(__cpp_lib_algorithm_iterator_requirements == 202207L);
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#if _HAS_CXX23 && !defined(__EDG__) // TRANSITION, EDG concepts support
|
||||
#if _HAS_CXX23 && defined(__cpp_lib_concepts) // TRANSITION, GH-395
|
||||
#ifndef __cpp_lib_allocate_at_least
|
||||
#error __cpp_lib_allocate_at_least is not defined
|
||||
#elif __cpp_lib_allocate_at_least != 202106L
|
||||
|
@ -444,7 +444,7 @@ STATIC_ASSERT(__cpp_lib_clamp == 201603L);
|
|||
STATIC_ASSERT(__cpp_lib_complex_udls == 201309L);
|
||||
#endif
|
||||
|
||||
#if _HAS_CXX20 && !defined(__EDG__) // TRANSITION, EDG concepts support
|
||||
#if _HAS_CXX20 && !defined(__EDG__) // TRANSITION, GH-395
|
||||
#ifndef __cpp_lib_concepts
|
||||
#error __cpp_lib_concepts is not defined
|
||||
#elif __cpp_lib_concepts != 202002L
|
||||
|
@ -756,7 +756,7 @@ STATIC_ASSERT(__cpp_lib_execution == 201603L);
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#if _HAS_CXX23 && !defined(__EDG__) // TRANSITION, EDG concepts support
|
||||
#if _HAS_CXX23 && defined(__cpp_lib_concepts) // TRANSITION, GH-395
|
||||
#ifndef __cpp_lib_expected
|
||||
#error __cpp_lib_expected is not defined
|
||||
#elif __cpp_lib_expected != 202202L
|
||||
|
@ -800,7 +800,7 @@ STATIC_ASSERT(__cpp_lib_filesystem == 201703L);
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#if _HAS_CXX20 && !defined(__EDG__) // TRANSITION, EDG concepts support
|
||||
#if _HAS_CXX20 && defined(__cpp_lib_concepts) // TRANSITION, GH-395
|
||||
#ifndef __cpp_lib_format
|
||||
#error __cpp_lib_format is not defined
|
||||
#elif __cpp_lib_format != 202110L
|
||||
|
@ -1274,7 +1274,7 @@ STATIC_ASSERT(__cpp_lib_memory_resource == 201603L);
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#if _HAS_CXX20
|
||||
#if _HAS_CXX20 && defined(__cpp_lib_concepts) // TRANSITION, GH-395
|
||||
#ifndef __cpp_lib_move_iterator_concept
|
||||
#error __cpp_lib_move_iterator_concept is not defined
|
||||
#elif __cpp_lib_move_iterator_concept != 202207L
|
||||
|
@ -1346,7 +1346,7 @@ STATIC_ASSERT(__cpp_lib_not_fn == 201603L);
|
|||
STATIC_ASSERT(__cpp_lib_null_iterators == 201304L);
|
||||
#endif
|
||||
|
||||
#if _HAS_CXX23 && !defined(__EDG__) // TRANSITION, EDG concepts support
|
||||
#if _HAS_CXX23 && defined(__cpp_lib_concepts) // TRANSITION, GH-395
|
||||
#ifndef __cpp_lib_optional
|
||||
#error __cpp_lib_optional is not defined
|
||||
#elif __cpp_lib_optional != 202110L
|
||||
|
@ -1376,7 +1376,7 @@ STATIC_ASSERT(__cpp_lib_optional == 201606L);
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#if _HAS_CXX23 && !defined(__EDG__) // TRANSITION, EDG concepts support
|
||||
#if _HAS_CXX23 && defined(__cpp_lib_concepts) // TRANSITION, GH-395
|
||||
#ifndef __cpp_lib_out_ptr
|
||||
#error __cpp_lib_out_ptr is not defined
|
||||
#elif __cpp_lib_out_ptr != 202106L
|
||||
|
@ -1426,7 +1426,7 @@ STATIC_ASSERT(__cpp_lib_polymorphic_allocator == 201902L);
|
|||
STATIC_ASSERT(__cpp_lib_quoted_string_io == 201304L);
|
||||
#endif
|
||||
|
||||
#if _HAS_CXX20 && !defined(__EDG__) // TRANSITION, EDG concepts support
|
||||
#if _HAS_CXX20 && defined(__cpp_lib_concepts) // TRANSITION, GH-395
|
||||
#ifndef __cpp_lib_ranges
|
||||
#error __cpp_lib_ranges is not defined
|
||||
#elif __cpp_lib_ranges != 202110L
|
||||
|
@ -1440,7 +1440,7 @@ STATIC_ASSERT(__cpp_lib_ranges == 202110L);
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#if _HAS_CXX23 && !defined(__EDG__) // TRANSITION, EDG concepts support
|
||||
#if _HAS_CXX23 && defined(__cpp_lib_concepts) // TRANSITION, GH-395
|
||||
#ifndef __cpp_lib_ranges_chunk
|
||||
#error __cpp_lib_ranges_chunk is not defined
|
||||
#elif __cpp_lib_ranges_chunk != 202202L
|
||||
|
@ -1454,7 +1454,7 @@ STATIC_ASSERT(__cpp_lib_ranges_chunk == 202202L);
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#if _HAS_CXX23 && !defined(__EDG__) // TRANSITION, EDG concepts support
|
||||
#if _HAS_CXX23 && defined(__cpp_lib_concepts) // TRANSITION, GH-395
|
||||
#ifndef __cpp_lib_ranges_chunk_by
|
||||
#error __cpp_lib_ranges_chunk_by is not defined
|
||||
#elif __cpp_lib_ranges_chunk_by != 202202L
|
||||
|
@ -1468,7 +1468,7 @@ STATIC_ASSERT(__cpp_lib_ranges_chunk_by == 202202L);
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#if _HAS_CXX23 && !defined(__EDG__) // TRANSITION, EDG concepts support
|
||||
#if _HAS_CXX23 && defined(__cpp_lib_concepts) // TRANSITION, GH-395
|
||||
#ifndef __cpp_lib_ranges_contains
|
||||
#error __cpp_lib_ranges_contains is not defined
|
||||
#elif __cpp_lib_ranges_contains != 202207L
|
||||
|
@ -1482,7 +1482,7 @@ STATIC_ASSERT(__cpp_lib_ranges_contains == 202207L);
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#if _HAS_CXX23 && defined(__cpp_lib_concepts)
|
||||
#if _HAS_CXX23 && defined(__cpp_lib_concepts) // TRANSITION, GH-395
|
||||
#ifndef __cpp_lib_ranges_iota
|
||||
#error __cpp_lib_ranges_iota is not defined
|
||||
#elif __cpp_lib_ranges_iota != 202202L
|
||||
|
@ -1496,7 +1496,7 @@ STATIC_ASSERT(__cpp_lib_ranges_iota == 202202L);
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#if _HAS_CXX23 && !defined(__EDG__) // TRANSITION, EDG concepts support
|
||||
#if _HAS_CXX23 && defined(__cpp_lib_concepts) // TRANSITION, GH-395
|
||||
#ifndef __cpp_lib_ranges_join_with
|
||||
#error __cpp_lib_ranges_join_with is not defined
|
||||
#elif __cpp_lib_ranges_join_with != 202202L
|
||||
|
@ -1510,7 +1510,7 @@ STATIC_ASSERT(__cpp_lib_ranges_join_with == 202202L);
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#if _HAS_CXX23 && !defined(__EDG__) // TRANSITION, EDG concepts support
|
||||
#if _HAS_CXX23 && defined(__cpp_lib_concepts) // TRANSITION, GH-395
|
||||
#ifndef __cpp_lib_ranges_slide
|
||||
#error __cpp_lib_ranges_slide is not defined
|
||||
#elif __cpp_lib_ranges_slide != 202202L
|
||||
|
@ -1524,7 +1524,7 @@ STATIC_ASSERT(__cpp_lib_ranges_slide == 202202L);
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#if _HAS_CXX23 && !defined(__EDG__) // TRANSITION, EDG concepts support
|
||||
#if _HAS_CXX23 && defined(__cpp_lib_concepts) // TRANSITION, GH-395
|
||||
#ifndef __cpp_lib_ranges_starts_ends_with
|
||||
#error __cpp_lib_ranges_starts_ends_with is not defined
|
||||
#elif __cpp_lib_ranges_starts_ends_with != 202106L
|
||||
|
@ -1676,7 +1676,7 @@ STATIC_ASSERT(__cpp_lib_shared_timed_mutex == 201402L);
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#if _HAS_CXX23 && defined(__cpp_lib_concepts)
|
||||
#if _HAS_CXX23 && defined(__cpp_lib_concepts) // TRANSITION, GH-395
|
||||
#ifndef __cpp_lib_shift
|
||||
#error __cpp_lib_shift is not defined
|
||||
#elif __cpp_lib_shift != 202202L
|
||||
|
|
Загрузка…
Ссылка в новой задаче