#pragma once
#ifndef _SET_
#define _SET_
#ifndef RC_INVOKED
#include <xtree>
#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
,
class
,
bool
>
class
{
public
:
using
=
;
using
=
;
using
=
;
using
=
;
#if _HAS_CXX17
using node_type = _Node_handle<
_Tree_node<value_type, typename allocator_traits<_Alloc>::void_pointer>,
_Alloc, _Node_handle_set_base, _Kty>;
#endif /* _HAS_CXX17 */
enum
{
=
};
using
=
;
static
const
&
(
const
&
)
{
return
(
);
}
};
template
<
class
,
class
=
<
>,
class
=
<
>>
class
:
public
<
<
,
,
,
false
>>
{
public
:
static_assert(!_ENFORCE_MATCHING_ALLOCATORS || is_same_v<_Kty, typename _Alloc::value_type>,
static_assert
(!
0
||
<
,
typename
::value_type>,
_MISMATCHED_ALLOCATOR_MESSAGE("set<T, Compare, Allocator>", "T"));
"set<T, Compare, 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
=
<
<
,
,
,
false
>>;
using
=
;
using
=
;
using
=
typename
::
;
using
=
typename
::
;
using
=
typename
::
;
using
=
typename
::
;
using
=
typename
::
;
using
=
typename
::
;
using
=
typename
::
;
using
=
&;
using
=
const
&;
using
=
typename
::
;
using
=
typename
::
;
using
=
typename
::
;
using
=
typename
::
;
using
=
typename
::
;
using
=
typename
::
;
#if _HAS_CXX17
using insert_return_type = _Insert_return_type<iterator, typename _Mybase::node_type>;
#endif /* _HAS_CXX17 */
()
:
(
())
{
}
explicit
(
const
&
)
:
(
(),
)
{
}
(
const
&
)
:
(
,
::
select_on_container_copy_construction
(
.
()))
{
}
(
const
&
,
const
&
)
:
(
,
)
{
}
explicit
(
const
&
)
:
(
)
{
}
(
const
&
,
const
&
)
:
(
,
)
{
}
template
<
class
>
(
,
)
:
(
())
{
this
->
(
,
);
}
template
<
class
>
(
,
,
const
&
)
:
(
)
{
this
->
(
,
);
}
template
<
class
>
(
,
,
const
&
)
:
(
(),
)
{
this
->
(
,
);
}
template
<
class
>
(
,
,
const
&
,
const
&
)
:
(
,
)
{
this
->
(
,
);
}
&
(
const
&
)
{
::
);
return
(*
this
);
}
(
&&
)
: _Mybase(_STD move(_Right))
{
}
(
&&
,
const
&
)
: _Mybase(_STD move(_Right), _Al)
{
}
&
(
&&
)
_NOEXCEPT_COND(_Alnode_traits::is_always_equal::value
&& is_nothrow_move_assignable_v<_Pr>)
noexcept
(
::
::
&&
is_nothrow_move_assignable_v
<
>)
{
_Mybase::operator=(_STD move(_Right));
return
(*
this
);
}
void
(
&
)
_NOEXCEPT_COND(_NOEXCEPT_OPER(_Mybase::swap(_Right))) // strengthened
{
::
(
);
}
(
<
>
)
:
(
())
{
this
->
(
);
}
(
<
>
,
const
&
)
:
(
)
{
this
->
(
);
}
(
<
>
,
const
&
)
:
(
(),
)
{
this
->
(
);
}
(
<
>
,
const
&
,
const
&
)
:
(
,
)
{
this
->
(
);
}
&
(
<
>
)
{
this
->
();
this
->
(
);
return
(*
this
);
}
using
::
;
using
::
;
};
#if _HAS_CXX17
template<class _Iter,
class _Pr = less<_Iter_value_t<_Iter>>,
class _Alloc = allocator<_Iter_value_t<_Iter>>,
enable_if_t<conjunction_v<
_Is_iterator<_Iter>,
negation<_Is_allocator<_Pr>>,
_Is_allocator<_Alloc>
>, int> = 0>
set(_Iter, _Iter, _Pr = _Pr(), _Alloc = _Alloc())
-> set<_Iter_value_t<_Iter>, _Pr, _Alloc>;
template<class _Kty,
class _Pr = less<_Kty>,
class _Alloc = allocator<_Kty>,
enable_if_t<conjunction_v<
negation<_Is_allocator<_Pr>>,
_Is_allocator<_Alloc>
>, int> = 0>
set(initializer_list<_Kty>, _Pr = _Pr(), _Alloc = _Alloc())
-> set<_Kty, _Pr, _Alloc>;
template<class _Iter,
class _Alloc,
enable_if_t<conjunction_v<
_Is_iterator<_Iter>,
_Is_allocator<_Alloc>
>, int> = 0>
set(_Iter, _Iter, _Alloc)
-> set<_Iter_value_t<_Iter>, less<_Iter_value_t<_Iter>>, _Alloc>;
template<class _Kty,
class _Alloc,
enable_if_t<_Is_allocator<_Alloc>::value, int> = 0>
set(initializer_list<_Kty>, _Alloc)
-> set<_Kty, less<_Kty>, _Alloc>;
#endif /* _HAS_CXX17 */
template
<
class
,
class
,
class
>
inline
void
(
<
,
,
>&
,
<
,
,
>&
)
_NOEXCEPT_COND(_NOEXCEPT_OPER(_Left.swap(_Right)))
{
.
(
);
}
template
<
class
,
class
=
<
>,
class
=
<
>>
class
:
public
<
<
,
,
,
true
>>
{
public
:
static_assert(!_ENFORCE_MATCHING_ALLOCATORS || is_same_v<_Kty, typename _Alloc::value_type>,
static_assert
(!
0
||
<
,
typename
::value_type>,
_MISMATCHED_ALLOCATOR_MESSAGE("multiset<T, Compare, Allocator>", "T"));
"multiset<T, Compare, 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
=
<
<
,
,
,
true
>>;
using
=
;
using
=
;
using
=
typename
::
;
using
=
typename
::
;
using
=
typename
::
;
using
=
typename
::
;
using
=
typename
::
;
using
=
typename
::
;
using
=
typename
::
;
using
=
&;
using
=
const
&;
using
=
typename
::
;
using
=
typename
::
;
using
=
typename
::
;
using
=
typename
::
;
using
=
typename
::
;
using
=
typename
::
;
()
:
(
())
{
}
explicit
(
const
&
)
:
(
(),
)
{
}
(
const
&
)
:
(
,
::
select_on_container_copy_construction
(
.
()))
{
}
(
const
&
,
const
&
)
:
(
,
)
{
}
explicit
(
const
&
)
:
(
)
{
}
(
const
&
,
const
&
)
:
(
,
)
{
}
template
<
class
>
(
,
)
:
(
())
{
this
->
(
,
);
}
template
<
class
>
(
,
,
const
&
)
:
(
)
{
this
->
(
,
);
}
template
<
class
>
(
,
,
const
&
)
:
(
(),
)
{
this
->
(
,
);
}
template
<
class
>
(
,
,
const
&
,
const
&
)
:
(
,
)
{
this
->
(
,
);
}
&
(
const
&
)
{
::
);
return
(*
this
);
}
(
&&
)
: _Mybase(_STD move(_Right))
{
}
(
&&
,
const
&
)
: _Mybase(_STD move(_Right), _Al)
{
}
&
(
&&
)
_NOEXCEPT_COND(_Alnode_traits::is_always_equal::value
&& is_nothrow_move_assignable_v<_Pr>)
noexcept
(
::
::
&&
is_nothrow_move_assignable_v
<
>)
{
_Mybase::operator=(_STD move(_Right));
return
(*
this
);
}
template
<
class
...
>
(
&&...
)
{
return (_Mybase::emplace(_STD forward<_Valty>(_Val)...).first);
return
(
::
(::
std
::
<
>(
)...).first);
}
void
(
&
)
_NOEXCEPT_COND(_NOEXCEPT_OPER(_Mybase::swap(_Right))) // strengthened
{
::
(
);
}
(
<
>
)
:
(
())
{
this
->
(
);
}
(
<
>
,
const
&
)
:
(
)
{
this
->
(
);
}
(
<
>
,
const
&
)
:
(
(),
)
{
this
->
(
);
}
(
<
>
,
const
&
,
const
&
)
:
(
,
)
{
this
->
(
);
}
&
(
<
>
)
{
this
->
();
this
->
(
);
return
(*
this
);
}
using
::
;
using
::
;
};
#if _HAS_CXX17
template<class _Iter,
class _Pr = less<_Iter_value_t<_Iter>>,
class _Alloc = allocator<_Iter_value_t<_Iter>>,
enable_if_t<conjunction_v<
_Is_iterator<_Iter>,
negation<_Is_allocator<_Pr>>,
_Is_allocator<_Alloc>
>, int> = 0>
multiset(_Iter, _Iter, _Pr = _Pr(), _Alloc = _Alloc())
-> multiset<_Iter_value_t<_Iter>, _Pr, _Alloc>;
template<class _Kty,
class _Pr = less<_Kty>,
class _Alloc = allocator<_Kty>,
enable_if_t<conjunction_v<
negation<_Is_allocator<_Pr>>,
_Is_allocator<_Alloc>
>, int> = 0>
multiset(initializer_list<_Kty>, _Pr = _Pr(), _Alloc = _Alloc())
-> multiset<_Kty, _Pr, _Alloc>;
template<class _Iter,
class _Alloc,
enable_if_t<conjunction_v<
_Is_iterator<_Iter>,
_Is_allocator<_Alloc>
>, int> = 0>
multiset(_Iter, _Iter, _Alloc)
-> multiset<_Iter_value_t<_Iter>, less<_Iter_value_t<_Iter>>, _Alloc>;
template<class _Kty,
class _Alloc,
enable_if_t<_Is_allocator<_Alloc>::value, int> = 0>
multiset(initializer_list<_Kty>, _Alloc)
-> multiset<_Kty, less<_Kty>, _Alloc>;
#endif /* _HAS_CXX17 */
template
<
class
,
class
,
class
>
inline
void
(
<
,
,
>&
,
<
,
,
>&
)
_NOEXCEPT_COND(_NOEXCEPT_OPER(_Left.swap(_Right)))
{
.
(
);
}
#if _HAS_CXX17
namespace pmr {
template<class _Kty,
class _Pr = less<_Kty>>
using set = _STD set<_Kty, _Pr, polymorphic_allocator<_Kty>>;
template<class _Kty,
class _Pr = less<_Kty>>
using multiset = _STD multiset<_Kty, _Pr, polymorphic_allocator<_Kty>>;
} // 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 /* _SET_ */
#pragma pack(pop)