#pragma once
#ifndef _VECTOR_
#define _VECTOR_
#ifndef RC_INVOKED
#include <xmemory>
#include <stdexcept>
#if _HAS_CXX17
#include <xpolymorphic_allocator.h>
#endif /* _HAS_CXX17 */
#pragma pack(push,_CRT_PACKING)
#pragma warning(push,_STL_WARNING_LEVEL)
#pragma warning(disable: _STL_DISABLED_WARNINGS)
#pragma warning(disable:
4455
4494
4619
4643
4702
4984
4988
)
_STL_DISABLE_CLANG_WARNINGS
#pragma push_macro("new")
#undef new
template
<
class
>
class
:
public
{
public
:
using
=
random_access_iterator_tag
;
using
=
typename
::value_type;
using
=
typename
::difference_type;
using
=
typename
::const_pointer;
using
=
const
&;
using
=
typename
::pointer;
()
: _Ptr()
{
}
(
,
const
*
)
: _Ptr(
)
{
this
->
(
);
}
_NODISCARD reference operator*() const
{
#if _ITERATOR_DEBUG_LEVEL != 0
const
auto
=
static_cast
<
const
*>(
this
->
());
_STL_VERIFY(_Ptr, "can't dereference value-initialized vector iterator");
do
{
if
(
) { }
else
{
do
{ (
void
) ((
1
(
2
,
"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\vector"
,
50
,
0
,
"%s"
,
"can't dereference value-initialized vector iterator"
)) || (__debugbreak(),
0
)); ::
(
L"\"can't dereference value-initialized vector iterator\""
, __LPREFIX( __FUNCTION__),
L"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\vector"
,
50
,
0
); }
while
(
false
); } ; }
while
(
false
);
_STL_VERIFY(_Mycont->_Myfirst <= _Ptr && _Ptr < _Mycont->_Mylast,
"can't dereference out of range vector iterator");
#endif /* _ITERATOR_DEBUG_LEVEL != 0 */
do
{
if
(
_Mycont
->_Myfirst <=
&&
<
_Mycont
->_Mylast) { }
else
{
do
{ (
void
) ((
1
(
2
,
"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\vector"
,
52
,
0
,
"%s"
,
"can't dereference out of range vector iterator"
)) || (__debugbreak(),
0
)); ::
(
L"\"can't dereference out of range vector iterator\""
, __LPREFIX( __FUNCTION__),
L"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\vector"
,
52
,
0
); }
while
(
false
); } ; }
while
(
false
);
return
(*
);
}
_NODISCARD pointer operator->() const
{
#if _ITERATOR_DEBUG_LEVEL != 0
const
auto
=
static_cast
<
const
*>(
this
->
());
_STL_VERIFY(_Ptr, "can't dereference value-initialized vector iterator");
do
{
if
(
) { }
else
{
do
{ (
void
) ((
1
(
2
,
"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\vector"
,
62
,
0
,
"%s"
,
"can't dereference value-initialized vector iterator"
)) || (__debugbreak(),
0
)); ::
(
L"\"can't dereference value-initialized vector iterator\""
, __LPREFIX( __FUNCTION__),
L"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\vector"
,
62
,
0
); }
while
(
false
); } ; }
while
(
false
);
_STL_VERIFY(_Mycont->_Myfirst <= _Ptr && _Ptr < _Mycont->_Mylast,
"can't dereference out of range vector iterator");
#endif /* _ITERATOR_DEBUG_LEVEL != 0 */
do
{
if
(
_Mycont
->_Myfirst <=
&&
<
_Mycont
->_Mylast) { }
else
{
do
{ (
void
) ((
1
(
2
,
"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\vector"
,
64
,
0
,
"%s"
,
"can't dereference out of range vector iterator"
)) || (__debugbreak(),
0
)); ::
(
L"\"can't dereference out of range vector iterator\""
, __LPREFIX( __FUNCTION__),
L"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\vector"
,
64
,
0
); }
while
(
false
); } ; }
while
(
false
);
return
(
);
}
&
()
{
#if _ITERATOR_DEBUG_LEVEL != 0
const
auto
=
static_cast
<
const
*>(
this
->
());
_STL_VERIFY(_Ptr, "can't increment value-initialized vector iterator");
do
{
if
(
) { }
else
{
do
{ (
void
) ((
1
(
2
,
"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\vector"
,
74
,
0
,
"%s"
,
"can't increment value-initialized vector iterator"
)) || (__debugbreak(),
0
)); ::
(
L"\"can't increment value-initialized vector iterator\""
, __LPREFIX( __FUNCTION__),
L"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\vector"
,
74
,
0
); }
while
(
false
); } ; }
while
(
false
);
_STL_VERIFY(_Ptr < _Mycont->_Mylast, "can't increment vector iterator past end");
#endif /* _ITERATOR_DEBUG_LEVEL != 0 */
do
{
if
(
<
_Mycont
->_Mylast) { }
else
{
do
{ (
void
) ((
1
(
2
,
"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\vector"
,
75
,
0
,
"%s"
,
"can't increment vector iterator past end"
)) || (__debugbreak(),
0
)); ::
(
L"\"can't increment vector iterator past end\""
, __LPREFIX( __FUNCTION__),
L"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\vector"
,
75
,
0
); }
while
(
false
); } ; }
while
(
false
);
++
;
return
(*
this
);
}
(
int
)
{
= *
this
;
*
this
;
return
(
_Tmp
);
}
&
()
{
#if _ITERATOR_DEBUG_LEVEL != 0
const
auto
=
static_cast
<
const
*>(
this
->
());
_STL_VERIFY(_Ptr, "can't decrement value-initialized vector iterator");
do
{
if
(
) { }
else
{
do
{ (
void
) ((
1
(
2
,
"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\vector"
,
93
,
0
,
"%s"
,
"can't decrement value-initialized vector iterator"
)) || (__debugbreak(),
0
)); ::
(
L"\"can't decrement value-initialized vector iterator\""
, __LPREFIX( __FUNCTION__),
L"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\vector"
,
93
,
0
); }
while
(
false
); } ; }
while
(
false
);
_STL_VERIFY(_Mycont->_Myfirst < _Ptr, "can't decrement vector iterator before begin");
#endif /* _ITERATOR_DEBUG_LEVEL != 0 */
do
{
if
(
_Mycont
->_Myfirst <
) { }
else
{
do
{ (
void
) ((
1
(
2
,
"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\vector"
,
94
,
0
,
"%s"
,
"can't decrement vector iterator before begin"
)) || (__debugbreak(),
0
)); ::
(
L"\"can't decrement vector iterator before begin\""
, __LPREFIX( __FUNCTION__),
L"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\vector"
,
94
,
0
); }
while
(
false
); } ; }
while
(
false
);
--
;
return
(*
this
);
}
(
int
)
{
= *
this
;
*
this
;
return
(
_Tmp
);
}
void
(
const
)
const
{
#if _ITERATOR_DEBUG_LEVEL == 0
(void)_Off;
#else /* ^^^ _ITERATOR_DEBUG_LEVEL == 0 ^^^ // vvv _ITERATOR_DEBUG_LEVEL != 0 vvv */
const
auto
=
static_cast
<
const
*>(
this
->
());
_STL_VERIFY(_Off == 0 || _Ptr, "cannot seek value-initialized vector iterator");
do
{
if
(
==
0
||
) { }
else
{
do
{ (
void
) ((
1
(
2
,
"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\vector"
,
114
,
0
,
"%s"
,
"cannot seek value-initialized vector iterator"
)) || (__debugbreak(),
0
)); ::
(
L"\"cannot seek value-initialized vector iterator\""
, __LPREFIX( __FUNCTION__),
L"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\vector"
,
114
,
0
); }
while
(
false
); } ; }
while
(
false
);
if
(
<
0
)
{
_STL_VERIFY(_Off >= _Mycont->_Myfirst - _Ptr, "cannot seek vector iterator before begin");
do
{
if
(
>=
_Mycont
->_Myfirst -
) { }
else
{
do
{ (
void
) ((
1
(
2
,
"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\vector"
,
117
,
0
,
"%s"
,
"cannot seek vector iterator before begin"
)) || (__debugbreak(),
0
)); ::
(
L"\"cannot seek vector iterator before begin\""
, __LPREFIX( __FUNCTION__),
L"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\vector"
,
117
,
0
); }
while
(
false
); } ; }
while
(
false
);
}
if
(
>
0
)
{
_STL_VERIFY(_Off <= _Mycont->_Mylast - _Ptr, "cannot seek vector iterator after end");
do
{
if
(
<=
_Mycont
->_Mylast -
) { }
else
{
do
{ (
void
) ((
1
(
2
,
"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\vector"
,
122
,
0
,
"%s"
,
"cannot seek vector iterator after end"
)) || (__debugbreak(),
0
)); ::
(
L"\"cannot seek vector iterator after end\""
, __LPREFIX( __FUNCTION__),
L"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\vector"
,
122
,
0
); }
while
(
false
); } ; }
while
(
false
);
}
#endif /* _ITERATOR_DEBUG_LEVEL == 0 */
}
&
(
const
)
{
(
);
+=
;
return
(*
this
);
}
_NODISCARD _Vector_const_iterator operator+(const difference_type _Off) const
{
= *
this
;
return
(
_Tmp
+=
);
}
&
(
const
)
{
return
(*
this
+= -
);
}
_NODISCARD _Vector_const_iterator operator-(const difference_type _Off) const
{
= *
this
;
return
(
_Tmp
-=
);
}
_NODISCARD difference_type operator-(const _Vector_const_iterator& _Right) const
{
(
);
return
(
-
.
);
}
_NODISCARD reference operator[](const difference_type _Off) const
{
return
(*(*
this
+
));
}
_NODISCARD bool operator==(const _Vector_const_iterator& _Right) const
{
(
);
return
(
==
.
);
}
_NODISCARD bool operator!=(const _Vector_const_iterator& _Right) const
{
return
(!(*
this
));
}
_NODISCARD bool operator<(const _Vector_const_iterator& _Right) const
{
(
);
return
(
<
.
);
}
_NODISCARD bool operator>(const _Vector_const_iterator& _Right) const
{
return
(
*
this
);
}
_NODISCARD bool operator<=(const _Vector_const_iterator& _Right) const
{
return
(!(
*
this
));
}
_NODISCARD bool operator>=(const _Vector_const_iterator& _Right) const
{
return
(!(*
this
));
}
void
(
const
&
)
const
{
#if _ITERATOR_DEBUG_LEVEL == 0
(void)_Right;
#else /* ^^^ _ITERATOR_DEBUG_LEVEL == 0 ^^^ // vvv _ITERATOR_DEBUG_LEVEL != 0 vvv */
_STL_VERIFY(this->_Getcont() == _Right._Getcont(), "vector iterators incompatible");
#endif /* _ITERATOR_DEBUG_LEVEL == 0 */
do
{
if
(
this
->
()
.
()) { }
else
{
do
{ (
void
) ((
1
(
2
,
"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\vector"
,
199
,
0
,
"%s"
,
"vector iterators incompatible"
)) || (__debugbreak(),
0
)); ::
(
L"\"vector iterators incompatible\""
, __LPREFIX( __FUNCTION__),
L"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\vector"
,
199
,
0
); }
while
(
false
); } ; }
while
(
false
);
}
#if _ITERATOR_DEBUG_LEVEL != 0
friend
void
(
const
&
,
const
&
)
{
_STL_VERIFY(_First._Getcont() == _Last._Getcont(),
"vector iterators in range are from different containers");
do
{
if
(
.
()
.
()) { }
else
{
do
{ (
void
) ((
1
(
2
,
"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\vector"
,
207
,
0
,
"%s"
,
"vector iterators in range are from different containers"
)) || (__debugbreak(),
0
)); ::
(
L"\"vector iterators in range are from different containers\""
, __LPREFIX( __FUNCTION__),
L"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\vector"
,
207
,
0
); }
while
(
false
); } ; }
while
(
false
);
_STL_VERIFY(_First._Ptr <= _Last._Ptr, "vector iterator range transposed");
do
{
if
(
.
<=
.
) { }
else
{
do
{ (
void
) ((
1
(
2
,
"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\vector"
,
208
,
0
,
"%s"
,
"vector iterator range transposed"
)) || (__debugbreak(),
0
)); ::
(
L"\"vector iterator range transposed\""
, __LPREFIX( __FUNCTION__),
L"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\vector"
,
208
,
0
); }
while
(
false
); } ; }
while
(
false
);
}
#endif /* _ITERATOR_DEBUG_LEVEL != 0 */
_NODISCARD pointer _Unwrapped() const
{
return
(
);
}
void
(
)
{
=
(
);
}
;
};
template
<
class
>
_NODISCARD inline _Vector_const_iterator<_Myvec> operator+(
typename
<
>::
,
<
>
)
{
return
(
+=
);
}
template
<
class
>
class
:
public
<
>
{
public
:
using
=
<
>;
using
=
random_access_iterator_tag
;
using
=
typename
::value_type;
using
=
typename
::difference_type;
using
=
typename
::pointer;
using
=
&;
()
{
}
(
,
const
*
)
:
(
,
)
{
}
_NODISCARD reference operator*() const
{
return
(
const_cast
<
>(
::
)));
}
_NODISCARD pointer operator->() const
{
return
(
(
::
)));
}
&
()
{
*(
*)
this
;
return
(*
this
);
}
(
int
)
{
= *
this
;
*
this
;
return
(
_Tmp
);
}
&
()
{
*(
*)
this
;
return
(*
this
);
}
(
int
)
{
= *
this
;
*
this
;
return
(
_Tmp
);
}
&
(
const
)
{
*(
*)
this
+=
;
return
(*
this
);
}
_NODISCARD _Vector_iterator operator+(const difference_type _Off) const
{
= *
this
;
return
(
_Tmp
+=
);
}
&
(
const
)
{
return
(*
this
+= -
);
}
_NODISCARD _Vector_iterator operator-(const difference_type _Off) const
{
= *
this
;
return
(
_Tmp
-=
);
}
_NODISCARD difference_type operator-(const _Mybase& _Right) const
{
return
(*(
*)
this
);
}
_NODISCARD reference operator[](const difference_type _Off) const
{
return
(*(*
this
+
));
}
_NODISCARD pointer _Unwrapped() const
{
return
(
this
->
);
}
};
template
<
class
>
_NODISCARD inline _Vector_iterator<_Myvec> operator+(
typename
<
>::
,
<
>
)
{
return
(
+=
);
}
template
<
class
,
class
,
class
,
class
,
class
,
class
,
class
>
struct
{
using
=
;
using
=
;
using
=
;
using
=
;
using
=
;
};
template
<
class
,
class
>
struct
{
using
=
<
,
>;
using
=
<
>;
using
=
<
<
>,
<
>,
<
,
typename
::
,
typename
::
,
typename
::
,
typename
::
,
&,
const
&>>;
};
template
<
class
>
class
:
public
{
public
:
using
=
typename
::value_type;
using
=
typename
::size_type;
using
=
typename
::difference_type;
using
=
typename
::pointer;
using
=
typename
::const_pointer;
using
=
&;
using
=
const
&;
()
: _Myfirst(),
_Mylast(),
_Myend()
{
}
;
;
;
};
template
<
class
>
class
{
public
:
using
=
typename
::_Alty;
using
=
typename
::_Alty_traits;
using
=
<
,
>;
using
=
<
>;
using
=
typename
::_Val_types;
using
=
typename
::size_type;
using
=
typename
::difference_type;
using
=
typename
::pointer;
using
=
typename
::const_pointer;
using
=
<
<
>>;
using
=
<
<
>>;
#if _ITERATOR_DEBUG_LEVEL == 0
_Vector_alloc()
: _Mypair(_Zero_then_variadic_args_t())
{ // default construct allocator
}
template<class _Any_alloc,
class = enable_if_t<!is_same_v<remove_cv_t<remove_reference_t<_Any_alloc>>, _Vector_alloc>>>
_Vector_alloc(_Any_alloc&& _Al)
: _Mypair(_One_then_variadic_args_t(),
_STD forward<_Any_alloc>(_Al))
{ // construct allocator from _Al
}
void _Copy_alloc(const _Alty& _Al)
{ // replace old allocator
_Pocca(_Getal(), _Al);
}
void _Move_alloc(_Alty& _Al)
{ // replace old allocator
_Pocma(_Getal(), _Al);
}
#else /* ^^^ _ITERATOR_DEBUG_LEVEL == 0 ^^^ // vvv _ITERATOR_DEBUG_LEVEL != 0 vvv */
()
: _Mypair(
_Zero_then_variadic_args_t
())
{
();
}
template
<
class
,
class
=
<!
<
<
<
>>,
>>>
(
&&
)
: _Mypair(
_One_then_variadic_args_t
(),
_STD forward<_Any_alloc>(_Al))
{
();
}
()
noexcept
{
();
}
void
(
const
&
)
{
const
bool
=
::propagate_on_container_copy_assignment::value
&&
() !=
;
if
(
_Reload
)
{
();
}
(
(),
);
if
(
_Reload
)
{
();
}
}
void
(
&
)
{
const
bool
=
::propagate_on_container_move_assignment::value
&&
() !=
;
if
(
_Reload
)
{
();
}
(
(),
);
if
(
_Reload
)
{
();
}
}
void
()
{
(
());
() =
(
_Proxy_allocator
.
(
1
));
::
(
_Proxy_allocator
,
(),
());
_Myproxy()->_Mycont = _STD addressof(_Get_data());
}
void
()
{
(
());
();
::
(
_Proxy_allocator
,
());
(
_Proxy_allocator
,
());
() =
nullptr
;
}
**
()
const
{
return
(
().
());
}
* &
()
noexcept
{
return
(
().
);
}
*
const
&
()
const
noexcept
{
return
(
().
);
}
#endif /* _ITERATOR_DEBUG_LEVEL == 0 */
void
()
{
().
();
}
void
(
&
)
{
().
(
.
());
}
&
()
noexcept
{
return
(
.
());
}
const
&
()
const
noexcept
{
return
(
.
());
}
<
>&
()
noexcept
{
return
(
.
());
}
const
<
>&
()
const
noexcept
{
return
(
.
());
}
(
const
)
noexcept
{
return (iterator(_Ptr, _STD addressof(_Mypair._Get_second())));
return
(
(
, ::
std
::
(
.
())));
}
(
const
)
noexcept
{
auto
&
=
.
();
return (iterator(_My_data._Myfirst + _Offset, _STD addressof(_My_data)));
return
(
(
_My_data
.
+
, ::
std
::
(
_My_data
)));
}
&
()
noexcept
{
return
(
().
);
}
const
&
()
const
noexcept
{
return
(
().
);
}
&
()
noexcept
{
return
(
().
);
}
const
&
()
const
noexcept
{
return
(
().
);
}
&
()
noexcept
{
return
(
().
);
}
const
&
()
const
noexcept
{
return
(
().
);
}
private
:
<
,
<
>>
;
};
template
<
class
>
inline
auto
(
)
{
return (_Ptr ? _STD addressof(*_Ptr) : nullptr);
return
(
? ::
std
::
(*
) :
nullptr
);
}
template
<
class
>
inline
*
(
*
)
{
return
(
);
}
template
<
class
,
class
=
<
>>
class
:
public
<
<
,
>>
{
private
:
using
=
<
<
,
>>;
using
=
typename
::
;
using
=
typename
::
;
public
:
static_assert(!_ENFORCE_MATCHING_ALLOCATORS || is_same_v<_Ty, typename _Alloc::value_type>,
static_assert
(!
0
||
<
,
typename
::value_type>,
_MISMATCHED_ALLOCATOR_MESSAGE("vector<T, Allocator>", "T"));
"vector<T, Allocator>"
" requires that Allocator's value_type match "
"T"
" (See N4659 26.2.1 [container.requirements.general]/16 allocator_type)"
" Either fix the allocator value_type or define _ENFORCE_MATCHING_ALLOCATORS=0"
" to suppress this diagnostic."
);
using
=
;
using
=
;
using
=
typename
::
;
using
=
typename
::
;
using
=
&;
using
=
const
&;
using
=
typename
::
;
using
=
typename
::
;
using
=
typename
::
;
using
=
typename
::
;
using reverse_iterator = _STD reverse_iterator<iterator>;
using const_reverse_iterator = _STD reverse_iterator<const_iterator>;
vector() _NOEXCEPT_COND(is_nothrow_default_constructible_v<_Alty>)
()
noexcept
(
is_nothrow_default_constructible_v
<
>)
:
()
{
}
explicit
(
const
&
)
noexcept
:
(
)
{
}
explicit vector(_CRT_GUARDOVERFLOW const size_type _Count, const _Alloc& _Al = _Alloc())
explicit
(
__declspec
(guard(overflow))
const
,
const
&
=
())
:
(
)
{
if
(
(
))
{
this
->
() =
(
this
->
(),
);
();
}
}
vector(_CRT_GUARDOVERFLOW const size_type _Count, const _Ty& _Val, const _Alloc& _Al = _Alloc())
(
__declspec
(guard(overflow))
const
,
const
&
,
const
&
=
())
:
(
)
{
if
(
(
))
{
this
->
() =
(
this
->
(),
,
);
();
}
}
private
:
template
<
class
>
void
(
,
,
)
{
for
(;
!=
; ++
)
{
(*
);
}
();
}
template
<
class
>
void
(
,
,
)
{
if (_Buy(_Convert_size<size_type>(static_cast<size_t>(_STD distance(_First, _Last)))))
if
(
(
<
>(
static_cast
<
>(::
std
::
(
,
)))))
{
this
->
() =
(
,
,
this
->
());
();
}
}
public
:
template
<
class
,
class
=
<
<
>>>
(
,
,
const
&
=
())
:
(
)
{
(
,
);
(
(
),
(
),
<
>{});
}
(
<
>
,
const
&
=
())
:
(
)
{
(
.
(),
.
(),
random_access_iterator_tag
{});
}
(
const
&
)
:
(
::
select_on_container_copy_construction
(
.
()))
{
if
(
(
.
()))
{
this
->
() =
(
.
(),
.
(),
this
->
());
();
}
}
(
const
&
,
const
&
)
:
(
)
{
if
(
(
.
()))
{
this
->
() =
(
.
(),
.
(),
this
->
());
();
}
}
private
:
void
(
&&
,
)
noexcept
{
this
->
(
);
this
->
() =
.
();
this
->
() =
.
();
this
->
() =
.
();
.
() =
();
.
() =
();
.
() =
();
}
void
(
&&
,
)
{
if
(
this
->
()
.
())
{
_Move_from(_STD move(_Right), true_type{});
}
else
if
(
(
.
()))
{
this
->
() =
(
.
(),
.
(),
this
->
());
}
}
public
:
(
&&
)
noexcept
: _Mybase(_STD move(_Right._Getal()))
{
_Move_from(_STD move(_Right), true_type{});
}
(
&&
,
const
&
)
_NOEXCEPT_COND(_Alty_traits::is_always_equal::value) // strengthened
:
(
)
{
if
(
::
::
)
{
_Move_from(_STD move(_Right), true_type{});
}
else
{
#pragma warning(push) // TRANSITION, if constexpr
#pragma warning(push)
#pragma warning(disable: 4297) // function assumed not to throw an exception but does
#pragma warning(disable:
4297
)
_Move_from(_STD move(_Right), false_type{});
();
#pragma warning(pop)
}
}
private
:
void
(
&&
,
)
noexcept
{
_Move_from(_STD move(_Right), true_type{});
}
void
(
&&
,
)
{
if
(
this
->
()
.
())
{
_Move_from(_STD move(_Right), true_type{});
return
;
}
const
=
.
();
const
=
.
();
const
=
.
();
this
->
();
const
=
();
const
=
();
if
(
_Newsize
>
_Oldcapacity
)
{
if
(
_Newsize
>
())
{
();
}
const
=
(
_Newsize
);
if
(
this
->
()
())
{
(
this
->
(),
this
->
());
this
->
().
(
this
->
(),
_Oldcapacity
);
}
(
_Newcapacity
);
this
->
() =
(
_First
,
_Last
,
this
->
());
}
else
if
(
_Newsize
>
_Oldsize
)
{
const
=
_First
+
_Oldsize
;
(
_First
,
_Mid
,
this
->
());
this
->
() =
(
_Mid
,
_Last
,
this
->
());
}
else
{
const
=
this
->
() +
_Newsize
;
(
_First
,
_Last
,
this
->
());
(
_Newlast
,
this
->
());
this
->
() =
_Newlast
;
}
}
public
:
&
(
&&
)
_NOEXCEPT_COND(_Always_equal_after_move<_Alty>)
{
if (this != _STD addressof(_Right))
{
#pragma warning(push)
#pragma warning(disable: 4127) // conditional expression is constant
#pragma warning(disable:
4127
)
if
(
<
>
||
this
->
() ==
.
())
{
();
}
#pragma warning(pop)
this
->
(
.
());
_Move_assign_from(_STD move(_Right), bool_constant<_Always_equal_after_move<_Alty>>{});
}
return
(*
this
);
}
()
noexcept
{
();
}
private
:
template
<
class
...
>
decltype
(
auto
)
_Emplace_back_with_unused_capacity
(
&&...
)
{
_Alty_traits::construct(this->_Getal(), _Unfancy(this->_Mylast()), _STD forward<_Valty>(_Val)...);
::
(
this
->
(),
(
this
->
()), ::
std
::
<
>(
)...);
(
this
->
(),
this
->
());
&
= *
this
->
();
++
this
->
();
#if _HAS_CXX17
return (_Result);
#else /* ^^^ _HAS_CXX17 ^^^ // vvv !_HAS_CXX17 vvv */
(
void
)
_Result
;
#endif /* _HAS_CXX17 */
}
public
:
template
<
class
...
>
decltype
(
auto
)
(
&&...
)
{
if
(
())
{
return (_Emplace_back_with_unused_capacity(_STD forward<_Valty>(_Val)...));
return
(
_Emplace_back_with_unused_capacity
(::
std
::
<
>(
)...));
}
_Ty& _Result = *_Emplace_reallocate(this->_Mylast(), _STD forward<_Valty>(_Val)...);
&
= *
(
this
->
(), ::
std
::
<
>(
)...);
#if _HAS_CXX17
return (_Result);
#else /* ^^^ _HAS_CXX17 ^^^ // vvv !_HAS_CXX17 vvv */
(
void
)
_Result
;
#endif /* _HAS_CXX17 */
}
void
(
const
&
)
{
(
);
}
void
(
&&
)
{
emplace_back(_STD move(_Val));
}
template
<
class
...
>
(
const
,
&&...
)
{
const
=
static_cast
<
>(
-
this
->
());
&
=
this
->
();
const
=
();
if
(
_Oldsize
())
{
();
}
const
=
_Oldsize
+
1
;
const
=
(
_Newsize
);
const
=
_Al
.
(
_Newcapacity
);
const
=
_Newvec
+
_Whereoff
+
1
;
=
_Constructed_last
;
_Alty_traits::construct(_Al, _Unfancy(_Newvec + _Whereoff), _STD forward<_Valty>(_Val)...);
::
(
_Al
,
(
_Newvec
+
_Whereoff
), ::
std
::
<
>(
)...);
_Constructed_first
=
_Newvec
+
_Whereoff
;
if
(
this
->
())
{
(
this
->
(),
this
->
(),
_Newvec
);
}
else
{
(
this
->
(),
,
_Newvec
);
_Constructed_first
=
_Newvec
;
(
,
this
->
(),
_Newvec
+
_Whereoff
+
1
);
}
(
_Constructed_first
,
_Constructed_last
);
_Al
.
(
_Newvec
,
_Newcapacity
);
(
_Newvec
,
_Newsize
,
_Newcapacity
);
return
(
this
->
() +
_Whereoff
);
}
template
<
class
...
>
(
,
&&...
)
{
const
=
.
;
const
=
this
->
();
#if _ITERATOR_DEBUG_LEVEL == 2
_STL_VERIFY(_Where._Getcont() == _STD addressof(this->_Get_data())
&& _Whereptr >= this->_Myfirst()
&& _Oldlast >= _Whereptr, "vector emplace iterator outside range");
#endif /* _ITERATOR_DEBUG_LEVEL == 2 */
do
{
if
(
.
()
::
std
::
(
this
->
()) &&
_Whereptr
>=
this
->
() &&
_Oldlast
>=
_Whereptr
) { }
else
{
do
{ (
void
) ((
1
(
2
,
"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\vector"
,
992
,
0
,
"%s"
,
"vector emplace iterator outside range"
)) || (__debugbreak(),
0
)); ::
(
L"\"vector emplace iterator outside range\""
, __LPREFIX( __FUNCTION__),
L"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\vector"
,
992
,
0
); }
while
(
false
); } ; }
while
(
false
);
if
(
())
{
if
(
_Whereptr
_Oldlast
)
{
_Emplace_back_with_unused_capacity(_STD forward<_Valty>(_Val)...);
_Emplace_back_with_unused_capacity
(::
std
::
<
>(
)...);
}
else
{
_Ty _Obj(_STD forward<_Valty>(_Val)...); // handle aliasing
(
_Whereptr
,
_Oldlast
);
_Alty_traits::construct(this->_Getal(), _Unfancy(_Oldlast), _STD move(_Oldlast[-1]));
::
(
this
->
(),
(
_Oldlast
), ::
std
::
(
_Oldlast
[-
1
]));
++
this
->
();
(
_Whereptr
,
_Oldlast
-
1
,
_Oldlast
);
*_Whereptr = _STD move(_Obj);
*
_Whereptr
= ::
std
::
(
_Obj
);
}
return
(
this
->
(
_Whereptr
));
}
return (this->_Make_iterator(_Emplace_reallocate(_Whereptr, _STD forward<_Valty>(_Val)...)));
return
(
this
->
(
(
_Whereptr
, ::
std
::
<
>(
)...)));
}
(
,
const
&
)
{
return
(
(
,
));
}
(
,
&&
)
{
return (emplace(_Where, _STD move(_Val)));
}
iterator insert(const_iterator _Where, _CRT_GUARDOVERFLOW const size_type _Count, const _Ty& _Val)
(
,
__declspec
(guard(overflow))
const
,
const
&
)
{
#if _ITERATOR_DEBUG_LEVEL == 2
_STL_VERIFY(_Where._Getcont() == _STD addressof(this->_Get_data())
&& _Where._Ptr >= this->_Myfirst()
&& this->_Mylast() >= _Where._Ptr, "vector insert iterator outside range");
#endif /* _ITERATOR_DEBUG_LEVEL == 2 */
do
{
if
(
.
()
::
std
::
(
this
->
()) &&
.
>=
this
->
() &&
this
->
() >=
.
) { }
else
{
do
{ (
void
) ((
1
(
2
,
"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\vector"
,
1033
,
0
,
"%s"
,
"vector insert iterator outside range"
)) || (__debugbreak(),
0
)); ::
(
L"\"vector insert iterator outside range\""
, __LPREFIX( __FUNCTION__),
L"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\vector"
,
1033
,
0
); }
while
(
false
); } ; }
while
(
false
);
const
=
static_cast
<
>(
.
-
this
->
());
const
bool
=
1
&&
.
this
->
();
if
(
0
)
{
}
else
if
(
>
())
{
const
=
();
if
(
>
() -
_Oldsize
)
{
();
}
const
=
_Oldsize
+
;
const
=
(
_Newsize
);
const
=
this
->
().
(
_Newcapacity
);
const
=
_Newvec
+
_Whereoff
+
;
=
_Constructed_last
;
(
_Newvec
+
_Whereoff
,
,
);
_Constructed_first
=
_Newvec
+
_Whereoff
;
if
(
_One_at_back
)
{
(
this
->
(),
this
->
(),
_Newvec
);
}
else
{
(
this
->
(),
.
,
_Newvec
);
_Constructed_first
=
_Newvec
;
(
.
,
this
->
(),
_Newvec
+
_Whereoff
+
);
}
(
_Constructed_first
,
_Constructed_last
);
this
->
().
(
_Newvec
,
_Newcapacity
);
(
_Newvec
,
_Newsize
,
_Newcapacity
);
}
else
if
(
_One_at_back
)
{
_Emplace_back_with_unused_capacity
(
);
}
else
{
const
=
;
const
=
this
->
();
const
=
static_cast
<
>(
_Oldlast
-
.
);
(
.
,
_Oldlast
);
if
(
>
_Affected_elements
)
{
this
->
() =
(
_Oldlast
,
-
_Affected_elements
,
_Tmp
);
this
->
() =
(
.
,
_Oldlast
,
this
->
());
(
.
,
_Oldlast
,
_Tmp
);
}
else
{
this
->
() =
(
_Oldlast
-
,
_Oldlast
,
_Oldlast
);
(
.
,
_Oldlast
-
,
_Oldlast
);
(
.
,
.
+
,
_Tmp
);
}
}
return
(
this
->
(
_Whereoff
));
}
private
:
template
<
class
>
void
(
,
,
,
)
{
if
(
==
)
{
return
;
}
const
=
static_cast
<
>(
.
-
this
->
());
const
=
();
for
(;
!=
; ++
)
{
(*
);
}
(
this
->
() +
_Whereoff
,
this
->
() +
_Oldsize
);
(
this
->
() +
_Whereoff
,
this
->
() +
_Oldsize
,
this
->
());
}
template
<
class
>
void
(
,
,
,
)
{
const size_type _Count = _Convert_size<size_type>(static_cast<size_t>(_STD distance(_First, _Last)));
const
=
<
>(
static_cast
<
>(::
std
::
(
,
)));
const
=
static_cast
<
>(
.
-
this
->
());
const
bool
=
_Count
1
&&
.
this
->
();
if
(
_Count
0
)
{
}
else
if
(
_Count
>
())
{
const
=
();
if
(
_Count
>
() -
_Oldsize
)
{
();
}
const
=
_Oldsize
+
_Count
;
const
=
(
_Newsize
);
const
=
this
->
().
(
_Newcapacity
);
const
=
_Newvec
+
_Whereoff
+
_Count
;
=
_Constructed_last
;
(
,
,
_Newvec
+
_Whereoff
);
_Constructed_first
=
_Newvec
+
_Whereoff
;
if
(
_One_at_back
)
{
(
this
->
(),
this
->
(),
_Newvec
);
}
else
{
(
this
->
(),
.
,
_Newvec
);
_Constructed_first
=
_Newvec
;
(
.
,
this
->
(),
_Newvec
+
_Whereoff
+
_Count
);
}
(
_Constructed_first
,
_Constructed_last
);
this
->
().
(
_Newvec
,
_Newcapacity
);
(
_Newvec
,
_Newsize
,
_Newcapacity
);
}
else
{
const
=
this
->
();
const
=
static_cast
<
>(
_Oldlast
-
.
);
if
(
_Count
_Affected_elements
)
{
this
->
() =
(
_Oldlast
-
_Count
,
_Oldlast
,
_Oldlast
);
(
.
,
_Oldlast
-
_Count
,
_Oldlast
);
(
.
,
.
+
_Count
);
(
,
,
.
);
(
.
+
_Count
,
.
+
2
*
_Count
,
.
);
(
.
,
_Oldlast
);
(
.
+
_Count
,
this
->
());
this
->
() =
.
;
(
.
+
2
*
_Count
,
this
->
(),
.
+
_Count
);
(
_Oldlast
,
this
->
());
this
->
() =
_Oldlast
;
}
else
{
const
=
.
+
_Count
;
this
->
() =
(
.
,
_Oldlast
,
_Relocated
);
(
.
,
_Oldlast
);
(
,
,
.
);
(
_Relocated
,
this
->
(),
.
);
(
.
,
_Oldlast
);
(
_Relocated
,
this
->
());
this
->
() =
.
;
(
_Relocated
,
this
->
());
this
->
() =
_Oldlast
;
}
(
.
,
_Oldlast
);
}
}
public
:
template
<
class
,
class
=
<
<
>>>
(
,
,
)
{
#if _ITERATOR_DEBUG_LEVEL == 2
_STL_VERIFY(_Where._Getcont() == _STD addressof(this->_Get_data())
&& _Where._Ptr >= this->_Myfirst()
&& this->_Mylast() >= _Where._Ptr, "vector insert iterator outside range");
#endif /* _ITERATOR_DEBUG_LEVEL == 2 */
do
{
if
(
.
()
::
std
::
(
this
->
()) &&
.
>=
this
->
() &&
this
->
() >=
.
) { }
else
{
do
{ (
void
) ((
1
(
2
,
"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\vector"
,
1256
,
0
,
"%s"
,
"vector insert iterator outside range"
)) || (__debugbreak(),
0
)); ::
(
L"\"vector insert iterator outside range\""
, __LPREFIX( __FUNCTION__),
L"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\vector"
,
1256
,
0
); }
while
(
false
); } ; }
while
(
false
);
(
,
);
const
=
static_cast
<
>(
.
-
this
->
());
(
,
(
),
(
),
<
>{});
return
(
this
->
(
_Whereoff
));
}
(
,
<
>
)
{
return
(
(
,
.
(),
.
()));
}
void assign(_CRT_GUARDOVERFLOW const size_type _Newsize, const _Ty& _Val)
void
(
__declspec
(guard(overflow))
const
,
const
&
)
{
this
->
();
const
=
();
const
=
();
if
(
>
_Oldcapacity
)
{
if
(
>
())
{
();
}
const
=
(
);
if
(
this
->
()
())
{
(
this
->
(),
this
->
());
this
->
().
(
this
->
(),
_Oldcapacity
);
}
(
_Newcapacity
);
this
->
() =
(
this
->
(),
,
);
}
else
if
(
>
_Oldsize
)
{
(
this
->
(),
this
->
(),
);
this
->
() =
(
this
->
(),
-
_Oldsize
,
);
}
else
{
const
=
this
->
() +
;
(
this
->
(),
_Newlast
,
);
(
_Newlast
,
this
->
());
this
->
() =
_Newlast
;
}
}
private
:
template
<
class
>
void
(
,
,
)
{
this
->
();
=
this
->
();
for
(;
!=
&&
_Next
!=
this
->
(); ++
, (
void
)++
_Next
)
{
*
_Next
= *
;
}
(
_Next
,
this
->
());
this
->
() =
_Next
;
for
(;
!=
; ++
)
{
(*
);
}
}
template
<
class
>
void
(
,
,
)
{
const size_type _Newsize = _Convert_size<size_type>(static_cast<size_t>(_STD distance(_First, _Last)));
const
=
<
>(
static_cast
<
>(::
std
::
(
,
)));
this
->
();
const
=
();
const
=
();
if
(
_Newsize
>
_Oldcapacity
)
{
if
(
_Newsize
>
())
{
();
}
const
=
(
_Newsize
);
if
(
this
->
()
())
{
(
this
->
(),
this
->
());
this
->
().
(
this
->
(),
_Oldcapacity
);
}
(
_Newcapacity
);
this
->
() =
(
,
,
this
->
());
}
else
if
(
_Newsize
>
_Oldsize
)
{
const _Iter _Mid = _STD next(_First, static_cast<difference_type>(_Oldsize));
const
= ::
std
::
(
,
static_cast
<
>(
_Oldsize
));
(
,
_Mid
,
this
->
());
this
->
() =
(
_Mid
,
,
this
->
());
}
else
{
const
=
this
->
() +
_Newsize
;
(
,
,
this
->
());
(
_Newlast
,
this
->
());
this
->
() =
_Newlast
;
}
}
public
:
template
<
class
,
class
=
<
<
>>>
void
(
,
)
{
(
,
);
(
(
),
(
),
<
>{});
}
void
(
<
>
)
{
(
.
(),
.
(),
random_access_iterator_tag
{});
}
&
(
const
&
)
{
if (this != _STD addressof(_Right))
{
#pragma warning(push)
#pragma warning(disable: 4127) // conditional expression is constant
#pragma warning(disable:
4127
)
if
(
::
propagate_on_container_copy_assignment
::
&&
this
->
() !=
.
())
{
();
}
#pragma warning(pop)
this
->
(
.
());
(
.
(),
.
());
}
return
(*
this
);
}
&
(
<
>
)
{
(
.
(),
.
(),
random_access_iterator_tag
{});
return
(*
this
);
}
private
:
template
<
class
>
void
(
const
,
)
{
const
=
();
const
=
();
if
(
>
_Oldcapacity
)
{
if
(
>
())
{
();
}
const
=
(
);
const
=
this
->
().
(
_Newcapacity
);
const
=
_Newvec
+
_Oldsize
;
=
_Appended_first
;
_Appended_last
=
(
_Appended_first
,
-
_Oldsize
);
(
this
->
(),
this
->
(),
_Newvec
);
(
_Appended_first
,
_Appended_last
);
this
->
().
(
_Newvec
,
_Newcapacity
);
(
_Newvec
,
,
_Newcapacity
);
}
else
if
(
>
_Oldsize
)
{
const
=
this
->
();
this
->
() =
(
_Oldlast
,
-
_Oldsize
);
(
_Oldlast
,
_Oldlast
);
}
else
if
(
_Oldsize
)
{
}
else
{
const
=
this
->
() +
;
(
_Newlast
,
this
->
());
(
_Newlast
,
this
->
());
this
->
() =
_Newlast
;
}
}
public
:
void resize(_CRT_GUARDOVERFLOW const size_type _Newsize)
void
(
__declspec
(guard(overflow))
const
)
{
const
auto
= [
this
](
,
const
)
{
return
(
(
_Dest
,
_Count
));
};
(
,
_Lambda_default
);
}
void resize(_CRT_GUARDOVERFLOW const size_type _Newsize, const _Ty& _Val)
void
(
__declspec
(guard(overflow))
const
,
const
&
)
{
auto
= [
this
, &_Val](
,
const
)
{
return
(
(
_Dest
,
_Count
,
));
};
(
,
_Lambda_fill
);
}
private
:
void
(
const
)
{
const
=
();
const
=
this
->
().
(
);
(
this
->
(),
this
->
(),
_Newvec
);
this
->
().
(
_Newvec
,
);
(
_Newvec
,
_Size
,
);
}
public
:
void reserve(_CRT_GUARDOVERFLOW const size_type _Newcapacity)
void
(
__declspec
(guard(overflow))
const
)
{
if
(
>
())
{
if
(
>
())
{
();
}
(
);
}
}
void
()
{
if
(
())
{
if
(
())
{
();
}
else
{
(
());
}
}
}
void
()
{
#if _ITERATOR_DEBUG_LEVEL == 2
_STL_VERIFY(!empty(), "vector empty before pop");
do
{
if
(!
()) { }
else
{
do
{ (
void
) ((
1
(
2
,
"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\vector"
,
1544
,
0
,
"%s"
,
"vector empty before pop"
)) || (__debugbreak(),
0
)); ::
(
L"\"vector empty before pop\""
, __LPREFIX( __FUNCTION__),
L"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\vector"
,
1544
,
0
); }
while
(
false
); } ; }
while
(
false
);
(
this
->
() -
1
,
this
->
());
#endif /* _ITERATOR_DEBUG_LEVEL == 2 */
::
(
this
->
(),
(
this
->
() -
1
));
--
this
->
();
}
(
)
{
#if _ITERATOR_DEBUG_LEVEL == 2
_STL_VERIFY(_Where._Getcont() == _STD addressof(this->_Get_data())
&& _Where._Ptr >= this->_Myfirst()
&& this->_Mylast() > _Where._Ptr, "vector erase iterator outside range");
do
{
if
(
.
()
::
std
::
(
this
->
()) &&
.
>=
this
->
() &&
this
->
() >
.
) { }
else
{
do
{ (
void
) ((
1
(
2
,
"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\vector"
,
1557
,
0
,
"%s"
,
"vector erase iterator outside range"
)) || (__debugbreak(),
0
)); ::
(
L"\"vector erase iterator outside range\""
, __LPREFIX( __FUNCTION__),
L"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\vector"
,
1557
,
0
); }
while
(
false
); } ; }
while
(
false
);
(
.
,
this
->
());
#endif /* _ITERATOR_DEBUG_LEVEL == 2 */
(
.
+
1
,
this
->
(),
.
);
::
(
this
->
(),
(
this
->
() -
1
));
--
this
->
();
return (iterator(_Where._Ptr, _STD addressof(this->_Get_data())));
return
(
(
.
, ::
std
::
(
this
->
())));
}
(
,
)
{
#if _ITERATOR_DEBUG_LEVEL == 2
_STL_VERIFY(_First._Getcont() == _STD addressof(this->_Get_data())
&& _Last._Getcont() == _STD addressof(this->_Get_data())
&& _First._Ptr >= this->_Myfirst()
&& _Last._Ptr >= _First._Ptr
&& this->_Mylast() >= _Last._Ptr, "vector erase iterator outside range");
#endif /* _ITERATOR_DEBUG_LEVEL == 2 */
do
{
if
(
.
()
::
std
::
(
this
->
()) &&
.
()
::
std
::
(
this
->
()) &&
.
>=
this
->
() &&
.
>=
.
&&
this
->
() >=
.
) { }
else
{
do
{ (
void
) ((
1
(
2
,
"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\vector"
,
1574
,
0
,
"%s"
,
"vector erase iterator outside range"
)) || (__debugbreak(),
0
)); ::
(
L"\"vector erase iterator outside range\""
, __LPREFIX( __FUNCTION__),
L"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\vector"
,
1574
,
0
); }
while
(
false
); } ; }
while
(
false
);
if
(
.
.
)
{
(
.
,
this
->
());
const
=
(
.
,
this
->
(),
.
);
(
_Newlast
,
this
->
());
this
->
() =
_Newlast
;
}
return (iterator(_First._Ptr, _STD addressof(this->_Get_data())));
return
(
(
.
, ::
std
::
(
this
->
())));
}
void
()
noexcept
{
this
->
();
(
this
->
(),
this
->
());
this
->
() =
this
->
();
}
void
(
&
)
noexcept
{
if (this != _STD addressof(_Right))
{
(
this
->
(),
.
());
this
->
(
);
(
this
->
(),
.
());
(
this
->
(),
.
());
(
this
->
(),
.
());
}
}
_NODISCARD _Ty * data() noexcept
{
return
(
(
this
->
()));
}
_NODISCARD const _Ty * data() const noexcept
const
*
()
const
noexcept
{
return
(
(
this
->
()));
}
_NODISCARD iterator begin() noexcept
{
return (iterator(this->_Myfirst(), _STD addressof(this->_Get_data())));
return
(
(
this
->
(), ::
std
::
(
this
->
())));
}
_NODISCARD const_iterator begin() const noexcept
{
return (const_iterator(this->_Myfirst(), _STD addressof(this->_Get_data())));
return
(
(
this
->
(), ::
std
::
(
this
->
())));
}
_NODISCARD iterator end() noexcept
{
return (iterator(this->_Mylast(), _STD addressof(this->_Get_data())));
return
(
(
this
->
(), ::
std
::
(
this
->
())));
}
_NODISCARD const_iterator end() const noexcept
{
return (const_iterator(this->_Mylast(), _STD addressof(this->_Get_data())));
return
(
(
this
->
(), ::
std
::
(
this
->
())));
}
_NODISCARD reverse_iterator rbegin() noexcept
{
return
(
(
()));
}
_NODISCARD const_reverse_iterator rbegin() const noexcept
{
return
(
(
()));
}
_NODISCARD reverse_iterator rend() noexcept
{
return
(
(
()));
}
_NODISCARD const_reverse_iterator rend() const noexcept
{
return
(
(
()));
}
_NODISCARD const_iterator cbegin() const noexcept
{
return
(
());
}
_NODISCARD const_iterator cend() const noexcept
{
return
(
());
}
_NODISCARD const_reverse_iterator crbegin() const noexcept
{
return
(
());
}
_NODISCARD const_reverse_iterator crend() const noexcept
{
return
(
());
}
()
noexcept
{
return
(
this
->
());
}
()
const
noexcept
{
return
(
this
->
());
}
()
noexcept
{
return
(
this
->
());
}
()
const
noexcept
{
return
(
this
->
());
}
_NODISCARD bool empty() const noexcept
{
return
(
this
->
()
this
->
());
}
_NODISCARD size_type size() const noexcept
{
return
(
static_cast
<
>(
this
->
() -
this
->
()));
}
_NODISCARD size_type max_size() const noexcept
{
return
(
(
static_cast
<
>((
<
>::
)()),
::
(
this
->
())));
}
_NODISCARD size_type capacity() const noexcept
{
return
(
static_cast
<
>(
this
->
() -
this
->
()));
}
private
:
()
const
noexcept
{
return
(
static_cast
<
>(
this
->
() -
this
->
()));
}
bool
()
const
noexcept
{
return
(
this
->
()
this
->
());
}
public
:
_NODISCARD _Ty& operator[](const size_type _Pos)
{
#if _ITERATOR_DEBUG_LEVEL != 0
_STL_VERIFY(_Pos < size(), "vector subscript out of range");
#endif /* _ITERATOR_DEBUG_LEVEL != 0 */
do
{
if
(
()) { }
else
{
do
{ (
void
) ((
1
(
2
,
"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\vector"
,
1733
,
0
,
"%s"
,
"vector subscript out of range"
)) || (__debugbreak(),
0
)); ::
(
L"\"vector subscript out of range\""
, __LPREFIX( __FUNCTION__),
L"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\vector"
,
1733
,
0
); }
while
(
false
); } ; }
while
(
false
);
return
(
this
->
()[
]);
}
_NODISCARD const _Ty& operator[](const size_type _Pos) const
{
#if _ITERATOR_DEBUG_LEVEL != 0
_STL_VERIFY(_Pos < size(), "vector subscript out of range");
#endif /* _ITERATOR_DEBUG_LEVEL != 0 */
do
{
if
(
()) { }
else
{
do
{ (
void
) ((
1
(
2
,
"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\vector"
,
1742
,
0
,
"%s"
,
"vector subscript out of range"
)) || (__debugbreak(),
0
)); ::
(
L"\"vector subscript out of range\""
, __LPREFIX( __FUNCTION__),
L"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\vector"
,
1742
,
0
); }
while
(
false
); } ; }
while
(
false
);
return
(
this
->
()[
]);
}
_NODISCARD _Ty& at(const size_type _Pos)
{
if
(
() <=
)
{
();
}
return
(
this
->
()[
]);
}
_NODISCARD const _Ty& at(const size_type _Pos) const
{
if
(
() <=
)
{
();
}
return
(
this
->
()[
]);
}
{
#if _ITERATOR_DEBUG_LEVEL != 0
_STL_VERIFY(!empty(), "front() called on empty vector");
#endif /* _ITERATOR_DEBUG_LEVEL != 0 */
do
{
if
(!
()) { }
else
{
do
{ (
void
) ((
1
(
2
,
"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\vector"
,
1771
,
0
,
"%s"
,
"front() called on empty vector"
)) || (__debugbreak(),
0
)); ::
(
L"\"front() called on empty vector\""
, __LPREFIX( __FUNCTION__),
L"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\vector"
,
1771
,
0
); }
while
(
false
); } ; }
while
(
false
);
return
(*
this
->
());
}
_NODISCARD const _Ty& front() const
{
#if _ITERATOR_DEBUG_LEVEL != 0
_STL_VERIFY(!empty(), "front() called on empty vector");
#endif /* _ITERATOR_DEBUG_LEVEL != 0 */
do
{
if
(!
()) { }
else
{
do
{ (
void
) ((
1
(
2
,
"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\vector"
,
1780
,
0
,
"%s"
,
"front() called on empty vector"
)) || (__debugbreak(),
0
)); ::
(
L"\"front() called on empty vector\""
, __LPREFIX( __FUNCTION__),
L"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\vector"
,
1780
,
0
); }
while
(
false
); } ; }
while
(
false
);
return
(*
this
->
());
}
{
#if _ITERATOR_DEBUG_LEVEL != 0
_STL_VERIFY(!empty(), "back() called on empty vector");
#endif /* _ITERATOR_DEBUG_LEVEL != 0 */
do
{
if
(!
()) { }
else
{
do
{ (
void
) ((
1
(
2
,
"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\vector"
,
1789
,
0
,
"%s"
,
"back() called on empty vector"
)) || (__debugbreak(),
0
)); ::
(
L"\"back() called on empty vector\""
, __LPREFIX( __FUNCTION__),
L"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\vector"
,
1789
,
0
); }
while
(
false
); } ; }
while
(
false
);
return
(
this
->
()[-
1
]);
}
_NODISCARD const _Ty& back() const
{
#if _ITERATOR_DEBUG_LEVEL != 0
_STL_VERIFY(!empty(), "back() called on empty vector");
#endif /* _ITERATOR_DEBUG_LEVEL != 0 */
do
{
if
(!
()) { }
else
{
do
{ (
void
) ((
1
(
2
,
"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\vector"
,
1798
,
0
,
"%s"
,
"back() called on empty vector"
)) || (__debugbreak(),
0
)); ::
(
L"\"back() called on empty vector\""
, __LPREFIX( __FUNCTION__),
L"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\vector"
,
1798
,
0
); }
while
(
false
); } ; }
while
(
false
);
return
(
this
->
()[-
1
]);
}
_NODISCARD allocator_type get_allocator() const noexcept
{
return
(
static_cast
<
>(
this
->
()));
}
private
:
(
,
const
)
{
return
(
_Uninitialized_value_construct_n
(
,
,
this
->
()));
}
(
,
const
,
const
&
)
{
return
(
(
,
,
,
this
->
()));
}
template
<
class
>
(
,
,
)
{
return
(
(
,
,
,
this
->
()));
}
(
,
,
)
{
return
(
(
,
,
,
this
->
()));
}
void
(
,
,
,
)
{
(
,
,
,
this
->
());
}
void
(
,
,
,
)
{
(
,
,
,
this
->
());
}
void
(
,
,
)
{
(
,
,
,
<
<
is_nothrow_move_constructible
<
>,
<
<
>>>>{});
}
void
(
,
)
{
(
,
,
this
->
());
}
(
const
)
const
{
const
=
();
if
(
_Oldcapacity
>
() -
_Oldcapacity
/
2
)
{
return
(
);
}
const
=
_Oldcapacity
+
_Oldcapacity
/
2
;
if
(
_Geometric
)
{
return
(
);
}
return
(
_Geometric
);
}
bool
(
const
)
{
this
->
() =
();
this
->
() =
();
this
->
() =
();
if
(
0
)
{
return
(
false
);
}
if
(
>
())
{
();
}
this
->
() =
this
->
().
(
);
this
->
() =
this
->
();
this
->
() =
this
->
() +
;
return
(
true
);
}
void
(
const
,
const
,
const
)
{
this
->
();
if
(
this
->
()
())
{
(
this
->
(),
this
->
());
this
->
().
(
this
->
(),
());
}
this
->
() =
;
this
->
() =
+
;
this
->
() =
+
;
}
void
()
{
this
->
();
if
(
this
->
()
())
{
(
this
->
(),
this
->
());
this
->
().
(
this
->
(),
());
this
->
() =
();
this
->
() =
();
this
->
() =
();
}
}
[[noreturn]]
static
void
()
{
(
"vector<T> too long"
);
}
[[noreturn]]
static
void
()
{
(
"invalid vector<T> subscript"
);
}
#if _ITERATOR_DEBUG_LEVEL == 2
void
(
,
)
const
{
_Lockit _Lock(_LOCK_DEBUG);
**
=
reinterpret_cast
<
**>(
this
->
());
if
(
_Pnext
)
{
while
(*
_Pnext
)
{
if
((*
_Pnext
)->
||
(*
_Pnext
)->
)
{
_Pnext
=
reinterpret_cast
<
**>((*
_Pnext
)->
());
}
else
{
(*
_Pnext
)->
();
*
_Pnext
= *
reinterpret_cast
<
**>((*
_Pnext
)->
());
}
}
}
}
#else /* _ITERATOR_DEBUG_LEVEL == 2 */
void _Orphan_range(pointer, pointer) const
{ // orphan iterators within specified (inclusive) range
}
#endif /* _ITERATOR_DEBUG_LEVEL == 2 */
};
#if _HAS_CXX17
template<class _Iter,
class _Alloc = allocator<_Iter_value_t<_Iter>>,
enable_if_t<conjunction_v<
_Is_iterator<_Iter>,
_Is_allocator<_Alloc>
>, int> = 0>
vector(_Iter, _Iter, _Alloc = _Alloc())
-> vector<_Iter_value_t<_Iter>, _Alloc>;
#endif /* _HAS_CXX17 */
template
<
class
,
class
>
inline
void
(
<
,
>&
,
<
,
>&
)
noexcept
{
.
(
);
}
template
<
class
,
class
>
_NODISCARD inline bool operator==(const vector<_Ty, _Alloc>& _Left,
inline
bool
(
const
<
,
>&
,
const
<
,
>&
)
{
return
(
.
()
.
()
&& _STD equal(_Left.begin(), _Left.end(), _Right.begin()));
&& ::
std
::
(
.
(),
.
(),
.
()));
}
template
<
class
,
class
>
_NODISCARD inline bool operator!=(const vector<_Ty, _Alloc>& _Left,
inline
bool
(
const
<
,
>&
,
const
<
,
>&
)
{
return
(!(
));
}
template
<
class
,
class
>
_NODISCARD inline bool operator<(const vector<_Ty, _Alloc>& _Left,
inline
bool
(
const
<
,
>&
,
const
<
,
>&
)
{
return (_STD lexicographical_compare(_Left.begin(), _Left.end(),
return
(::
std
::
(
.
(),
.
(),
.
(),
.
()));
}
template
<
class
,
class
>
_NODISCARD inline bool operator>(const vector<_Ty, _Alloc>& _Left,
inline
bool
(
const
<
,
>&
,
const
<
,
>&
)
{
return
(
);
}
template
<
class
,
class
>
_NODISCARD inline bool operator<=(const vector<_Ty, _Alloc>& _Left,
inline
bool
(
const
<
,
>&
,
const
<
,
>&
)
{
return
(!(
));
}
template
<
class
,
class
>
_NODISCARD inline bool operator>=(const vector<_Ty, _Alloc>& _Left,
inline
bool
(
const
<
,
>&
,
const
<
,
>&
)
{
return
(!(
));
}
using
=
unsigned
int
;
constexpr
int
=
8
*
sizeof
(
);
template
<
class
>
struct
{
using
=
;
};
template
<
class
>
class
:
public
{
public
:
using
=
typename
::_Alloc;
using
=
typename
<
>::
;
using
=
typename
<
>::
;
using
=
<
bool
,
<
,
bool
>>;
()
: _Myptr(
nullptr
), _Myoff(
0
)
{
}
(
const
*
,
,
const
*
)
: _Myptr(
), _Myoff(
)
{
this
->
(
);
}
void
(
)
{
+=
;
+=
/
_VBITS
;
%=
_VBITS
;
}
int
(
)
const
{
#if _ITERATOR_DEBUG_LEVEL == 2
const
auto
=
static_cast
<
const
*>(
this
->
());
=
_Cont
->
;
+=
;
+=
static_cast
<
>(
_VBITS
* (
-
_Cont
->
.
()));
return
(
_Mysize
? -
1
:
_Mysize
?
0
: +
1
);
#else /* _ITERATOR_DEBUG_LEVEL == 2 */
(void)_Inc;
return (-1);
#endif /* _ITERATOR_DEBUG_LEVEL == 2 */
}
const
*
;
;
};
template
<
class
>
class
:
public
<
>
{
using
=
<
>;
()
noexcept
{
}
public
:
(
const
&
)
:
(
.
,
.
,
.
())
{
}
&
(
const
&
)
noexcept
{
return
(*
this
bool
(
));
}
&
(
bool
)
noexcept
{
if
(
)
*
const_cast
<
*>(
()) |=
();
else
*
const_cast
<
*>(
()) &= ~
();
return
(*
this
);
}
void
()
noexcept
{
*
const_cast
<
*>(
()) ^=
();
}
bool
()
const
noexcept
{
return
((*
() &
())
0
);
}
const
*
()
const
{
#if _ITERATOR_DEBUG_LEVEL != 0
_STL_VERIFY(this->_Getcont() && this->_Myptr && this->_Valid(0) < 0,
"vector<bool> iterator not dereferencable");
#endif /* _ITERATOR_DEBUG_LEVEL != 0 */
do
{
if
(
this
->
() &&
this
->
&&
this
->
(
0
)
0
) { }
else
{
do
{ (
void
) ((
1
(
2
,
"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\vector"
,
2137
,
0
,
"%s"
,
"vector<bool> iterator not dereferencable"
)) || (__debugbreak(),
0
)); ::
(
L"\"vector<bool> iterator not dereferencable\""
, __LPREFIX( __FUNCTION__),
L"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\vector"
,
2137
,
0
); }
while
(
false
); } ; }
while
(
false
);
return
(
this
->
);
}
protected
:
()
const
{
return
(
static_cast
<
>(
1
) <<
this
->
);
}
};
template
<
class
>
inline
void
(
<
>
,
<
>
)
noexcept
{
bool
=
;
;
_Val
;
}
template
<
class
>
class
:
public
<
>
{
private
:
using
=
<
>;
using
=
typename
::
;
public
:
using
=
<
>;
using
=
bool
;
using
=
random_access_iterator_tag
;
using
=
bool
;
using
=
typename
::
;
using
=
*;
using
=
;
()
{
}
(
const
*
,
const
*
)
:
(
,
0
,
)
{
}
_NODISCARD const_reference operator*() const
{
return
(
(*
this
));
}
&
()
{
();
return
(*
this
);
}
(
int
)
{
= *
this
;
*
this
;
return
(
_Tmp
);
}
&
()
{
();
return
(*
this
);
}
(
int
)
{
= *
this
;
*
this
;
return
(
_Tmp
);
}
&
(
const
)
{
if
(
0
&&
this
->
0
-
static_cast
<
>(
))
{
this
->
+=
;
this
->
-=
1
+ (
static_cast
<
>(-
1
) -
this
->
) /
_VBITS
;
this
->
%=
_VBITS
;
}
else
{
this
->
+=
;
this
->
+=
this
->
/
_VBITS
;
this
->
%=
_VBITS
;
}
return
(*
this
);
}
_NODISCARD _Vb_const_iterator operator+(const difference_type _Off) const
{
= *
this
;
return
(
_Tmp
);
}
&
(
const
)
{
return
(*
this
-
);
}
_NODISCARD _Vb_const_iterator operator-(const difference_type _Off) const
{
= *
this
;
return
(
_Tmp
);
}
_NODISCARD difference_type operator-(const _Vb_const_iterator& _Right) const
{
(
);
return
(
static_cast
<
>(
_VBITS
* (
this
->
-
.
))
+
static_cast
<
>(
this
->
)
-
static_cast
<
>(
.
));
}
_NODISCARD const_reference operator[](const difference_type _Off) const
{
return
(
(*
this
));
}
_NODISCARD bool operator==(const _Vb_const_iterator& _Right) const
{
(
);
return
(
this
->
.
&&
this
->
.
);
}
_NODISCARD bool operator!=(const _Vb_const_iterator& _Right) const
{
return
(!(*
this
));
}
_NODISCARD bool operator<(const _Vb_const_iterator& _Right) const
{
(
);
return
(
this
->
.
|| (
this
->
.
&&
this
->
.
));
}
_NODISCARD bool operator>(const _Vb_const_iterator& _Right) const
{
return
(
*
this
);
}
_NODISCARD bool operator<=(const _Vb_const_iterator& _Right) const
{
return
(!(
*
this
));
}
_NODISCARD bool operator>=(const _Vb_const_iterator& _Right) const
{
return
(!(*
this
));
}
void
(
const
&
)
const
{
#if _ITERATOR_DEBUG_LEVEL == 0
(void)_Right;
#else /* _ITERATOR_DEBUG_LEVEL == 0 */
_STL_VERIFY(this->_Getcont() == _Right._Getcont(), "vector<bool> iterators incompatible");
#endif /* _ITERATOR_DEBUG_LEVEL */
do
{
if
(
this
->
()
.
()) { }
else
{
do
{ (
void
) ((
1
(
2
,
"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\vector"
,
2304
,
0
,
"%s"
,
"vector<bool> iterators incompatible"
)) || (__debugbreak(),
0
)); ::
(
L"\"vector<bool> iterators incompatible\""
, __LPREFIX( __FUNCTION__),
L"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\vector"
,
2304
,
0
); }
while
(
false
); } ; }
while
(
false
);
}
#if _ITERATOR_DEBUG_LEVEL != 0
friend
void
(
const
&
,
const
&
)
{
_STL_VERIFY(_First <= _Last, "vector<bool> iterator range transposed");
do
{
if
(
) { }
else
{
do
{ (
void
) ((
1
(
2
,
"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\vector"
,
2312
,
0
,
"%s"
,
"vector<bool> iterator range transposed"
)) || (__debugbreak(),
0
)); ::
(
L"\"vector<bool> iterator range transposed\""
, __LPREFIX( __FUNCTION__),
L"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\vector"
,
2312
,
0
); }
while
(
false
); } ; }
while
(
false
);
}
#endif /* _ITERATOR_DEBUG_LEVEL != 0 */
void
()
{
if
(
this
->
0
)
--
this
->
;
else
{
#if _ITERATOR_DEBUG_LEVEL != 0
_STL_VERIFY(this->_Getcont(), "cannot decrement value-initialized vector<bool> iterator");
do
{
if
(
this
->
()) { }
else
{
do
{ (
void
) ((
1
(
2
,
"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\vector"
,
2323
,
0
,
"%s"
,
"cannot decrement value-initialized vector<bool> iterator"
)) || (__debugbreak(),
0
)); ::
(
L"\"cannot decrement value-initialized vector<bool> iterator\""
, __LPREFIX( __FUNCTION__),
L"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\vector"
,
2323
,
0
); }
while
(
false
); } ; }
while
(
false
);
_STL_VERIFY(this->_Valid(static_cast<_Size_type>(-1)) <= 0,
"cannot decrement invalid vector<bool> iterator");
#endif /* _ITERATOR_DEBUG_LEVEL */
do
{
if
(
this
->
(
static_cast
<
>(-
1
)) <=
0
) { }
else
{
do
{ (
void
) ((
1
(
2
,
"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\vector"
,
2325
,
0
,
"%s"
,
"cannot decrement invalid vector<bool> iterator"
)) || (__debugbreak(),
0
)); ::
(
L"\"cannot decrement invalid vector<bool> iterator\""
, __LPREFIX( __FUNCTION__),
L"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\vector"
,
2325
,
0
); }
while
(
false
); } ; }
while
(
false
);
this
->
=
_VBITS
-
1
;
--
this
->
;
}
}
void
()
{
if
(
this
->
_VBITS
-
1
)
++
this
->
;
else
{
#if _ITERATOR_DEBUG_LEVEL != 0
_STL_VERIFY(this->_Getcont(), "cannot increment value-initialized vector<bool> iterator");
do
{
if
(
this
->
()) { }
else
{
do
{ (
void
) ((
1
(
2
,
"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\vector"
,
2340
,
0
,
"%s"
,
"cannot increment value-initialized vector<bool> iterator"
)) || (__debugbreak(),
0
)); ::
(
L"\"cannot increment value-initialized vector<bool> iterator\""
, __LPREFIX( __FUNCTION__),
L"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\vector"
,
2340
,
0
); }
while
(
false
); } ; }
while
(
false
);
_STL_VERIFY(this->_Valid(1) <= 0,
"cannot increment invalid vector<bool> iterator");
#endif /* _ITERATOR_DEBUG_LEVEL */
do
{
if
(
this
->
(
1
) <=
0
) { }
else
{
do
{ (
void
) ((
1
(
2
,
"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\vector"
,
2342
,
0
,
"%s"
,
"cannot increment invalid vector<bool> iterator"
)) || (__debugbreak(),
0
)); ::
(
L"\"cannot increment invalid vector<bool> iterator\""
, __LPREFIX( __FUNCTION__),
L"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\vector"
,
2342
,
0
); }
while
(
false
); } ; }
while
(
false
);
this
->
=
0
;
++
this
->
;
}
}
};
template
<
class
>
_NODISCARD _Vb_const_iterator<_Alvbase_wrapped> operator+(
typename
<
>::
,
<
>
)
{
return
(
);
}
template
<
class
>
class
:
public
<
>
{
public
:
using
=
<
>;
using
=
<
>;
using
=
bool
;
using
=
random_access_iterator_tag
;
using
=
bool
;
using
=
typename
::
;
using
=
*;
using
=
;
()
{
}
(
*
,
*
)
:
(
,
)
{
}
_NODISCARD reference operator*() const
{
return
(
(*
this
));
}
&
()
{
*(
*)
this
;
return
(*
this
);
}
(
int
)
{
= *
this
;
*
this
;
return
(
_Tmp
);
}
&
()
{
*(
*)
this
;
return
(*
this
);
}
(
int
)
{
= *
this
;
*
this
;
return
(
_Tmp
);
}
&
(
const
)
{
*(
*)
this
;
return
(*
this
);
}
_NODISCARD _Vb_iterator operator+(const difference_type _Off) const
{
= *
this
;
return
(
_Tmp
);
}
&
(
const
)
{
return
(*
this
-
);
}
_NODISCARD _Vb_iterator operator-(const difference_type _Off) const
{
= *
this
;
return
(
_Tmp
);
}
_NODISCARD difference_type operator-(const _Mybase& _Right) const
{
return
(*(
*)
this
);
}
_NODISCARD reference operator[](const difference_type _Off) const
{
return
(
(*
this
));
}
};
template
<
class
>
_NODISCARD inline _Vb_iterator<_Alvbase_wrapped> operator+(
typename
<
>::
,
<
>
)
{
return
(
);
}
template
<
class
>
class
:
public
{
public
:
using
=
<
,
>;
using
=
<
>;
using
=
<
,
>;
using
=
<
>;
using
=
<
,
>;
using
=
<
>;
using
=
typename
::
;
_Vb_val() _NOEXCEPT_COND(is_nothrow_default_constructible_v<_Vectype>)
()
noexcept
(
is_nothrow_default_constructible_v
<
>)
: _Myvec()
{
();
=
0
;
}
_Vb_val(const _Alloc& _Al) _NOEXCEPT_COND(is_nothrow_constructible_v<_Vectype, _Alvbase>)
(
const
&
)
noexcept
(
is_nothrow_constructible_v
<
,
>)
: _Myvec(
static_cast
<
>(
))
{
();
=
0
;
}
(
,
const
bool
&
)
: _Myvec(
(
),
static_cast
<
>(
? -
1
:
0
))
{
();
=
0
;
}
(
,
const
bool
&
,
const
&
)
: _Myvec(
(
),
static_cast
<
>(
? -
1
:
0
),
static_cast
<
>(
))
{
();
=
0
;
}
(
const
&
)
: _Myvec(
.
),
_Mysize(
.
)
{
();
}
(
const
&
,
const
&
)
: _Myvec(
.
,
static_cast
<
>(
)),
_Mysize(
.
)
{
();
}
_Vb_val(_Vb_val&& _Right) _NOEXCEPT_COND(is_nothrow_move_constructible_v<_Vectype>)
(
&&
)
noexcept
(
is_nothrow_move_constructible_v
<
>)
: _Myvec(_STD move(_Right._Myvec)),
_Mysize(
.
)
{
.
=
0
;
();
}
(
&&
,
const
&
)
_NOEXCEPT_COND(is_nothrow_constructible_v<_Vectype, _Vectype, _Alvbase>)
noexcept
(
is_nothrow_constructible_v
<
,
,
>)
: _Myvec(_STD move(_Right._Myvec), static_cast<_Alvbase>(_Al)),
: _Myvec(::
std
::
(
.
),
static_cast
<
>(
)),
_Mysize(
.
)
{
.
=
0
;
();
}
()
noexcept
{
();
}
#if _ITERATOR_DEBUG_LEVEL == 0
void _Alloc_proxy()
{ // do nothing
}
void _Free_proxy()
{ // do nothing
}
#else /* _ITERATOR_DEBUG_LEVEL == 0 */
void
()
{
(
.
());
this
->
=
(
_Proxy_allocator
.
(
1
));
::
(
_Proxy_allocator
,
this
->
,
());
this
->
->
=
this
;
}
void
()
{
(
.
());
this
->
();
::
(
_Proxy_allocator
,
this
->
);
(
_Proxy_allocator
,
this
->
);
this
->
=
nullptr
;
}
#endif /* _ITERATOR_DEBUG_LEVEL == 0 */
static
(
)
{
return
((
+
_VBITS
-
1
) /
_VBITS
);
}
;
;
};
template
<
class
>
class
<
bool
,
>
:
public
<
>
{
public
:
static_assert(!_ENFORCE_MATCHING_ALLOCATORS || is_same_v<bool, typename _Alloc::value_type>,
static_assert
(!
0
||
<
bool
,
typename
::value_type>,
_MISMATCHED_ALLOCATOR_MESSAGE("vector<bool, Allocator>", "bool"));
"vector<bool, Allocator>"
" requires that Allocator's value_type match "
"bool"
" (See N4659 26.2.1 [container.requirements.general]/16 allocator_type)"
" Either fix the allocator value_type or define _ENFORCE_MATCHING_ALLOCATORS=0"
" to suppress this diagnostic."
);
using
=
<
>;
using
=
typename
::
;
using
=
typename
::
;
using
=
typename
::
;
using
=
typename
::
;
using
=
typename
::
;
using
=
;
using
=
<
>;
using
=
bool
;
using
=
bool
;
using
=
;
using
=
<
>;
using
=
<
>;
using
=
;
using
=
;
using reverse_iterator = _STD reverse_iterator<iterator>;
using const_reverse_iterator = _STD reverse_iterator<const_iterator>;
static const int _VBITS = _STD _VBITS;
static
const
int
= ::
std
::
_VBITS
;
enum
{
=
};
vector() _NOEXCEPT_COND(is_nothrow_default_constructible_v<_Mybase>) // strengthened
()
noexcept
(
is_nothrow_default_constructible_v
<
>)
:
()
{
}
explicit
(
const
&
)
_NOEXCEPT_COND(is_nothrow_constructible_v<_Mybase, const _Alloc&>) // strengthened
noexcept
(
is_nothrow_constructible_v
<
,
const
&>)
:
(
)
{
}
explicit vector(_CRT_GUARDOVERFLOW size_type _Count, const _Alloc& _Al = _Alloc())
explicit
(
__declspec
(guard(overflow))
,
const
&
=
())
:
(
,
false
,
)
{
(
);
}
vector(_CRT_GUARDOVERFLOW size_type _Count, const bool& _Val, const _Alloc& _Al = _Alloc())
(
__declspec
(guard(overflow))
,
const
bool
&
,
const
&
=
())
:
(
,
,
)
{
(
);
}
(
const
&
)
:
(
)
{
}
(
const
&
,
const
&
)
:
(
,
)
{
}
template
<
class
,
class
=
<
<
>>>
(
,
,
const
&
=
())
:
(
)
{
(
,
);
}
template
<
class
>
void
(
,
)
{
(
(),
,
);
}
(
&&
)
_NOEXCEPT_COND(is_nothrow_move_constructible_v<_Mybase>) // strengthened
noexcept
(
is_nothrow_move_constructible_v
<
>)
: _Mybase(_STD move(_Right))
{
this
->
(
);
}
(
&&
,
const
&
)
_NOEXCEPT_COND(is_nothrow_constructible_v<_Mybase, _Mybase, const _Alloc&>)
noexcept
(
is_nothrow_constructible_v
<
,
,
const
&>)
: _Mybase(_STD move(_Right), _Al)
{
const
bool
=
::
::
||
this
->
.
() ==
.
.
();
if
(
_Swap_iterators
)
{
this
->
(
);
}
}
&
(
&&
)
_NOEXCEPT_COND(is_nothrow_move_assignable_v<_Mybase>) // strengthened
noexcept
(
is_nothrow_move_assignable_v
<
>)
{
if (this != _STD addressof(_Right))
{
();
const
bool
=
::
propagate_on_container_move_assignment
::
&& !
::
::
&&
this
->
.
() !=
.
.
();
if
(
_Reload
)
{
this
->
();
}
this->_Myvec = _STD move(_Right._Myvec);
if
(
_Reload
)
{
this
->
();
}
this
->
=
.
;
.
=
0
;
const
bool
=
::
::
||
this
->
.
() ==
.
.
();
if
(
_Swap_iterators
)
{
this
->
(
);
}
}
return
(*
this
);
}
template
<
class
...
>
decltype
(
auto
)
(
&&...
)
{
bool _Tmp(_STD forward<_Valty>(_Val)...);
(
_Tmp
);
#if _HAS_CXX17
return (back());
#endif /* _HAS_CXX17 */
}
template
<
class
...
>
(
,
&&...
)
{
bool _Tmp(_STD forward<_Valty>(_Val)...);
return
(
(
,
_Tmp
));
}
(
<
bool
>
,
const
&
=
())
:
(
0
,
false
,
)
{
(
(),
.
(),
.
());
}
&
(
<
bool
>
)
{
(
.
(),
.
());
return
(*
this
);
}
void
(
<
bool
>
)
{
(
.
(),
.
());
}
(
,
<
bool
>
)
{
return
(
(
,
.
(),
.
()));
}
()
noexcept
{
}
&
(
const
&
)
{
if (this != _STD addressof(_Right))
{
this
->
();
const
bool
=
::
propagate_on_container_copy_assignment
::
&&
this
->
.
() !=
.
.
();
if
(
_Reload
)
{
this
->
();
}
this
->
.
;
if
(
_Reload
)
{
this
->
();
}
this
->
=
.
;
}
return
(*
this
);
}
void reserve(_CRT_GUARDOVERFLOW size_type _Count)
void
(
__declspec
(guard(overflow))
)
{
this
->
.
(
this
->
(
));
}
_NODISCARD size_type capacity() const noexcept
{
return
(
this
->
.
() *
);
}
_NODISCARD iterator begin() noexcept
{
return
(
(
this
->
.
(),
this
));
}
_NODISCARD const_iterator begin() const noexcept
{
return
(
(
this
->
.
(),
this
));
}
_NODISCARD iterator end() noexcept
{
return
(
()
static_cast
<
>(
this
->
));
}
_NODISCARD const_iterator end() const noexcept
{
return
(
()
static_cast
<
>(
this
->
));
}
_NODISCARD const_iterator cbegin() const noexcept
{
return
(
());
}
_NODISCARD const_iterator cend() const noexcept
{
return
(
());
}
_NODISCARD const_reverse_iterator crbegin() const noexcept
{
return
(
());
}
_NODISCARD const_reverse_iterator crend() const noexcept
{
return
(
());
}
void
()
{
if
(
this
->
.
()
this
->
.
())
{
this
->
();
this
->
.
();
}
}
(
)
{
=
();
if
(
0
this
->
)
_Tmp
();
return
(
_Tmp
);
}
_NODISCARD reverse_iterator rbegin() noexcept
{
return
(
(
()));
}
_NODISCARD const_reverse_iterator rbegin() const noexcept
{
return
(
(
()));
}
_NODISCARD reverse_iterator rend() noexcept
{
return
(
(
()));
}
_NODISCARD const_reverse_iterator rend() const noexcept
{
return
(
(
()));
}
void resize(_CRT_GUARDOVERFLOW size_type _Newsize, bool _Val = false)
void
(
__declspec
(guard(overflow))
,
bool
=
false
)
{
if
(
()
)
(
(),
-
(),
);
else
if
(
())
(
()
static_cast
<
>(
),
());
}
_NODISCARD size_type size() const noexcept
{
return
(
this
->
);
}
_NODISCARD size_type max_size() const noexcept
{
constexpr
=
static_cast
<
>((
<
>::
)());
const
=
this
->
.
();
if
(
_Ints_max
>
_Diff_max
/
)
{
return
(
_Diff_max
);
}
return
(
_Ints_max
*
);
}
_NODISCARD bool empty() const noexcept
{
return
(
()
0
);
}
_NODISCARD allocator_type get_allocator() const noexcept
{
return
(
static_cast
<
>(
this
->
.
()));
}
_NODISCARD const_reference at(size_type _Off) const
{
if
(
() <=
)
();
return
((*
this
)
]);
}
_NODISCARD reference at(size_type _Off)
{
if
(
() <=
)
();
return
((*
this
)
]);
}
_NODISCARD const_reference operator[](size_type _Off) const
{
=
();
_It
.
(
);
return
(
_It
);
}
_NODISCARD reference operator[](size_type _Off)
{
=
();
_It
.
(
);
return
(
_It
);
}
_NODISCARD reference front()
{
return
(
());
}
_NODISCARD const_reference front() const
{
return
(
());
}
_NODISCARD reference back()
{
return
(
(
()
1
));
}
_NODISCARD const_reference back() const
{
return
(
(
()
1
));
}
void
(
const
bool
&
)
{
(
(),
);
}
void
()
{
(
()
1
);
}
template
<
class
,
class
=
<
<
>>>
void
(
,
)
{
(
(),
());
(
(),
,
);
}
void assign(_CRT_GUARDOVERFLOW size_type _Count, const bool& _Val)
void
(
__declspec
(guard(overflow))
,
const
bool
&
)
{
(
(),
());
(
(),
,
);
}
(
,
const
bool
&
)
{
return
(
(
,
static_cast
<
>(
1
),
));
}
iterator insert(const_iterator _Where, _CRT_GUARDOVERFLOW size_type _Count,
(
,
__declspec
(guard(overflow))
,
const
bool
&
)
{
return
(
(
,
,
));
}
template
<
class
,
class
=
<
<
>>>
(
,
,
)
{
=
();
(
,
,
,
<
>());
return
(
()
_Off
);
}
template
<
class
>
void
(
,
,
,
)
{
=
();
for
(;
!=
; ++
, (
void
)++
_Off
)
(
()
_Off
, *
);
}
template
<
class
>
void
(
,
,
,
)
{
(
,
);
size_type _Count = _Convert_size<size_type>(static_cast<size_t>(_STD distance(_First, _Last)));
=
<
>(
static_cast
<
>(::
std
::
(
,
)));
=
(
,
_Count
);
(
(
),
(
),
()
static_cast
<
>(
_Off
));
}
(
)
{
=
(
);
=
_Where
();
#if _ITERATOR_DEBUG_LEVEL == 2
_STL_VERIFY(end() > _Where, "vector<bool> erase iterator outside range");
do
{
if
(
()
_Where
) { }
else
{
do
{ (
void
) ((
1
(
2
,
"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\vector"
,
3026
,
0
,
"%s"
,
"vector<bool> erase iterator outside range"
)) || (__debugbreak(),
0
)); ::
(
L"\"vector<bool> erase iterator outside range\""
, __LPREFIX( __FUNCTION__),
L"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\vector"
,
3026
,
0
); }
while
(
false
); } ; }
while
(
false
);
_STD copy(_Where + 1, end(), _Where);
::
std
::
(
_Where
1
,
(),
_Where
);
(
static_cast
<
>(
_Off
),
this
->
);
#else /* _ITERATOR_DEBUG_LEVEL == 2 */
_STD copy(_Where + 1, end(), _Where);
#endif /* _ITERATOR_DEBUG_LEVEL == 2 */
(
this
->
-
1
);
return
(
()
_Off
);
}
(
,
)
{
=
(
);
=
(
);
=
_First
();
if
(
_First
_Last
)
{
#if _ITERATOR_DEBUG_LEVEL == 2
_STL_VERIFY(_Last >= _First && end() >= _Last, "vector<bool> erase iterator outside range");
do
{
if
(
_Last
_First
&&
() >=
_Last
) { }
else
{
do
{ (
void
) ((
1
(
2
,
"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\vector"
,
3048
,
0
,
"%s"
,
"vector<bool> erase iterator outside range"
)) || (__debugbreak(),
0
)); ::
(
L"\"vector<bool> erase iterator outside range\""
, __LPREFIX( __FUNCTION__),
L"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\vector"
,
3048
,
0
); }
while
(
false
); } ; }
while
(
false
);
iterator _Next = _STD copy(_Last, end(), _First);
= ::
std
::
(
_Last
,
(),
_First
);
const
auto
=
static_cast
<
>(
_Next
());
(
_Newsize
,
this
->
);
(
_Newsize
);
#else /* _ITERATOR_DEBUG_LEVEL == 2 */
iterator _Next = _STD copy(_Last, end(), _First);
_Trim(static_cast<size_type>(_Next - begin()));
#endif /* _ITERATOR_DEBUG_LEVEL == 2 */
}
return
(
()
_Off
);
}
void
()
noexcept
{
(
(),
());
}
void
()
noexcept
{
for
(
auto
&
:
this
->
)
{
_Elem
= ~
_Elem
;
}
(
this
->
);
}
void
(
&
)
noexcept
{
if (this != _STD addressof(_Right))
{
this
->
(
);
this
->
.
(
.
);
_STD swap(this->_Mysize, _Right._Mysize);
}
}
static
void
(
,
)
noexcept
{
bool
=
;
;
_Val
;
}
friend
<
<
bool
,
>>;
(
,
,
const
bool
&
)
{
=
(
,
);
const
auto
=
()
static_cast
<
>(
_Off
);
_STD fill(_Result, _Result + static_cast<difference_type>(_Count), _Val);
::
std
::
(
_Result
,
_Result
static_cast
<
>(
),
);
return
(
_Result
);
}
(
,
)
{
=
();
#if _ITERATOR_DEBUG_LEVEL == 2
_STL_VERIFY(end() >= _Where, "vector<bool> insert iterator outside range");
do
{
if
(
()
) { }
else
{
do
{ (
void
) ((
1
(
2
,
"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\vector"
,
3110
,
0
,
"%s"
,
"vector<bool> insert iterator outside range"
)) || (__debugbreak(),
0
)); ::
(
L"\"vector<bool> insert iterator outside range\""
, __LPREFIX( __FUNCTION__),
L"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\vector"
,
3110
,
0
); }
while
(
false
); } ; }
while
(
false
);
bool
=
() -
()
;
#endif /* _ITERATOR_DEBUG_LEVEL == 2 */
if
(
0
)
{
if
(
() -
()
)
{
();
}
this
->
.
(
this
->
(
() +
),
0
);
if
(
())
{
this
->
+=
;
}
else
{
=
();
this
->
+=
;
_STD copy_backward(begin() + _Off, _Oldend, end());
::
std
::
(
()
_Off
,
_Oldend
,
());
}
#if _ITERATOR_DEBUG_LEVEL == 2
(
static_cast
<
>(
_Realloc
?
0
:
_Off
),
this
->
);
#endif /* _ITERATOR_DEBUG_LEVEL == 2 */
}
return
(
static_cast
<
>(
_Off
));
}
#if _ITERATOR_DEBUG_LEVEL == 2
void
(
,
)
const
{
_Lockit _Lock(_LOCK_DEBUG);
auto
=
const_cast
<
*>(
this
->
.
());
**
= (
**)
this
->
();
if
(
_Pnext
!=
nullptr
)
while
(*
_Pnext
!=
nullptr
)
{
=
static_cast
<
>(
* ((*
_Pnext
)->
-
_Base
))
+ (*
_Pnext
)->
;
if
(
_Off
||
_Off
)
_Pnext
= (
**)(*
_Pnext
)->
();
else
{
(*
_Pnext
)->
();
*
_Pnext
= *(
**)(*
_Pnext
)->
();
}
}
}
#else /* _ITERATOR_DEBUG_LEVEL == 2 */
void _Orphan_range(size_type, size_type) const
{ // orphan iterators within specified (inclusive) range
}
#endif /* _ITERATOR_DEBUG_LEVEL == 2 */
void
(
)
{
if
(
()
)
();
const
=
this
->
(
);
if
(
_Words
this
->
.
())
this
->
.
(
this
->
.
()
static_cast
<
>(
_Words
),
this
->
.
());
this
->
=
;
%=
;
if
(
0
)
this
->
_Words
-
1
] &= (
static_cast
<
>(
1
) <<
) -
1
;
}
[[noreturn]]
void
()
const
{
(
"vector<bool> too long"
);
}
[[noreturn]]
void
()
const
{
(
"invalid vector<bool> subscript"
);
}
};
template
<
class
>
_NODISCARD inline bool operator==(const vector<bool, _Alloc>& _Left,
inline
bool
(
const
<
bool
,
>&
,
const
<
bool
,
>&
)
{
return
(
.
()
.
()
&&
.
==
.
);
}
template
<
class
>
_NODISCARD inline bool operator!=(const vector<bool, _Alloc>& _Left,
inline
bool
(
const
<
bool
,
>&
,
const
<
bool
,
>&
)
{
return
(!(
));
}
template
<
class
>
struct
<
<
bool
,
>>
{
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef vector<bool, _Alloc> argument_type;
_CXX17_DEPRECATE_ADAPTOR_TYPEDEFS typedef size_t result_type;
_NODISCARD size_t operator()(const vector<bool, _Alloc>& _Keyval) const noexcept
(
const
<
bool
,
>&
)
const
noexcept
{
return
(
_Hash_array_representation
(
.
.
(),
.
.
()));
}
};
#if _HAS_CXX17
namespace pmr {
template<class _Ty>
using vector = _STD vector<_Ty, polymorphic_allocator<_Ty>>;
} // namespace pmr
#endif /* _HAS_CXX17 */
#pragma pop_macro("new")
_STL_RESTORE_CLANG_WARNINGS
#pragma warning(pop)
#pragma warning(pop)
#pragma pack(pop)
#endif /* RC_INVOKED */
#endif /* _VECTOR_ */
#pragma pack(pop)