Skip to content

Commit 7a50720

Browse files
committed
Fix inconsistencies
1 parent 7953c57 commit 7a50720

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

stl/inc/vector

+4-3
Original file line numberDiff line numberDiff line change
@@ -1137,6 +1137,7 @@ private:
11371137
}
11381138

11391139
_Mylast = _Refancy<pointer>(_Memmove_forward(_First, _Last, _Unfancy(_Myfirst)));
1140+
return;
11401141
}
11411142
}
11421143
#endif // _HAS_IF_CONSTEXPR
@@ -1765,7 +1766,7 @@ private:
17651766
_Xout_of_range("invalid vector subscript");
17661767
}
17671768

1768-
#if _ITERATOR_DEBUG_LEVEL != 0
1769+
#if _ITERATOR_DEBUG_LEVEL == 2
17691770
#ifdef __cpp_lib_is_constant_evaluated
17701771
// orphan iterators within specified (inclusive) range
17711772
_CONSTEXPR20_DYNALLOC void _Orphan_range_unlocked(pointer _First, pointer _Last) const {
@@ -1806,9 +1807,9 @@ private:
18061807
_Orphan_range_locked(_First, _Last);
18071808
}
18081809
}
1809-
#else // ^^^ _ITERATOR_DEBUG_LEVEL != 0 ^^^ // vvv _ITERATOR_DEBUG_LEVEL == 0 vvv
1810+
#else // ^^^ _ITERATOR_DEBUG_LEVEL == 2 ^^^ // vvv _ITERATOR_DEBUG_LEVEL != 2 vvv
18101811
_CONSTEXPR20_DYNALLOC void _Orphan_range(pointer, pointer) const {}
1811-
#endif // _ITERATOR_DEBUG_LEVEL != 0
1812+
#endif // _ITERATOR_DEBUG_LEVEL != 2
18121813

18131814
_NODISCARD _CONSTEXPR20_DYNALLOC _Alty& _Getal() noexcept {
18141815
return _Mypair._Get_first();

stl/inc/xmemory

+12
Original file line numberDiff line numberDiff line change
@@ -1127,11 +1127,15 @@ public:
11271127
_CONSTEXPR20_DYNALLOC _Container_base12& operator=(const _Container_base12&) = delete;
11281128

11291129
_CONSTEXPR20_DYNALLOC void _Orphan_all() noexcept;
1130+
#ifdef __cpp_lib_is_constant_evaluated
11301131
_CONSTEXPR20_DYNALLOC void _Orphan_all_unlocked() noexcept;
1132+
#endif // __cpp_lib_is_constant_evaluated
11311133
inline void _Orphan_all_locked() noexcept;
11321134

11331135
_CONSTEXPR20_DYNALLOC void _Swap_proxy_and_iterators(_Container_base12&) noexcept;
1136+
#ifdef __cpp_lib_is_constant_evaluated
11341137
_CONSTEXPR20_DYNALLOC void _Swap_proxy_and_iterators_unlocked(_Container_base12&) noexcept;
1138+
#endif // __cpp_lib_is_constant_evaluated
11351139
inline void _Swap_proxy_and_iterators_locked(_Container_base12&) noexcept;
11361140

11371141
template <class _Alloc>
@@ -1186,6 +1190,7 @@ struct _Iterator_base12 { // store links to container proxy, next iterator
11861190
}
11871191

11881192
#if _ITERATOR_DEBUG_LEVEL == 2
1193+
#ifdef __cpp_lib_is_constant_evaluated
11891194
_CONSTEXPR20_DYNALLOC void _Adopt_unlocked(const _Container_base12* _Parent) noexcept {
11901195
_Container_proxy* _Parent_proxy = _Parent->_Myproxy;
11911196

@@ -1196,6 +1201,7 @@ struct _Iterator_base12 { // store links to container proxy, next iterator
11961201
_Myproxy = _Parent_proxy;
11971202
}
11981203
}
1204+
#endif // __cpp_lib_is_constant_evaluated
11991205

12001206
inline void _Adopt_locked(const _Container_base12* _Parent) noexcept {
12011207
_Container_proxy* _Parent_proxy = _Parent->_Myproxy;
@@ -1242,6 +1248,7 @@ struct _Iterator_base12 { // store links to container proxy, next iterator
12421248
}
12431249

12441250
#if _ITERATOR_DEBUG_LEVEL == 2
1251+
#ifdef __cpp_lib_is_constant_evaluated
12451252
_CONSTEXPR20_DYNALLOC void _Orphan_me_unlocked() noexcept {
12461253
if (_Myproxy) { // adopted, remove self from list
12471254
_Iterator_base12** _Pnext = &_Myproxy->_Myfirstiter;
@@ -1254,6 +1261,7 @@ struct _Iterator_base12 { // store links to container proxy, next iterator
12541261
_Myproxy = nullptr;
12551262
}
12561263
}
1264+
#endif // __cpp_lib_is_constant_evaluated
12571265

12581266
inline void _Orphan_me_locked() noexcept {
12591267
_Lockit _Lock(_LOCK_DEBUG);
@@ -1288,13 +1296,15 @@ struct _Iterator_base12 { // store links to container proxy, next iterator
12881296
};
12891297

12901298
// MEMBER FUNCTIONS FOR _Container_base12
1299+
#ifdef __cpp_lib_is_constant_evaluated
12911300
_CONSTEXPR20_DYNALLOC void _Container_base12::_Orphan_all_unlocked() noexcept {
12921301
for (auto _Pnext = &_Myproxy->_Myfirstiter; *_Pnext; *_Pnext = (*_Pnext)->_Mynextiter) {
12931302
(*_Pnext)->_Myproxy = nullptr;
12941303
}
12951304

12961305
_Myproxy->_Myfirstiter = nullptr;
12971306
}
1307+
#endif // __cpp_lib_is_constant_evaluated
12981308

12991309
inline void _Container_base12::_Orphan_all_locked() noexcept {
13001310
_Lockit _Lock(_LOCK_DEBUG);
@@ -1318,6 +1328,7 @@ _CONSTEXPR20_DYNALLOC void _Container_base12::_Orphan_all() noexcept {
13181328
}
13191329
}
13201330

1331+
#ifdef __cpp_lib_is_constant_evaluated
13211332
_CONSTEXPR20_DYNALLOC void _Container_base12::_Swap_proxy_and_iterators_unlocked(_Container_base12& _Right) noexcept {
13221333
_Container_proxy* _Temp = _Myproxy;
13231334
_Myproxy = _Right._Myproxy;
@@ -1331,6 +1342,7 @@ _CONSTEXPR20_DYNALLOC void _Container_base12::_Swap_proxy_and_iterators_unlocked
13311342
_Right._Myproxy->_Mycont = &_Right;
13321343
}
13331344
}
1345+
#endif // __cpp_lib_is_constant_evaluated
13341346

13351347
inline void _Container_base12::_Swap_proxy_and_iterators_locked(_Container_base12& _Right) noexcept {
13361348
_Lockit _Lock(_LOCK_DEBUG);

0 commit comments

Comments
 (0)