#pragma once
#ifndef _XMEMORY0_
#define _XMEMORY0_
#ifndef RC_INVOKED
#include <cstdint> /* for uintptr_t */
#include <cstdlib>
#include <limits>
#include <new>
#include <xutility>
#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
<
>
inline
(
const
)
{
constexpr
=
static_cast
<
>(-
1
) /
;
=
*
;
if
(
_Max_possible
)
{
_Result
=
static_cast
<
>(-
1
);
}
return
(
_Result
);
}
template
<>
inline
<
1
>(
const
)
{
return
(
);
}
template
<
class
>
_INLINE_VAR constexpr size_t _New_alignof = _Max_value(alignof(_Ty),
static_cast<size_t>(__STDCPP_DEFAULT_NEW_ALIGNMENT__) // TRANSITION, VSO#522105
);
struct
{
_DECLSPEC_ALLOCATOR static void * _Allocate(const size_t _Bytes)
__declspec
(allocator)
static
void
*
(
const
)
{
return
(::
));
}
#if _HAS_ALIGNED_NEW
_DECLSPEC_ALLOCATOR static void * _Allocate_aligned(const size_t _Bytes, const size_t _Align)
{
return (::operator new(_Bytes, align_val_t{_Align}));
}
#endif /* _HAS_ALIGNED_NEW */
};
constexpr
bool
(
const
)
noexcept
{
return
(
0
&& (
& (
-
1
))
0
);
}
#if defined(_M_IX86) || defined(_M_X64)
constexpr
_Big_allocation_threshold
=
4096
;
constexpr
_Big_allocation_alignment
=
32
;
static_assert
(
2
*
sizeof
(
void
*) <=
_Big_allocation_alignment
,
"Big allocation alignment should at least match vector register alignment"
);
static_assert
(
(
_Big_allocation_alignment
),
"Big allocation alignment must be a power of two"
);
#ifdef _DEBUG
constexpr
=
2
*
sizeof
(
void
*) +
_Big_allocation_alignment
-
1
;
#else /* _DEBUG */
constexpr size_t _Non_user_size = sizeof(void *) + _Big_allocation_alignment - 1;
#endif /* _DEBUG */
#ifdef _WIN64
constexpr size_t _Big_allocation_sentinel = 0xFAFAFAFAFAFAFAFAULL;
#else /* ^^^ _WIN64 ^^^ // vvv !_WIN64 vvv */
constexpr
=
0xFAFAFAFAUL
;
#endif /* _WIN64 */
template
<
class
>
inline
_DECLSPEC_ALLOCATOR void * _Allocate_manually_vector_aligned(const size_t _Bytes)
__declspec
(allocator)
void
*
_Allocate_manually_vector_aligned
(
const
)
{
=
_Non_user_size
+
;
if
(
_Block_size
<=
)
{
_Block_size
=
static_cast
<
>(-
1
);
}
const
=
reinterpret_cast
<
>(
::_Allocate(
_Block_size
));
_STL_VERIFY(_Ptr_container != 0, "invalid argument"); // validate even in release since we're doing p[-1]
do
{
if
(
_Ptr_container
0
) { }
else
{
do
{ (
void
) ((
1
(
2
,
"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\xmemory0"
,
101
,
0
,
"%s"
,
"invalid argument"
)) || (__debugbreak(),
0
)); ::
(
L"\"invalid argument\""
, __LPREFIX( __FUNCTION__),
L"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\xmemory0"
,
101
,
0
); }
while
(
false
); } ; }
while
(
false
);
void
*
const
=
reinterpret_cast
<
void
*>((
_Ptr_container
+
_Non_user_size
)
& ~(
_Big_allocation_alignment
-
1
));
static_cast
<
*>(
_Ptr
)[-
1
] =
_Ptr_container
;
#ifdef _DEBUG
static_cast
<
*>(
_Ptr
)[-
2
] =
_Big_allocation_sentinel
;
#endif /* _DEBUG */
return
(
_Ptr
);
}
inline
void
_Adjust_manually_vector_aligned
(
void
*&
,
&
)
{
+=
_Non_user_size
;
const
*
const
=
reinterpret_cast
<
*>(
);
const
=
_Ptr_user
[-
1
];
_STL_ASSERT(_Ptr_user[-2] == _Big_allocation_sentinel, "invalid argument");
do
{
if
(
_Ptr_user
[-
2
]
_Big_allocation_sentinel
) { }
else
{
do
{ (
void
) ((
1
(
2
,
"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\xmemory0"
,
122
,
0
,
"%s"
,
"invalid argument"
)) || (__debugbreak(),
0
)); ::
(
L"\"invalid argument\""
, __LPREFIX( __FUNCTION__),
L"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\xmemory0"
,
122
,
0
); }
while
(
false
); } ; }
while
(
false
);
#ifdef _DEBUG
constexpr
=
2
*
sizeof
(
void
*);
#else /* ^^^ _DEBUG ^^^ // vvv !_DEBUG vvv */
constexpr uintptr_t _Min_back_shift = sizeof(void *);
#endif /* _DEBUG */
const
=
reinterpret_cast
<
>(
) -
_Ptr_container
;
_STL_VERIFY(_Back_shift >= _Min_back_shift && _Back_shift <= _Non_user_size, "invalid argument");
do
{
if
(
_Back_shift
>=
_Min_back_shift
&&
_Back_shift
<=
_Non_user_size
) { }
else
{
do
{ (
void
) ((
1
(
2
,
"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\xmemory0"
,
132
,
0
,
"%s"
,
"invalid argument"
)) || (__debugbreak(),
0
)); ::
(
L"\"invalid argument\""
, __LPREFIX( __FUNCTION__),
L"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\xmemory0"
,
132
,
0
); }
while
(
false
); } ; }
while
(
false
);
=
reinterpret_cast
<
void
*>(
_Ptr_container
);
}
#endif /* defined(_M_IX86) || defined(_M_X64) */
#if _HAS_ALIGNED_NEW
template<size_t _Align,
class _Traits = _Default_allocate_traits,
enable_if_t<(_Align > __STDCPP_DEFAULT_NEW_ALIGNMENT__), int> = 0> inline
_DECLSPEC_ALLOCATOR void *_Allocate(const size_t _Bytes)
{ // allocate _Bytes when _HAS_ALIGNED_NEW && _Align > __STDCPP_DEFAULT_NEW_ALIGNMENT__
if (_Bytes == 0)
{
return (nullptr);
}
size_t _Passed_align = _Align;
#if defined(_M_IX86) || defined(_M_X64)
if (_Bytes >= _Big_allocation_threshold)
{ // boost the alignment of big allocations to help autovectorization
_Passed_align = _Max_value(_Align, _Big_allocation_alignment);
}
#endif /* defined(_M_IX86) || defined(_M_X64) */
return (_Traits::_Allocate_aligned(_Bytes, _Passed_align));
}
template<size_t _Align,
enable_if_t<(_Align > __STDCPP_DEFAULT_NEW_ALIGNMENT__), int> = 0> inline
void _Deallocate(void * _Ptr, const size_t _Bytes)
{ // deallocate storage allocated by _Allocate when _HAS_ALIGNED_NEW && _Align > __STDCPP_DEFAULT_NEW_ALIGNMENT__
size_t _Passed_align = _Align;
#if defined(_M_IX86) || defined(_M_X64)
if (_Bytes >= _Big_allocation_threshold)
{ // boost the alignment of big allocations to help autovectorization
_Passed_align = _Max_value(_Align, _Big_allocation_alignment);
}
#endif /* defined(_M_IX86) || defined(_M_X64) */
::operator delete(_Ptr, _Bytes, align_val_t{_Passed_align});
}
#endif /* _HAS_ALIGNED_NEW */
template
<
,
class
=
,
enable_if_t<(!_HAS_ALIGNED_NEW || _Align <= __STDCPP_DEFAULT_NEW_ALIGNMENT__), int> = 0> inline
<(!
0
||
<=
8u
),
int
> =
0
>
inline
_DECLSPEC_ALLOCATOR void *_Allocate(const size_t _Bytes)
__declspec
(allocator)
void
*
(
const
)
{
#if defined(_M_IX86) || defined(_M_X64)
if
(
>=
_Big_allocation_threshold
)
{
return
(
_Allocate_manually_vector_aligned
<
>(
));
}
#endif /* defined(_M_IX86) || defined(_M_X64) */
if
(
0
)
{
return
(
::_Allocate(
));
}
return
(
nullptr
);
}
template
<
,
enable_if_t<(!_HAS_ALIGNED_NEW || _Align <= __STDCPP_DEFAULT_NEW_ALIGNMENT__), int> = 0> inline
<(!
0
||
<=
8u
),
int
> =
0
>
inline
void
(
void
*
,
)
{
#if defined(_M_IX86) || defined(_M_X64)
if
(
>=
_Big_allocation_threshold
)
{
_Adjust_manually_vector_aligned
(
,
);
}
#endif /* defined(_M_IX86) || defined(_M_X64) */
::
,
);
}
template
<
class
,
class
...
>
inline
void
(
&
,
&&...
)
_NOEXCEPT_COND(is_nothrow_constructible_v<_Ty, _Types...>)
noexcept
(
is_nothrow_constructible_v
<
,
...>)
{
::new (const_cast<void *>(static_cast<const volatile void *>(_STD addressof(_Obj))))
::
new
(
const_cast
<
void
*>(
static_cast
<
const
volatile
void
*>(::
std
::
(
))))
_Ty(_STD forward<_Types>(_Args)...);
}
template
<
class
,
class
...
>
inline
*
(
&&...
)
{
void
*
const
=
<
<
>>(
sizeof
(
));
::new (_Result) _Ty(_STD forward<_Types>(_Args)...);
::
new
(
_Result
)
(::
std
::
<
>(
)...);
<
<
>>(
_Result
,
sizeof
(
));
return
(
static_cast
<
*>(
_Result
));
}
template
<
class
>
struct
;
template
<
template
<
class
,
class
...>
class
,
class
,
class
...
>
struct
<
<
,
...>>
{
using
=
;
};
template
<
class
,
class
>
struct
;
template
<
class
,
template
<
class
,
class
...>
class
,
class
,
class
...
>
struct
<
,
<
,
...>>
{
using
=
<
,
...>;
};
template
<
class
,
class
=
void
>
struct
{
using
=
typename
<
>::
;
};
template
<
class
>
struct
<
,
<
typename
::element_type>>
{
using
=
typename
::element_type;
};
template
<
class
,
class
=
void
>
struct
{
using
=
;
};
template
<
class
>
struct
<
,
<
typename
::difference_type>>
{
using
=
typename
::difference_type;
};
template
<
class
,
class
,
class
=
void
>
struct
{
using
=
typename
<
,
>::
;
};
template
<
class
,
class
>
struct
<
,
,
<
typename
::
template
rebind<
>>>
{
using
=
typename
::
template
rebind<
>;
};
template
<
class
>
struct
{
using
=
typename
<
>::
;
using
=
;
using
=
typename
<
>::
;
template
<
class
>
using
=
typename
<
,
>::
;
using
=
<
<
>,
char
&,
<
>>;
_NODISCARD static pointer pointer_to(_Reftype _Val)
{
return
(
::pointer_to(
));
}
};
template
<
class
>
struct
<
*>
{
using
=
;
using
=
*;
using
=
;
template
<
class
>
using
=
*;
using
=
<
<
>,
char
&,
<
>>;
_NODISCARD static pointer pointer_to(_Reftype _Val)
{
return (_STD addressof(_Val));
}
};
template
<
class
,
class
>
using
=
typename
<
>::
template
<
>;
template
<
class
,
<!
<
>,
int
> =
0
>
inline
(
typename
<
>::
*
)
{
return
(
<
>::
(*
));
}
template
<
class
,
<
<
>,
int
> =
0
>
inline
(
)
{
return
(
);
}
template
<
class
>
inline
void
(
&
)
noexcept
{
.~_Ty();
}
template
<
class
>
inline
auto
(
)
{
using
=
typename
<
>::
;
using
=
<
>;
using
=
typename
<
>::
template
<
>;
return
(
<
>::
(
const_cast
<
&>(*
)));
}
template
<
class
>
inline
auto
(
*
)
{
return
(
const_cast
<
<
> *>(
));
}
template
<
class
,
class
=
void
>
struct
{
using
=
typename
::value_type *;
};
#pragma warning(push)
#pragma warning(disable: 4996) // was declared deprecated
#pragma warning(disable:
4996
)
template
<
class
>
struct
<
,
<
typename
::pointer>>
{
using
=
typename
::pointer;
};
#pragma warning(pop)
template
<
class
,
class
=
void
>
struct
{
using
=
typename
<
>::
;
using
=
typename
::value_type;
using
=
typename
<
>::
template
<
const
>;
};
#pragma warning(push)
#pragma warning(disable: 4996) // was declared deprecated
#pragma warning(disable:
4996
)
template
<
class
>
struct
<
,
<
typename
::const_pointer>>
{
using
=
typename
::const_pointer;
};
#pragma warning(pop)
template
<
class
,
class
=
void
>
struct
{
using
=
typename
<
>::
;
using
=
typename
<
>::
template
<
void
>;
};
template
<
class
>
struct
<
,
<
typename
::void_pointer>>
{
using
=
typename
::void_pointer;
};
template
<
class
,
class
=
void
>
struct
_Get_const_void_pointer_type
{
using
=
typename
<
>::
;
using
=
typename
<
>::
template
<
const
void
>;
};
template
<
class
>
struct
_Get_const_void_pointer_type
<
,
<
typename
::const_void_pointer>>
{
using
=
typename
::const_void_pointer;
};
template
<
class
,
class
=
void
>
struct
{
using
=
typename
<
>::
;
using
=
typename
<
>::
;
};
#pragma warning(push)
#pragma warning(disable: 4996) // was declared deprecated
#pragma warning(disable:
4996
)
template
<
class
>
struct
<
,
<
typename
::difference_type>>
{
using
=
typename
::difference_type;
};
#pragma warning(pop)
template
<
class
,
class
=
void
>
struct
{
using
=
<
typename
<
>::
>;
};
#pragma warning(push)
#pragma warning(disable: 4996) // was declared deprecated
#pragma warning(disable:
4996
)
template
<
class
>
struct
<
,
<
typename
::size_type>>
{
using
=
typename
::size_type;
};
#pragma warning(pop)
template
<
class
,
class
=
void
>
struct
_Get_propagate_on_container_copy
{
using
=
;
};
template
<
class
>
struct
_Get_propagate_on_container_copy
<
,
<
typename
::propagate_on_container_copy_assignment>>
{
using
=
typename
::propagate_on_container_copy_assignment;
};
template
<
class
,
class
=
void
>
struct
_Get_propagate_on_container_move
{
using
=
;
};
template
<
class
>
struct
_Get_propagate_on_container_move
<
,
<
typename
::propagate_on_container_move_assignment>>
{
using
=
typename
::propagate_on_container_move_assignment;
};
template
<
class
,
class
=
void
>
struct
_Get_propagate_on_container_swap
{
using
=
;
};
template
<
class
>
struct
_Get_propagate_on_container_swap
<
,
<
typename
::propagate_on_container_swap>>
{
using
=
typename
::propagate_on_container_swap;
};
template
<
class
,
class
=
void
>
struct
{
using
=
typename
<
>::
;
};
template
<
class
>
struct
<
,
<
typename
::is_always_equal>>
{
using
=
typename
::is_always_equal;
};
template
<
class
,
class
,
class
=
void
>
struct
{
using
=
typename
<
,
>::
;
};
#pragma warning(push)
#pragma warning(disable: 4996) // was declared deprecated
#pragma warning(disable:
4996
)
template
<
class
,
class
>
struct
<
,
,
<
typename
::
template
rebind<
>::other>>
{
using
=
typename
::
template
rebind<
>::other;
};
#pragma warning(pop)
template
<
class
>
class
;
template
<
class
,
class
=
void
>
struct
:
{
};
template
<
class
>
struct
<
<
>,
typename
<
>::_Not_user_specialized>
:
{
};
template
<
class
,
class
...
>
struct
:
{
};
#pragma warning(push)
#pragma warning(disable: 4996) // was declared deprecated
#pragma warning(disable:
4996
)
template
<
class
,
class
,
class
...
>
struct
<
<
decltype(_STD declval<_Alloc&>().construct(_STD declval<_Ptr>(), _STD declval<_Args>()...))>,
decltype
(::
std
::
<
&>().construct(::
std
::
<
>(), ::
std
::
<
>()...))>,
,
,
...>
:
{
};
#pragma warning(pop)
template
<
class
,
class
,
class
...
>
using
=
<
<
>,
<
void
,
,
,
...>>;
template
<
class
,
class
,
class
...
>
using
_Uses_default_construct_t
=
typename
<
,
,
...>::
;
template
<
class
,
class
,
class
=
void
>
struct
:
{
};
#pragma warning(push)
#pragma warning(disable: 4996) // was declared deprecated
#pragma warning(disable:
4996
)
template
<
class
,
class
>
struct _Has_no_alloc_destroy<_Alloc, _Ptr, void_t<decltype(_STD declval<_Alloc&>().destroy(_STD declval<_Ptr>()))>>
struct
<
,
,
<
decltype
(::
std
::
<
&>().destroy(::
std
::
<
>()))>>
:
{
};
#pragma warning(pop)
template
<
class
,
class
>
using
=
<
<
>,
<
,
>>;
template
<
class
,
class
>
using
=
typename
<
,
>::
;
template
<
class
,
class
,
class
,
class
=
void
>
struct
:
{
};
#pragma warning(push)
#pragma warning(disable: 4996) // was declared deprecated
#pragma warning(disable:
4996
)
template
<
class
,
class
,
class
>
struct
<
,
,
,
<
decltype(_STD declval<_Alloc&>().allocate(
decltype
(::
std
::
<
&>().allocate(
_STD declval<const _Size_type&>(), _STD declval<const _Const_void_pointer&>()))>>
::
std
::
<
const
&>(), ::
std
::
<
const
&>()))>>
:
{
};
#pragma warning(pop)
template
<
class
,
class
=
void
>
struct
:
{
};
#pragma warning(push)
#pragma warning(disable: 4996) // was declared deprecated
#pragma warning(disable:
4996
)
template
<
class
>
struct _Has_max_size<_Alloc, void_t<decltype(_STD declval<const _Alloc&>().max_size())>>
struct
<
,
<
decltype
(::
std
::
<
const
&>().max_size())>>
:
{
};
#pragma warning(pop)
template
<
class
,
class
=
void
>
struct
_Has_select_on_container_copy_construction
:
{
};
template
<
class
>
struct
_Has_select_on_container_copy_construction
<
,
<
decltype(_STD declval<const _Alloc&>().select_on_container_copy_construction())>>
decltype
(::
std
::
<
const
&>().select_on_container_copy_construction())>>
:
{
};
template
<
class
>
struct
;
#pragma warning(push)
#pragma warning(disable: 4996) // was declared deprecated
#pragma warning(disable:
4996
)
template
<
class
>
struct
{
using
=
;
using
=
typename
::value_type;
using
=
typename
<
>::
;
using
=
typename
<
>::
;
using
=
typename
<
>::
;
using
=
typename
_Get_const_void_pointer_type
<
>::
;
using
=
typename
<
>::
;
using
=
typename
<
>::
;
using
propagate_on_container_copy_assignment
=
typename
_Get_propagate_on_container_copy
<
>::
;
using
propagate_on_container_move_assignment
=
typename
_Get_propagate_on_container_move
<
>::
;
using
propagate_on_container_swap
=
typename
_Get_propagate_on_container_swap
<
>::
;
using
=
typename
<
>::
;
template
<
class
>
using
=
typename
<
,
>::
;
template
<
class
>
using
=
<
<
>>;
_NODISCARD static _DECLSPEC_ALLOCATOR pointer allocate(_Alloc& _Al, _CRT_GUARDOVERFLOW const size_type _Count)
static
__declspec
(allocator)
(
&
,
__declspec
(guard(overflow))
const
)
{
return
(
.allocate(
));
}
static _DECLSPEC_ALLOCATOR pointer _Allocate1(_Alloc& _Al, _CRT_GUARDOVERFLOW const size_type _Count,
static
__declspec
(allocator)
(
&
,
__declspec
(guard(overflow))
const
,
const
,
)
{
return
(
.allocate(
,
));
}
static _DECLSPEC_ALLOCATOR pointer _Allocate1(_Alloc& _Al, _CRT_GUARDOVERFLOW const size_type _Count,
static
__declspec
(allocator)
(
&
,
__declspec
(guard(overflow))
const
,
,
)
{
return
(
.allocate(
));
}
_NODISCARD static _DECLSPEC_ALLOCATOR pointer allocate(_Alloc& _Al, _CRT_GUARDOVERFLOW const size_type _Count,
static
__declspec
(allocator)
(
&
,
__declspec
(guard(overflow))
const
,
const
)
{
return
(
(
,
,
,
<
,
,
>{}));
}
static
void
(
&
,
,
)
{
.deallocate(
,
);
}
template
<
class
,
class
...
>
static
void
(
,
&,
*
,
&&...
)
{
::new (static_cast<void *>(_Ptr)) _Ty(_STD forward<_Types>(_Args)...);
::
new
(
static_cast
<
void
*>(
))
(::
std
::
<
>(
)...);
}
template
<
class
,
class
...
>
static
void
(
,
&
,
*
,
&&...
)
{
_Al.construct(_Ptr, _STD forward<_Types>(_Args)...);
.construct(
, ::
std
::
<
>(
)...);
}
template
<
class
,
class
...
>
static
void
(
&
,
*
,
&&...
)
{
(
_Uses_default_construct_t
<
,
*,
...>(),
_Al, _Ptr, _STD forward<_Types>(_Args)...);
}
template
<
class
>
static
void
(
&,
*
,
)
{
->~_Ty();
}
template
<
class
>
static
void
(
&
,
*
,
)
{
.destroy(
);
}
template
<
class
>
static
void
(
&
,
*
)
{
(
,
,
<
,
*>());
}
static
(
const
&
,
)
noexcept
{
return
(
.max_size());
}
static
(
const
&,
)
noexcept
{
return
((
<
>::
)() /
sizeof
(
));
}
_NODISCARD static size_type max_size(const _Alloc& _Al) noexcept
static
(
const
&
)
noexcept
{
return
(
(
,
<
>{}));
}
static
_Select_on_container_copy_construction1
(
const
&
,
)
{
return
(
.select_on_container_copy_construction());
}
static
_Select_on_container_copy_construction1
(
const
&
,
)
{
return
(
);
}
_NODISCARD static _Alloc select_on_container_copy_construction(const _Alloc& _Al)
static
select_on_container_copy_construction
(
const
&
)
{
return
(
_Select_on_container_copy_construction1
(
,
_Has_select_on_container_copy_construction
<
>{}));
}
};
#pragma warning(pop)
template
<
class
>
struct
_Default_allocator_traits
{
using
=
;
using
=
typename
::value_type;
using
=
*;
using
=
const
*;
using
=
void
*;
using
=
const
void
*;
using
=
;
using
=
;
using
propagate_on_container_copy_assignment
=
;
using
propagate_on_container_move_assignment
=
;
using
propagate_on_container_swap
=
;
using
=
;
template
<
class
>
using
=
<
>;
template
<
class
>
using
=
<
<
>>;
_NODISCARD static _DECLSPEC_ALLOCATOR pointer allocate(_Alloc&, _CRT_GUARDOVERFLOW const size_type _Count)
static
__declspec
(allocator)
(
&,
__declspec
(guard(overflow))
const
)
{
return
(
static_cast
<
>(
<
<
>>(
<
sizeof
(
)>(
))));
}
_NODISCARD static _DECLSPEC_ALLOCATOR pointer allocate(_Alloc&, _CRT_GUARDOVERFLOW const size_type _Count,
static
__declspec
(allocator)
(
&,
__declspec
(guard(overflow))
const
,
)
{
return
(
static_cast
<
>(
<
<
>>(
<
sizeof
(
)>(
))));
}
static
void
(
&,
const
,
const
)
{
<
<
>>(
,
sizeof
(
) *
);
}
template
<
class
,
class
...
>
static
void
(
&,
*
const
,
&&...
)
{
::
new
(
const_cast
<
void
*>(
static_cast
<
const
volatile
void
*>(
)))
_Objty(_STD forward<_Types>(_Args)...);
}
template
<
class
>
static
void
(
&,
*
const
)
{
->~_Uty();
}
_NODISCARD static size_type max_size(const _Alloc&) noexcept
static
(
const
&)
noexcept
{
return
(
static_cast
<
>(-
1
) /
sizeof
(
));
}
_NODISCARD static _Alloc select_on_container_copy_construction(const _Alloc& _Al)
static
select_on_container_copy_construction
(
const
&
)
{
return
(
);
}
};
template
<
class
>
struct
:
<
<
>::
,
_Default_allocator_traits
<
>,
<
>>
{
};
template
<
class
>
_INLINE_VAR constexpr bool _Always_equal_after_move = allocator_traits<_Alloc>::is_always_equal::value
||
<
>::
propagate_on_container_move_assignment
::
;
template
<
class
,
class
>
using
=
typename
<
>::
template
<
>;
template
<
class
>
_INLINE_VAR constexpr bool _Is_simple_alloc_v =
<
typename
<
>::
,
>
&&
<
typename
<
>::
,
>
&&
<
typename
<
>::
,
typename
::value_type *>
&&
<
typename
<
>::
,
const
typename
::value_type *>;
template
<
class
>
struct
{
using
=
;
using
=
;
using
=
;
using
=
*;
using
=
const
*;
};
template
<
class
>
class
{
public
:
static_assert
(!
<
>,
"The C++ Standard forbids containers of const elements "
"because allocator<const T> is ill-formed."
);
using
=
void
;
using
=
;
_CXX17_DEPRECATE_OLD_ALLOCATOR_MEMBERS typedef _Ty * pointer;
_CXX17_DEPRECATE_OLD_ALLOCATOR_MEMBERS typedef const _Ty * const_pointer;
_CXX17_DEPRECATE_OLD_ALLOCATOR_MEMBERS typedef _Ty& reference;
_CXX17_DEPRECATE_OLD_ALLOCATOR_MEMBERS typedef const _Ty& const_reference;
_CXX17_DEPRECATE_OLD_ALLOCATOR_MEMBERS typedef size_t size_type;
_CXX17_DEPRECATE_OLD_ALLOCATOR_MEMBERS typedef ptrdiff_t difference_type;
using
propagate_on_container_move_assignment
=
;
using
=
;
template
<
class
>
struct _CXX17_DEPRECATE_OLD_ALLOCATOR_MEMBERS rebind
{
using
=
<
>;
};
_NODISCARD _CXX17_DEPRECATE_OLD_ALLOCATOR_MEMBERS _Ty * address(_Ty& _Val) const noexcept
{
return (_STD addressof(_Val));
}
_NODISCARD _CXX17_DEPRECATE_OLD_ALLOCATOR_MEMBERS const _Ty * address(const _Ty& _Val) const noexcept
const
*
(
const
&
)
const
noexcept
{
return (_STD addressof(_Val));
}
constexpr
()
noexcept
{
}
constexpr
(
const
&)
noexcept
=
default
;
template
<
class
>
constexpr
(
const
<
>&)
noexcept
{
}
void
(
*
const
,
const
)
{
<
<
>>(
,
sizeof
(
) *
);
}
_NODISCARD _DECLSPEC_ALLOCATOR _Ty * allocate(_CRT_GUARDOVERFLOW const size_t _Count)
__declspec
(allocator)
*
(
__declspec
(guard(overflow))
const
)
{
return
(
static_cast
<
*>(
<
<
>>(
<
sizeof
(
)>(
))));
}
_NODISCARD _CXX17_DEPRECATE_OLD_ALLOCATOR_MEMBERS _DECLSPEC_ALLOCATOR _Ty * allocate(
__declspec
(allocator)
*
(
_CRT_GUARDOVERFLOW const size_t _Count, const void *)
__declspec
(guard(overflow))
const
,
const
void
*)
{
return
(
(
));
}
template
<
class
,
class
...
>
_CXX17_DEPRECATE_OLD_ALLOCATOR_MEMBERS void construct(_Objty * const _Ptr, _Types&&... _Args)
{
::
new
(
const_cast
<
void
*>(
static_cast
<
const
volatile
void
*>(
)))
_Objty(_STD forward<_Types>(_Args)...);
}
template
<
class
>
_CXX17_DEPRECATE_OLD_ALLOCATOR_MEMBERS void destroy(_Uty * const _Ptr)
{
->~_Uty();
}
_NODISCARD _CXX17_DEPRECATE_OLD_ALLOCATOR_MEMBERS size_t max_size() const noexcept
{
return
(
static_cast
<
>(-
1
) /
sizeof
(
));
}
};
template
<>
class _CXX17_DEPRECATE_ALLOCATOR_VOID allocator<void>
{
public
:
using
=
void
;
using
=
void
*;
using
=
const
void
*;
template
<
class
>
struct
{
using
=
<
>;
};
};
template
<
class
,
class
>
_NODISCARD inline bool operator==(const allocator<_Ty>&,
const
<
>&)
noexcept
{
return
(
true
);
}
template
<
class
,
class
>
_NODISCARD inline bool operator!=(const allocator<_Ty>&,
const
<
>&)
noexcept
{
return
(
false
);
}
#if _HAS_CXX17
// ALIAS TEMPLATE _Guide_size_type_t FOR DEDUCTION GUIDES, N4687 26.5.4.1 [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;
#endif /* _HAS_CXX17 */
template
<
class
>
inline
void
(
&
,
const
&
,
)
noexcept
{
=
;
}
template
<
class
>
inline
void
(
&,
const
&,
)
noexcept
{
}
template
<
class
>
inline
void
(
&
,
const
&
)
noexcept
{
typename
<
>::
propagate_on_container_copy_assignment
;
(
,
,
_Tag
);
}
template
<
class
>
inline
void
(
&
,
&
,
)
noexcept
{
_Left = _STD move(_Right);
}
template
<
class
>
inline
void
(
&,
&,
)
noexcept
{
}
template
<
class
>
inline
void
(
&
,
&
)
noexcept
{
typename
<
>::
propagate_on_container_move_assignment
;
(
,
,
_Tag
);
}
template
<
class
>
inline
void
(
&
,
&
,
)
noexcept
{
(
,
);
}
template
<
class
>
inline
void
(
&
,
&
,
)
noexcept
{
_STL_ASSERT(_Left == _Right, "containers incompatible for swap");
do
{
if
(
==
) { }
else
{
do
{ (
void
) ((
1
(
2
,
"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\xmemory0"
,
1114
,
0
,
"%s"
,
"containers incompatible for swap"
)) || (__debugbreak(),
0
)); ::
(
L"\"containers incompatible for swap\""
, __LPREFIX( __FUNCTION__),
L"c:\\program files (x86)\\microsoft visual studio\\2017\\professional\\vc\\tools\\msvc\\14.16.27023\\include\\xmemory0"
,
1114
,
0
); }
while
(
false
); } ; }
while
(
false
);
(
void
)
;
(
void
)
;
}
template
<
class
>
inline
void
(
&
,
&
)
noexcept
{
typename
<
>::
propagate_on_container_swap
;
(
,
,
_Tag
);
}
template
<
class
>
inline
void
(
typename
<
>::
,
typename
<
>::
,
&
,
)
{
for
(;
!=
; ++
)
{
<
>::
(
,
(
));
}
}
template
<
class
>
inline
void
(
typename
<
>::
,
typename
<
>::
,
&,
)
{
}
template
<
class
>
inline
void
(
typename
<
>::
,
typename
<
>::
,
&
)
{
using
=
typename
::value_type;
(
,
,
,
<
<
is_trivially_destructible
<
>,
<
,
*>>>{});
}
template
<
class
>
inline
void
(
,
,
)
{
for
(;
!=
; ++
)
{
(*
);
}
}
template
<
class
>
inline
void
(
,
,
)
{
}
template
<
class
>
inline
void
(
,
)
{
(
,
,
is_trivially_destructible
<
<
>>());
}
template
<
class
>
inline
(
const
)
{
if
(
> (
<
>::
)())
{
(
"size_t too long for _Size_type"
);
}
return
(
static_cast
<
>(
));
}
template
<>
inline
<
>(
const
)
{
return
(
);
}
template
<
class
,
<
<
typename
<
>::
,
typename
::value_type *>,
int
> =
0
>
inline
void
(
&
,
typename
::value_type *
const
)
{
<
>::
(
,
,
1
);
}
template
<
class
,
<!
<
typename
<
>::
,
typename
::value_type *>,
int
> =
0
>
inline
void
(
&
,
typename
::value_type *
const
)
{
using
=
<
>;
using
=
<
typename
::
>;
::
(
,
::
(*
),
1
);
}
#include <xatomic0.h>
#if _USE_INTERLOCKED_REFCOUNTING
#include <intrin0.h>
#define _MT_INCR(x) \
_InterlockedIncrement(reinterpret_cast<volatile long *>(&x))
#define _MT_DECR(x) \
_InterlockedDecrement(reinterpret_cast<volatile long *>(&x))
#else /* _USE_INTERLOCKED_REFCOUNTING */
#include <xatomic.h>
#define _MT_INCR(x) \
_Inc_atomic_counter_explicit(x, memory_order_relaxed)
#define _MT_DECR(x) \
_Dec_atomic_counter_explicit(x, memory_order_acq_rel)
#endif /* _USE_INTERLOCKED_REFCOUNTING */
#pragma pop_macro("new")
_STL_RESTORE_CLANG_WARNINGS
#pragma warning(pop)
#pragma warning(pop)
#pragma pack(pop)
#endif /* RC_INVOKED */
#endif /* _XMEMORY0_ */
#pragma pack(pop)