#pragma once
#ifndef _TUPLE_
#define _TUPLE_
#ifndef RC_INVOKED
#include <new>
#include <type_traits>
#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
<
bool
,
class
,
class
...
>
struct
:
{
};
template
<
class
...
,
class
...
>
struct
<
true
,
<
...>,
...>
:
<
<
<
,
>...,
<
,
>...
>>
{
};
template
<
class
,
class
...
>
struct
:
<
<
> ==
sizeof
...(
),
,
...>::
{
};
template
<
bool
,
class
,
class
...
>
struct
:
{
};
template
<
class
...
,
class
...
>
struct
<
true
,
<
...>,
...>
:
<
<
<
,
>...,
<
<
<
,
>...>>
>>
{
};
template
<
class
,
class
...
>
struct
:
<
<
> ==
sizeof
...(
),
,
...>::
{
};
template
<
bool
,
class
,
class
...
>
struct
_Tuple_constructible_val0
:
{
};
template
<
class
...
,
class
...
>
struct
_Tuple_constructible_val0
<
true
,
<
...>,
...>
:
<
<
<
,
>...>>
{
};
template
<
class
,
class
...
>
_INLINE_VAR constexpr bool _Tuple_constructible_v =
_Tuple_constructible_val0
<
<
> ==
sizeof
...(
),
,
...>::
;
template
<
bool
,
class
,
class
...
>
struct
_Tuple_nothrow_constructible_val0
:
{
};
template
<
class
...
,
class
...
>
struct
_Tuple_nothrow_constructible_val0
<
true
,
<
...>,
...>
:
<
<
<
,
>...>>
{
};
template
<
class
,
class
...
>
_INLINE_VAR constexpr bool _Tuple_nothrow_constructible_v =
constexpr
bool
_Tuple_nothrow_constructible_v
=
_Tuple_nothrow_constructible_val0
<
<
> ==
sizeof
...(
),
,
...>::
;
template
<
bool
,
class
,
class
...
>
struct
:
{
};
template
<
class
...
,
class
...
>
struct
<
true
,
<
...>,
...>
:
<
<
<
&,
>...>>
{
};
template
<
class
,
class
...
>
_INLINE_VAR constexpr bool _Tuple_assignable_v =
<
<
> ==
sizeof
...(
),
,
...>::
;
template
<
class
,
class
...
>
struct
:
<
<
,
...>>
{
};
template
<
bool
,
class
,
class
...
>
struct
_Tuple_nothrow_assignable_val0
:
{
};
template
<
class
...
,
class
...
>
struct
_Tuple_nothrow_assignable_val0
<
true
,
<
...>,
...>
:
<
<
<
&,
>...>>
{
};
template
<
class
,
class
...
>
_INLINE_VAR constexpr bool _Tuple_nothrow_assignable_v =
constexpr
bool
_Tuple_nothrow_assignable_v
=
_Tuple_nothrow_assignable_val0
<
<
> ==
sizeof
...(
),
,
...>::
;
template
<
class
,
class
...
>
struct
:
{
};
template
<
class
,
class
>
struct
<
<
>,
>
:
<!
<
<
,
>,
<
,
const
<
>&>,
<
const
<
>&,
>>>
{
};
template
<
class
,
class
...
>
struct
:
{
};
template
<
class
,
class
>
struct
<
<
>,
>
:
<!
<
<
,
>,
<
,
<
>>,
<
<
>,
>>>
{
};
template
<
class
,
class
,
class
...
>
struct
:
{
};
template
<
class
,
class
>
struct
<
,
>
:
<!
<
,
<
<
>>>>
{
};
struct
{
template
<
class
>
constexpr
const
&
(
const
&)
const
noexcept
{
return
(*
this
);
}
};
_INLINE_VAR constexpr _Ignore ignore{};
template
<
class
>
struct
{
constexpr
()
: _Val()
{
}
template
<
class
>
constexpr
(
&&
)
: _Val(_STD forward<_Other>(_Arg))
{
}
template
<
class
,
class
...
,
<!
<
,
>,
int
> =
0
>
(
const
&,
,
&&...
)
: _Val(_STD forward<_Other>(_Arg)...)
{
}
template
<
class
,
class
...
,
<
<
<
,
>,
<
,
,
const
&,
...>
>,
int
> =
0
>
(
const
&
,
,
&&...
)
: _Val(allocator_arg, _Al, _STD forward<_Other>(_Arg)...)
: _Val(
allocator_arg
,
, ::
std
::
<
>(
)...)
{
}
template
<
class
,
class
...
,
<
<
<
,
>,
<
<
,
,
const
&,
...>>
>,
int
> =
0
>
(
const
&
,
,
&&...
)
: _Val(_STD forward<_Other>(_Arg)..., _Al)
: _Val(::
std
::
<
>(
)...,
)
{
}
;
};
struct
{
};
struct
{
};
struct
{
};
struct
{
};
template
<
class
...
>
class
;
template
<>
class
<>
{
public
:
constexpr
()
noexcept
{
}
constexpr
(
const
&)
noexcept
{
}
template
<
class
>
(
,
const
&)
noexcept
{
}
template
<
class
>
(
,
const
&,
const
&)
noexcept
{
}
template
<
class
,
<
<
,
>,
int
> =
0
>
constexpr
(
)
noexcept
{
}
template
<
class
,
class
,
<
<
,
>,
int
> =
0
>
(
,
const
&)
noexcept
{
}
void
(
&)
noexcept
{
}
constexpr
bool
(
const
&)
const
noexcept
{
return
(
true
);
}
constexpr
bool
(
const
&)
const
noexcept
{
return
(
false
);
}
};
template
<
class
,
class
...
>
class
<
,
...>
:
private
<
...>
{
public
:
typedef
;
typedef
<
...>
;
template
<
class
,
class
,
class
...
,
<
<
,
>,
int
> =
0
>
constexpr
(
,
&&
,
&&...
)
: _Mybase(_Exact_args_t{}, _STD forward<_Rest2>(_Rest_arg)...),
_Myfirst(_STD forward<_This2>(_This_arg))
{
}
template
<
class
,
class
,
...
,
<
<
,
>,
int
> =
0
>
constexpr
(
,
&&
,
<
...>);
template
<
class
,
class
,
<
<
,
>,
int
> =
0
>
constexpr
(
,
&&
)
: tuple(_Unpack_tuple_t{}, _STD forward<_Tpl>(_Right),
<
<
<
>>>{})
{
}
template
<
class
,
class
,
class
,
class
...
,
<
<
,
>,
int
> =
0
>
(
,
const
&
,
&&
,
&&...
)
: _Mybase(_Alloc_exact_args_t{}, _Al, _STD forward<_Rest2>(_Rest_arg)...),
:
(
{},
, ::
std
::
<
>(
)...),
_Myfirst(_Al, allocator_arg, _STD forward<_This2>(_This_arg))
_Myfirst(
,
allocator_arg
, ::
std
::
<
>(
))
{
}
template
<
class
,
class
,
class
,
...
,
<
<
,
>,
int
> =
0
>
inline
(
,
const
&
,
&&
,
<
...>);
template
<
class
,
class
,
class
,
<
<
,
>,
int
> =
0
>
(
,
const
&
,
&&
)
: tuple(_Alloc_unpack_tuple_t{}, _Al, _STD forward<_Tpl>(_Right),
<
<
<
>>>{})
{
}
template
<
class
=
,
<
<
<
>,
<
>...,
_Is_implicitly_default_constructible
<
>,
_Is_implicitly_default_constructible
<
>...
>,
int
> =
0
>
constexpr
()
_NOEXCEPT_COND(conjunction_v<
is_nothrow_default_constructible<_This2>,
is_nothrow_default_constructible<_Rest>...
>) // strengthened
noexcept
(
<
is_nothrow_default_constructible
<
>,
is_nothrow_default_constructible
<
>... >)
:
(), _Myfirst()
{
}
template
<
class
=
,
<
<
<
>,
<
>...,
<
<
_Is_implicitly_default_constructible
<
>,
_Is_implicitly_default_constructible
<
>...
>>>,
int
> =
0
>
constexpr
explicit
()
_NOEXCEPT_COND(conjunction_v<
is_nothrow_default_constructible<_This2>,
is_nothrow_default_constructible<_Rest>...
>) // strengthened
noexcept
(
<
is_nothrow_default_constructible
<
>,
is_nothrow_default_constructible
<
>... >)
:
(), _Myfirst()
{
}
template
<
class
=
,
<
<
,
const
&,
const
&...>::
,
int
> =
0
>
constexpr
(
const
&
,
const
&...
)
_NOEXCEPT_COND(conjunction_v<
is_nothrow_copy_constructible<_This2>,
is_nothrow_copy_constructible<_Rest>...
>) // strengthened
noexcept
(
<
is_nothrow_copy_constructible
<
>,
is_nothrow_copy_constructible
<
>... >)
:
(
{},
,
...)
{
}
template
<
class
=
,
<
<
,
const
&,
const
&...>::
,
int
> =
0
>
constexpr
explicit
(
const
&
,
const
&...
)
_NOEXCEPT_COND(conjunction_v<
is_nothrow_copy_constructible<_This2>,
is_nothrow_copy_constructible<_Rest>...
>) // strengthened
noexcept
(
<
is_nothrow_copy_constructible
<
>,
is_nothrow_copy_constructible
<
>... >)
:
(
{},
,
...)
{
}
template
<
class
,
class
...
,
<
<
<
,
,
...>,
<
,
,
...>
>,
int
> =
0
>
constexpr
(
&&
,
&&...
)
_NOEXCEPT_COND(_Tuple_nothrow_constructible_v<tuple, _This2, _Rest2...>) // strengthened
noexcept
(
_Tuple_nothrow_constructible_v
<
,
,
...>)
: tuple(_Exact_args_t{}, _STD forward<_This2>(_This_arg), _STD forward<_Rest2>(_Rest_arg)...)
:
(
{}, ::
std
::
<
>(
), ::
std
::
<
>(
)...)
{
}
template
<
class
,
class
...
,
<
<
<
,
,
...>,
<
,
,
...>
>,
int
> =
0
>
constexpr
explicit
(
&&
,
&&...
)
_NOEXCEPT_COND(_Tuple_nothrow_constructible_v<tuple, _This2, _Rest2...>) // strengthened
noexcept
(
_Tuple_nothrow_constructible_v
<
,
,
...>)
: tuple(_Exact_args_t{}, _STD forward<_This2>(_This_arg), _STD forward<_Rest2>(_Rest_arg)...)
:
(
{}, ::
std
::
<
>(
), ::
std
::
<
>(
)...)
{
}
(
const
&) =
default
;
(
&&) =
default
;
template
<
class
...
,
<
<
<
,
const
&...>,
<
,
...>
>,
int
> =
0
>
constexpr
(
const
<
...>&
)
_NOEXCEPT_COND(_Tuple_nothrow_constructible_v<tuple, const _Other&...>) // strengthened
noexcept
(
_Tuple_nothrow_constructible_v
<
,
const
&...>)
:
(
{},
)
{
}
template
<
class
...
,
<
<
<
,
const
&...>,
<
,
...>
>,
int
> =
0
>
constexpr
explicit
(
const
<
...>&
)
_NOEXCEPT_COND(_Tuple_nothrow_constructible_v<tuple, const _Other&...>) // strengthened
noexcept
(
_Tuple_nothrow_constructible_v
<
,
const
&...>)
:
(
{},
)
{
}
template
<
class
...
,
<
<
<
,
...>,
<
,
...>
>,
int
> =
0
>
constexpr
(
<
...>&&
)
_NOEXCEPT_COND(_Tuple_nothrow_constructible_v<tuple, _Other...>) // strengthened
noexcept
(
_Tuple_nothrow_constructible_v
<
,
...>)
: tuple(_Unpack_tuple_t{}, _STD move(_Right))
{
}
template
<
class
...
,
<
<
<
,
...>,
<
,
...>
>,
int
> =
0
>
constexpr
explicit
(
<
...>&&
)
_NOEXCEPT_COND(_Tuple_nothrow_constructible_v<tuple, _Other...>) // strengthened
noexcept
(
_Tuple_nothrow_constructible_v
<
,
...>)
: tuple(_Unpack_tuple_t{}, _STD move(_Right))
{
}
template
<
class
,
class
,
<
<
,
const
&,
const
&>::
,
int
> =
0
>
constexpr
(
const
<
,
>&
)
_NOEXCEPT_COND(_Tuple_nothrow_constructible_v<tuple, const _First&, const _Second&>) // strengthened
noexcept
(
_Tuple_nothrow_constructible_v
<
,
const
&,
const
&>)
:
(
{},
)
{
}
template
<
class
,
class
,
<
<
,
const
&,
const
&>::
,
int
> =
0
>
constexpr
explicit
(
const
<
,
>&
)
_NOEXCEPT_COND(_Tuple_nothrow_constructible_v<tuple, const _First&, const _Second&>) // strengthened
noexcept
(
_Tuple_nothrow_constructible_v
<
,
const
&,
const
&>)
:
(
{},
)
{
}
template
<
class
,
class
,
<
<
,
,
>::
,
int
> =
0
>
constexpr
(
<
,
>&&
)
_NOEXCEPT_COND(_Tuple_nothrow_constructible_v<tuple, _First, _Second>) // strengthened
noexcept
(
_Tuple_nothrow_constructible_v
<
,
,
>)
: tuple(_Unpack_tuple_t{}, _STD move(_Right))
{
}
template
<
class
,
class
,
<
<
,
,
>::
,
int
> =
0
>
constexpr
explicit
(
<
,
>&&
)
_NOEXCEPT_COND(_Tuple_nothrow_constructible_v<tuple, _First, _Second>) // strengthened
noexcept
(
_Tuple_nothrow_constructible_v
<
,
,
>)
: tuple(_Unpack_tuple_t{}, _STD move(_Right))
{
}
template
<
class
,
class
=
,
<
<
<
>,
<
>...
>,
int
> =
0
>
(
,
const
&
)
:
(
allocator_arg
,
), _Myfirst(
,
allocator_arg
)
{
}
template
<
class
,
class
=
,
<
<
,
const
&,
const
&...>::
,
int
> =
0
>
(
,
const
&
,
const
&
,
const
&...
)
:
(
{},
,
,
...)
{
}
template
<
class
,
class
=
,
<
<
,
const
&,
const
&...>::
,
int
> =
0
>
explicit
(
,
const
&
,
const
&
,
const
&...
)
:
(
{},
,
,
...)
{
}
template
<
class
,
class
,
class
...
,
<
<
<
,
,
...>,
<
,
,
...>
>,
int
> =
0
>
(
,
const
&
,
&&
,
&&...
)
: tuple(_Alloc_exact_args_t{}, _Al, _STD forward<_This2>(_This_arg), _STD forward<_Rest2>(_Rest_arg)...)
:
(
{},
, ::
std
::
<
>(
), ::
std
::
<
>(
)...)
{
}
template
<
class
,
class
,
class
...
,
<
<
<
,
,
...>,
<
,
,
...>
>,
int
> =
0
>
explicit
(
,
const
&
,
&&
,
&&...
)
: tuple(_Alloc_exact_args_t{}, _Al, _STD forward<_This2>(_This_arg), _STD forward<_Rest2>(_Rest_arg)...)
:
(
{},
, ::
std
::
<
>(
), ::
std
::
<
>(
)...)
{
}
template
<
class
,
class
=
,
<
<
,
const
&,
const
&...>,
int
> =
0
>
(
,
const
&
,
const
&
)
:
(
{},
,
)
{
}
template
<
class
,
class
=
,
<
<
,
,
...>,
int
> =
0
>
(
,
const
&
,
&&
)
: tuple(_Alloc_unpack_tuple_t{}, _Al, _STD move(_Right))
{
}
template
<
class
,
class
...
,
<
<
<
,
const
&...>,
<
,
...>
>,
int
> =
0
>
(
,
const
&
,
const
<
...>&
)
:
(
{},
,
)
{
}
template
<
class
,
class
...
,
<
<
<
,
const
&...>,
<
,
...>
>,
int
> =
0
>
explicit
(
,
const
&
,
const
<
...>&
)
:
(
{},
,
)
{
}
template
<
class
,
class
...
,
<
<
<
,
...>,
<
,
...>
>,
int
> =
0
>
(
,
const
&
,
<
...>&&
)
: tuple(_Alloc_unpack_tuple_t{}, _Al, _STD move(_Right))
{
}
template
<
class
,
class
...
,
<
<
<
,
...>,
<
,
...>
>,
int
> =
0
>
explicit
(
,
const
&
,
<
...>&&
)
: tuple(_Alloc_unpack_tuple_t{}, _Al, _STD move(_Right))
{
}
template
<
class
,
class
,
class
,
<
<
,
const
&,
const
&>::
,
int
> =
0
>
(
,
const
&
,
const
<
,
>&
)
:
(
{},
,
)
{
}
template
<
class
,
class
,
class
,
<
<
,
const
&,
const
&>::
,
int
> =
0
>
explicit
(
,
const
&
,
const
<
,
>&
)
:
(
{},
,
)
{
}
template
<
class
,
class
,
class
,
<
<
,
,
>::
,
int
> =
0
>
(
,
const
&
,
<
,
>&&
)
: tuple(_Alloc_unpack_tuple_t{}, _Al, _STD move(_Right))
{
}
template
<
class
,
class
,
class
,
<
<
,
,
>::
,
int
> =
0
>
explicit
(
,
const
&
,
<
,
>&&
)
: tuple(_Alloc_unpack_tuple_t{}, _Al, _STD move(_Right))
{
}
&
(
const
volatile
&) =
delete
;
template
<
class
=
,
class
=
,
<
<
<
>,
<
>...
>,
int
> =
0
>
&
(
<
const
&>
)
_NOEXCEPT_COND(conjunction_v<
is_nothrow_copy_assignable<_This2>,
is_nothrow_copy_assignable<_Rest>...
>) // strengthened
noexcept
(
<
is_nothrow_copy_assignable
<
>,
is_nothrow_copy_assignable
<
>... >)
{
.
=
._Myfirst._Val;
() =
._Get_rest();
return
(*
this
);
}
template
<
class
=
,
class
=
,
<
<
<
>,
<
>...
>,
int
> =
0
>
&
(
<
&&>
)
_NOEXCEPT_COND(conjunction_v<
is_nothrow_move_assignable<_This2>,
is_nothrow_move_assignable<_Rest>...
>)
noexcept
(
<
is_nothrow_move_assignable
<
>,
is_nothrow_move_assignable
<
>... >)
{
_Myfirst._Val = _STD forward<_This>(_Right._Myfirst._Val);
.
= ::
std
::
<
>(
._Myfirst._Val);
_Get_rest() = _STD forward<_Mybase>(_Right._Get_rest());
() = ::
std
::
<
>(
._Get_rest());
return
(*
this
);
}
template
<
class
...
,
<
<
<
<
,
<
...>>>,
<
,
const
&...>
>,
int
> =
0
>
&
(
const
<
...>&
)
_NOEXCEPT_COND(_Tuple_nothrow_assignable_v<tuple, const _Other&...>) // strengthened
noexcept
(
_Tuple_nothrow_assignable_v
<
,
const
&...>)
{
.
=
.
.
;
()
.
();
return
(*
this
);
}
template
<
class
...
,
<
<
<
<
,
<
...>>>,
<
,
...>
>,
int
> =
0
>
&
(
<
...>&&
)
_NOEXCEPT_COND(_Tuple_nothrow_assignable_v<tuple, _Other...>) // strengthened
noexcept
(
_Tuple_nothrow_assignable_v
<
,
...>)
{
_Myfirst._Val = _STD forward<typename tuple<_Other...>::_This_type>(_Right._Myfirst._Val);
.
= ::
std
::
<
typename
<
...>::
>(
.
.
);
_Get_rest() = _STD forward<typename tuple<_Other...>::_Mybase>(_Right._Get_rest());
()
::
std
::
<
typename
<
...>::
>(
.
());
return
(*
this
);
}
template
<
class
,
class
,
<
<
,
const
&,
const
&>,
int
> =
0
>
&
(
const
<
,
>&
)
_NOEXCEPT_COND(_Tuple_nothrow_assignable_v<tuple, const _First&, const _Second&>) // strengthened
noexcept
(
_Tuple_nothrow_assignable_v
<
,
const
&,
const
&>)
{
.
=
.
;
().
.
=
.
;
return
(*
this
);
}
template
<
class
,
class
,
<
<
,
,
>,
int
> =
0
>
&
(
<
,
>&&
)
_NOEXCEPT_COND(_Tuple_nothrow_assignable_v<tuple, _First, _Second>) // strengthened
noexcept
(
_Tuple_nothrow_assignable_v
<
,
,
>)
{
_Myfirst._Val = _STD forward<_First>(_Right.first);
_Get_rest()._Myfirst._Val = _STD forward<_Second>(_Right.second);
return
(*
this
);
}
void
(
&
)
_NOEXCEPT_COND(conjunction_v<_Is_nothrow_swappable<_This>,
_Is_nothrow_swappable<_Rest>...>)
{
(
.
,
.
.
);
::
(
.
());
}
&
()
noexcept
{
return
(*
this
);
}
constexpr
const
&
()
const
noexcept
{
return
(*
this
);
}
template
<
class
...
>
constexpr
bool
(
const
<
...>&
)
const
{
return
(
.
==
.
.
&&
::
(
.
()));
}
template
<
class
...
>
constexpr
bool
(
const
<
...>&
)
const
{
return
(
.
<
.
.
|| (!(
.
.
<
.
)
&&
::
(
.
())));
}
<
>
;
};
#if _HAS_CXX17
template<class... _Types>
tuple(_Types...) -> tuple<_Types...>;
template<class _Ty1,
class _Ty2>
tuple(pair<_Ty1, _Ty2>) -> tuple<_Ty1, _Ty2>;
template<class _Alloc,
class... _Types>
tuple(allocator_arg_t, _Alloc, _Types...) -> tuple<_Types...>;
template<class _Alloc,
class _Ty1,
class _Ty2>
tuple(allocator_arg_t, _Alloc, pair<_Ty1, _Ty2>) -> tuple<_Ty1, _Ty2>;
template<class _Alloc,
class... _Types>
tuple(allocator_arg_t, _Alloc, tuple<_Types...>) -> tuple<_Types...>;
#endif /* _HAS_CXX17 */
template
<
class
...
,
class
...
>
_NODISCARD constexpr bool operator==(const tuple<_Types1...>& _Left, const tuple<_Types2...>& _Right)
constexpr
bool
(
const
<
...>&
,
const
<
...>&
)
{
static_assert
(
sizeof
...(
)
sizeof
...(
),
"cannot compare tuples of different sizes"
);
return
(
.
(
));
}
template
<
class
...
,
class
...
>
_NODISCARD constexpr bool operator!=(const tuple<_Types1...>& _Left, const tuple<_Types2...>& _Right)
constexpr
bool
(
const
<
...>&
,
const
<
...>&
)
{
return
(!(
));
}
template
<
class
...
,
class
...
>
_NODISCARD constexpr bool operator<(const tuple<_Types1...>& _Left, const tuple<_Types2...>& _Right)
constexpr
bool
(
const
<
...>&
,
const
<
...>&
)
{
static_assert
(
sizeof
...(
)
sizeof
...(
),
"cannot compare tuples of different sizes"
);
return
(
.
(
));
}
template
<
class
...
,
class
...
>
_NODISCARD constexpr bool operator>=(const tuple<_Types1...>& _Left, const tuple<_Types2...>& _Right)
constexpr
bool
(
const
<
...>&
,
const
<
...>&
)
{
return
(!(
));
}
template
<
class
...
,
class
...
>
_NODISCARD constexpr bool operator>(const tuple<_Types1...>& _Left, const tuple<_Types2...>& _Right)
constexpr
bool
(
const
<
...>&
,
const
<
...>&
)
{
return
(
);
}
template
<
class
...
,
class
...
>
_NODISCARD constexpr bool operator<=(const tuple<_Types1...>& _Left, const tuple<_Types2...>& _Right)
constexpr
bool
(
const
<
...>&
,
const
<
...>&
)
{
return
(!(
));
}
template
<
class
...
,
<
<
<
>...>,
int
> =
0
>
inline
void
(
<
...>&
,
<
...>&
)
_NOEXCEPT_COND(_NOEXCEPT_OPER(_Left.swap(_Right)))
{
return
(
.
(
));
}
template
<
class
,
class
>
struct
;
template
<
class
,
class
...
>
struct
<
,
<
,
...>>
{
typedef
int
;
static_assert
(
<
typename
<
,
<
...>>::
>,
"duplicate type T in get<T>(tuple)"
);
typedef
;
typedef
<
,
...>
;
};
template
<
class
,
class
,
class
...
>
struct
<
,
<
,
...>>
:
<
,
<
...>>
{
};
template
<
class
>
struct
<
,
<>>
{
typedef
void
;
};
template
<
,
class
...
>
_NODISCARD constexpr tuple_element_t<_Index, tuple<_Types...>>&
(
<
...>&
)
noexcept
{
typedef
typename
<
,
<
...>>::
;
return
(((
&)
).
.
);
}
template
<
,
class
...
>
_NODISCARD constexpr const tuple_element_t<_Index, tuple<_Types...>>&
constexpr
const
<
,
<
...>>&
(
const
<
...>&
)
noexcept
{
typedef
typename
<
,
<
...>>::
;
return
(((
&)
).
.
);
}
template
<
,
class
...
>
_NODISCARD constexpr tuple_element_t<_Index, tuple<_Types...>>&&
(
<
...>&&
)
noexcept
{
typedef
typename
<
,
<
...>>::
;
typedef
<
,
<
...>>&&
;
return (_STD forward<_RRtype>(((_Ttype&)_Tuple)._Myfirst._Val));
return
(::
std
::
<
>(((
&)
).
.
));
}
template
<
,
class
...
>
_NODISCARD constexpr const tuple_element_t<_Index, tuple<_Types...>>&&
constexpr
const
<
,
<
...>>&&
(
const
<
...>&&
)
noexcept
{
typedef
typename
<
,
<
...>>::
;
typedef
const
<
,
<
...>>&&
;
return (_STD forward<_RRtype>(((_Ttype&)_Tuple)._Myfirst._Val));
return
(::
std
::
<
>(((
&)
).
.
));
}
template
<
class
,
class
...
>
_NODISCARD constexpr _Ty& get(tuple<_Types...>& _Tuple) noexcept
constexpr
&
(
<
...>&
)
noexcept
{
typedef
typename
<
,
<
...>>::
;
return
(((
&)
).
.
);
}
template
<
class
,
class
...
>
_NODISCARD constexpr const _Ty& get(const tuple<_Types...>& _Tuple) noexcept
constexpr
const
&
(
const
<
...>&
)
noexcept
{
typedef
typename
<
,
<
...>>::
;
return
(((
&)
).
.
);
}
template
<
class
,
class
...
>
_NODISCARD constexpr _Ty&& get(tuple<_Types...>&& _Tuple) noexcept
constexpr
&&
(
<
...>&&
)
noexcept
{
typedef
typename
<
,
<
...>>::
;
return (_STD forward<_Ty&&>(((_Ttype&)_Tuple)._Myfirst._Val));
return
(::
std
::
<
&&>(((
&)
).
.
));
}
template
<
class
,
class
...
>
_NODISCARD constexpr const _Ty&& get(const tuple<_Types...>&& _Tuple) noexcept
constexpr
const
&&
(
const
<
...>&&
)
noexcept
{
typedef
typename
<
,
<
...>>::
;
return (_STD forward<const _Ty&&>(((_Ttype&)_Tuple)._Myfirst._Val));
return
(::
std
::
<
const
&&>(((
&)
).
.
));
}
template
<
class
,
class
...
>
template
<
class
,
class
,
...
,
<
<
,
>,
int
>>
constexpr
<
,
...>::
(
,
&&
,
<
...>)
: tuple(_Exact_args_t{}, _STD get<_Indices>(_STD forward<_Tpl>(_Right))...)
:
(
{}, ::
std
::
<
>(::
std
::
<
>(
))...)
{
}
template
<
class
,
class
...
>
template
<
class
,
class
,
class
,
...
,
<
<
,
>,
int
>>
inline
<
,
...>::
(
,
const
&
,
&&
,
<
...>)
: tuple(_Alloc_exact_args_t{}, _Al, _STD get<_Indices>(_STD forward<_Tpl>(_Right))...)
:
(
{},
, ::
std
::
<
>(::
std
::
<
>(
))...)
{
}
template
<
class
...
>
_NODISCARD constexpr tuple<_Unrefwrap_t<_Types>...>
(
&&...
)
{
typedef
<
<
>...>
;
return (_Ttype(_STD forward<_Types>(_Args)...));
return
(
(::
std
::
<
>(
)...));
}
template
<
class
...
>
_NODISCARD constexpr tuple<_Types&...>
(
&...
)
noexcept
{
typedef
<
&...>
;
return
(
(
...));
}
template
<
class
...
>
_NODISCARD constexpr tuple<_Types&&...>
(
&&...
)
noexcept
{
return (tuple<_Types&&...>(_STD forward<_Types>(_Args)...));
return
(
<
&&...>(::
std
::
<
>(
)...));
}
template
<
class
,
class
>
struct
;
template
<
...
,
...
>
struct
<
<
...>,
<
...>>
{
typedef
<
...,
...>
;
};
template
<
class
,
>
class
;
template
<
,
class
,
>
_NODISCARD constexpr _Ty& get(array<_Ty, _Size>& _Arr) noexcept;
constexpr
&
(
<
,
>&
)
noexcept
;
template
<
,
class
,
>
_NODISCARD constexpr const _Ty& get(const array<_Ty, _Size>& _Arr) noexcept;
constexpr
const
&
(
const
<
,
>&
)
noexcept
;
template
<
,
class
,
>
_NODISCARD constexpr _Ty&& get(array<_Ty, _Size>&& _Arr) noexcept;
constexpr
&&
(
<
,
>&&
)
noexcept
;
template
<
,
class
,
>
_NODISCARD constexpr const _Ty&& get(const array<_Ty, _Size>&& _Arr) noexcept;
constexpr
const
&&
(
const
<
,
>&&
)
noexcept
;
template
<
class
,
class
...
>
struct
{
static_assert
(
<
>,
"Unsupported tuple_cat arguments."
);
};
template
<
class
...
>
struct
<
<
...>>
{
typedef
<
...>
;
};
template
<
class
,
class
>
struct
<
<
,
>>
{
typedef
<
,
>
;
};
template
<
class
,
class
...
>
struct
<
<
,
0
>,
...>
{
typedef
<
...>
;
};
template
<
class
,
,
class
...
>
struct
<
<
,
>,
...>
:
<
<
,
-
1
>,
,
...>
{
};
template
<
,
class
>
struct
:
<
,
>
{
};
template
<
class
,
class
,
class
,
,
class
...
>
struct
{
static_assert
(
sizeof
...(
)
0
,
"Unsupported tuple_cat arguments."
);
typedef
;
typedef
;
typedef
;
};
template
<
class
...
,
class
,
...
,
,
class
...
,
class
...
>
struct
<
<
...>,
,
<
...>,
,
<
...>,
...>
:
<
<
...,
...>,
typename
<
,
<
...>>::type,
<
...,
<
,
>::value...>,
+
1
,
...>
{
};
template
<
class
...
>
struct
:
<
<>,
<>,
<>,
0
,
typename
<
<
>>::type...>
{
};
#pragma warning(push)
#pragma warning(disable: 4100) // TRANSITION, VSO#181496, unreferenced formal parameter
#pragma warning(disable:
4100
)
template
<
class
,
...
,
...
,
class
>
constexpr
(
<
...>,
<
...>,
&&
)
{
return (_Ret(_STD get<_Kx>(_STD get<_Ix>(_STD forward<_Ty>(_Arg)))...));
return
(
(::
std
::
<
>(::
std
::
<
>(::
std
::
<
>(
)))...));
}
#pragma warning(pop)
template
<
class
...
>
_NODISCARD constexpr typename _Tuple_cat1<_Tuples...>::type
constexpr
typename
<
...>::
(
&&...
)
{
typedef
<
...>
;
return
(
<
typename
::
>(
typename
::
(),
typename
::
(),
_STD forward_as_tuple(_STD forward<_Tuples>(_Tpls)...)));
::
std
::
(::
std
::
<
>(
)...)));
}
#if _HAS_CXX17
// FUNCTION TEMPLATE apply
#pragma warning(push)
#pragma warning(disable: 4100) // TRANSITION, VSO#181496, unreferenced formal parameter
template<class _Callable,
class _Tuple,
size_t... _Indices>
constexpr decltype(auto) _Apply_impl(_Callable&& _Obj, _Tuple&& _Tpl, index_sequence<_Indices...>)
{ // invoke _Obj with the elements of _Tpl
return (_C_invoke(_STD forward<_Callable>(_Obj), _STD get<_Indices>(_STD forward<_Tuple>(_Tpl))...));
}
#pragma warning(pop)
template<class _Callable,
class _Tuple>
constexpr decltype(auto) apply(_Callable&& _Obj, _Tuple&& _Tpl)
{ // invoke _Obj with the elements of _Tpl
return (_Apply_impl(_STD forward<_Callable>(_Obj), _STD forward<_Tuple>(_Tpl),
make_index_sequence<tuple_size_v<remove_reference_t<_Tuple>>>{}));
}
// FUNCTION TEMPLATE make_from_tuple
#pragma warning(push)
#pragma warning(disable: 4100) // TRANSITION, VSO#181496, unreferenced formal parameter
template<class _Ty,
class _Tuple,
size_t... _Indices>
constexpr _Ty _Make_from_tuple_impl(_Tuple&& _Tpl, index_sequence<_Indices...>)
{ // construct _Ty from the elements of _Tpl
return (_Ty(_STD get<_Indices>(_STD forward<_Tuple>(_Tpl))...));
}
#pragma warning(pop)
template<class _Ty,
class _Tuple>
_NODISCARD constexpr _Ty make_from_tuple(_Tuple&& _Tpl)
{ // construct _Ty from the elements of _Tpl
return (_Make_from_tuple_impl<_Ty>(_STD forward<_Tuple>(_Tpl),
make_index_sequence<tuple_size_v<remove_reference_t<_Tuple>>>{}));
}
#endif /* _HAS_CXX17 */
template
<
class
,
class
,
...
>
inline
void
_For_each_tuple_element_impl
(
&&
,
,
<
...>)
{
int
[] = { (
static_cast
<
void
>(
(
_STD get<_Indices>(_STD forward<_Tpl>(_Tuple))
)),
0
)... };
(
void
)
_Ignored
;
}
template
<
class
,
class
>
inline
void
(
&&
,
)
{
_For_each_tuple_element_impl
(
_STD forward<_Tpl>(_Tuple),
,
<
<
<
>>>()
);
}
#pragma warning(push)
#pragma warning(disable: 4100) // TRANSITION, VSO#181496, unreferenced formal parameter
#pragma warning(disable:
4100
)
template
<
class
,
class
>
template
<
class
,
class
,
...
,
...
>
inline
<
,
>::
(
&
,
&
,
<
...>,
<
...>)
: first(_STD get<_Indexes1>(_STD move(_Val1))...),
: first(::
std
::
<
>(::
std
::
(
))...),
second(_STD get<_Indexes2>(_STD move(_Val2))...)
second(::
std
::
<
>(::
std
::
(
))...)
{
}
#pragma warning(pop)
template
<
class
,
class
>
template
<
class
...
,
class
...
>
inline
<
,
>::
(
,
<
...>
,
<
...>
)
:
(
,
,
<
...>(),
<
...>())
{
}
template
<
class
...
,
class
>
struct
<
<
...>,
>
:
{
};
#if _HAS_TR1_NAMESPACE
namespace _DEPRECATE_TR1_NAMESPACE tr1 {
namespace
[[deprecated(
"warning STL4002: "
"The non-Standard std::tr1 namespace and TR1-only machinery are deprecated and will be REMOVED. You can "
"define _SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING to acknowledge that you have received this warning."
)]]
{
}
#endif /* _HAS_TR1_NAMESPACE */
#pragma pop_macro("new")
_STL_RESTORE_CLANG_WARNINGS
#pragma warning(pop)
#pragma warning(pop)
#pragma pack(pop)
#endif /* RC_INVOKED */
#endif /* _TUPLE_ */
#pragma pack(pop)