forked from OSchip/llvm-project
[libc++] Avoid instantiating type_trait classes
Use `using` aliases to avoid instantiating lots of types Reviewed By: ldionne, #libc Spies: libcxx-commits, miyuki Differential Revision: https://reviews.llvm.org/D132785
This commit is contained in:
parent
2fb68c0628
commit
5fab33af7f
|
@ -40,7 +40,7 @@ pair<_InIter, _OutIter> __copy_impl(_InIter __first, _Sent __last, _OutIter __re
|
|||
|
||||
template <class _InValueT,
|
||||
class _OutValueT,
|
||||
class = __enable_if_t<is_same<typename remove_const<_InValueT>::type, _OutValueT>::value
|
||||
class = __enable_if_t<is_same<__remove_const_t<_InValueT>, _OutValueT>::value
|
||||
&& is_trivially_copy_assignable<_OutValueT>::value> >
|
||||
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
|
||||
pair<_InValueT*, _OutValueT*> __copy_impl(_InValueT* __first, _InValueT* __last, _OutValueT* __result) {
|
||||
|
@ -58,7 +58,7 @@ pair<_InValueT*, _OutValueT*> __copy_impl(_InValueT* __first, _InValueT* __last,
|
|||
}
|
||||
|
||||
template <class _InIter, class _OutIter,
|
||||
__enable_if_t<is_same<typename remove_const<__iter_value_type<_InIter> >::type, __iter_value_type<_OutIter> >::value
|
||||
__enable_if_t<is_same<__remove_const_t<__iter_value_type<_InIter> >, __iter_value_type<_OutIter> >::value
|
||||
&& __is_cpp17_contiguous_iterator<typename _InIter::iterator_type>::value
|
||||
&& __is_cpp17_contiguous_iterator<typename _OutIter::iterator_type>::value
|
||||
&& is_trivially_copy_assignable<__iter_value_type<_OutIter> >::value
|
||||
|
|
|
@ -29,7 +29,7 @@ typename enable_if
|
|||
>::type
|
||||
__half_positive(_Integral __value)
|
||||
{
|
||||
return static_cast<_Integral>(static_cast<typename make_unsigned<_Integral>::type>(__value) / 2);
|
||||
return static_cast<_Integral>(static_cast<__make_unsigned_t<_Integral> >(__value) / 2);
|
||||
}
|
||||
|
||||
template <typename _Tp>
|
||||
|
|
|
@ -97,7 +97,7 @@ struct _IterOps<_ClassicAlgPolicy> {
|
|||
template <class _Iter>
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
|
||||
static void __validate_iter_reference() {
|
||||
static_assert(is_same<__deref_t<_Iter>, typename iterator_traits<__uncvref_t<_Iter> >::reference>::value,
|
||||
static_assert(is_same<__deref_t<_Iter>, typename iterator_traits<__remove_cvref_t<_Iter> >::reference>::value,
|
||||
"It looks like your iterator's `iterator_traits<It>::reference` does not match the return type of "
|
||||
"dereferencing the iterator, i.e., calling `*it`. This is undefined behavior according to [input.iterators] "
|
||||
"and can lead to dangling reference issues at runtime, so we are flagging this.");
|
||||
|
@ -147,16 +147,16 @@ struct _IterOps<_ClassicAlgPolicy> {
|
|||
|
||||
template <class _Iter>
|
||||
_LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR_SINCE_CXX14
|
||||
__uncvref_t<_Iter> next(_Iter&& __it,
|
||||
typename iterator_traits<__uncvref_t<_Iter> >::difference_type __n = 1) {
|
||||
__remove_cvref_t<_Iter> next(_Iter&& __it,
|
||||
typename iterator_traits<__remove_cvref_t<_Iter> >::difference_type __n = 1) {
|
||||
return std::next(std::forward<_Iter>(__it), __n);
|
||||
}
|
||||
|
||||
// prev
|
||||
template <class _Iter>
|
||||
_LIBCPP_HIDE_FROM_ABI static _LIBCPP_CONSTEXPR_SINCE_CXX14
|
||||
__uncvref_t<_Iter> prev(_Iter&& __iter,
|
||||
typename iterator_traits<__uncvref_t<_Iter> >::difference_type __n = 1) {
|
||||
__remove_cvref_t<_Iter> prev(_Iter&& __iter,
|
||||
typename iterator_traits<__remove_cvref_t<_Iter> >::difference_type __n = 1) {
|
||||
return std::prev(std::forward<_Iter>(__iter), __n);
|
||||
}
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ pair<_InIter, _OutIter> __move_impl(_InIter __first, _Sent __last, _OutIter __re
|
|||
template <class _AlgPolicy,
|
||||
class _InType,
|
||||
class _OutType,
|
||||
class = __enable_if_t<is_same<typename remove_const<_InType>::type, _OutType>::value
|
||||
class = __enable_if_t<is_same<__remove_const_t<_InType>, _OutType>::value
|
||||
&& is_trivially_move_assignable<_OutType>::value> >
|
||||
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
|
||||
pair<_InType*, _OutType*> __move_impl(_InType* __first, _InType* __last, _OutType* __result) {
|
||||
|
@ -70,7 +70,7 @@ struct __is_trivially_move_assignable_unwrapped
|
|||
template <class _AlgPolicy,
|
||||
class _InIter,
|
||||
class _OutIter,
|
||||
__enable_if_t<is_same<typename remove_const<typename iterator_traits<_InIter>::value_type>::type,
|
||||
__enable_if_t<is_same<__remove_const_t<typename iterator_traits<_InIter>::value_type>,
|
||||
typename iterator_traits<_OutIter>::value_type>::value
|
||||
&& __is_cpp17_contiguous_iterator<_InIter>::value
|
||||
&& __is_cpp17_contiguous_iterator<_OutIter>::value
|
||||
|
|
|
@ -44,7 +44,7 @@ template <class _AlgPolicy, class _Tp, class _Up>
|
|||
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX17
|
||||
typename enable_if
|
||||
<
|
||||
is_same<typename remove_const<_Tp>::type, _Up>::value &&
|
||||
is_same<__remove_const_t<_Tp>, _Up>::value &&
|
||||
is_trivially_move_assignable<_Up>::value,
|
||||
_Up*
|
||||
>::type
|
||||
|
|
|
@ -79,7 +79,7 @@ template <class _AlgPolicy, class _ForwardIterator, class _Sentinel, class _Pred
|
|||
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
|
||||
pair<_ForwardIterator, _ForwardIterator> __partition(
|
||||
_ForwardIterator __first, _Sentinel __last, _Predicate&& __pred, _IterCategory __iter_category) {
|
||||
return std::__partition_impl<__uncvref_t<_Predicate>&, _AlgPolicy>(
|
||||
return std::__partition_impl<__remove_cvref_t<_Predicate>&, _AlgPolicy>(
|
||||
std::move(__first), std::move(__last), __pred, __iter_category);
|
||||
}
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ namespace ranges {
|
|||
|
||||
template <class _IterMaybeQualified>
|
||||
consteval auto __get_iterator_concept() {
|
||||
using _Iter = __uncvref_t<_IterMaybeQualified>;
|
||||
using _Iter = __remove_cvref_t<_IterMaybeQualified>;
|
||||
|
||||
if constexpr (contiguous_iterator<_Iter>)
|
||||
return contiguous_iterator_tag();
|
||||
|
|
|
@ -47,7 +47,7 @@ template <
|
|||
class _Comp,
|
||||
class _Proj1,
|
||||
class _Proj2>
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr merge_result<__uncvref_t<_InIter1>, __uncvref_t<_InIter2>, __uncvref_t<_OutIter>>
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr merge_result<__remove_cvref_t<_InIter1>, __remove_cvref_t<_InIter2>, __remove_cvref_t<_OutIter>>
|
||||
__merge_impl(
|
||||
_InIter1&& __first1,
|
||||
_Sent1&& __last1,
|
||||
|
|
|
@ -44,7 +44,7 @@ struct __fn {
|
|||
|
||||
template <class _Iter, class _Sent, class _Proj, class _Pred>
|
||||
_LIBCPP_HIDE_FROM_ABI static constexpr
|
||||
subrange<__uncvref_t<_Iter>> __partition_fn_impl(_Iter&& __first, _Sent&& __last, _Pred&& __pred, _Proj&& __proj) {
|
||||
subrange<__remove_cvref_t<_Iter>> __partition_fn_impl(_Iter&& __first, _Sent&& __last, _Pred&& __pred, _Proj&& __proj) {
|
||||
auto&& __projected_pred = std::__make_projected(__pred, __proj);
|
||||
auto __result = std::__partition<_RangeAlgPolicy>(
|
||||
std::move(__first), std::move(__last), __projected_pred, __iterator_concept<_Iter>());
|
||||
|
|
|
@ -43,7 +43,7 @@ struct __fn {
|
|||
template <class _InIter, class _Sent, class _OutIter1, class _OutIter2, class _Proj, class _Pred>
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr
|
||||
static partition_copy_result<
|
||||
__uncvref_t<_InIter>, __uncvref_t<_OutIter1>, __uncvref_t<_OutIter2>
|
||||
__remove_cvref_t<_InIter>, __remove_cvref_t<_OutIter1>, __remove_cvref_t<_OutIter2>
|
||||
> __partition_copy_fn_impl( _InIter&& __first, _Sent&& __last, _OutIter1&& __out_true, _OutIter2&& __out_false,
|
||||
_Pred& __pred, _Proj& __proj) {
|
||||
for (; __first != __last; ++__first) {
|
||||
|
|
|
@ -45,7 +45,7 @@ struct __fn {
|
|||
|
||||
template <class _Iter, class _Sent, class _Proj, class _Pred>
|
||||
_LIBCPP_HIDE_FROM_ABI static
|
||||
subrange<__uncvref_t<_Iter>> __stable_partition_fn_impl(
|
||||
subrange<__remove_cvref_t<_Iter>> __stable_partition_fn_impl(
|
||||
_Iter&& __first, _Sent&& __last, _Pred&& __pred, _Proj&& __proj) {
|
||||
auto __last_iter = ranges::next(__first, __last);
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
template < class _Comp, class _InIter1, class _Sent1, class _InIter2, class _Sent2, class _OutIter>
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair<__uncvref_t<_InIter1>, __uncvref_t<_OutIter> >
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 pair<__remove_cvref_t<_InIter1>, __remove_cvref_t<_OutIter> >
|
||||
__set_difference(
|
||||
_InIter1&& __first1, _Sent1&& __last1, _InIter2&& __first2, _Sent2&& __last2, _OutIter&& __result, _Comp&& __comp) {
|
||||
while (__first1 != __last1 && __first2 != __last2) {
|
||||
|
|
|
@ -309,7 +309,7 @@ template <class _AlgPolicy, class _Predicate, class _ForwardIterator, class _Ite
|
|||
_LIBCPP_HIDE_FROM_ABI
|
||||
_ForwardIterator __stable_partition(
|
||||
_ForwardIterator __first, _ForwardIterator __last, _Predicate&& __pred, _IterCategory __iter_category) {
|
||||
return std::__stable_partition_impl<_AlgPolicy, __uncvref_t<_Predicate>&>(
|
||||
return std::__stable_partition_impl<_AlgPolicy, __remove_cvref_t<_Predicate>&>(
|
||||
std::move(__first), std::move(__last), __pred, __iter_category);
|
||||
}
|
||||
|
||||
|
|
|
@ -42,9 +42,9 @@ public:
|
|||
using result_type = invoke_result_t<_Gen&>;
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI
|
||||
static constexpr auto min() { return __uncvref_t<_Gen>::min(); }
|
||||
static constexpr auto min() { return __remove_cvref_t<_Gen>::min(); }
|
||||
_LIBCPP_HIDE_FROM_ABI
|
||||
static constexpr auto max() { return __uncvref_t<_Gen>::max(); }
|
||||
static constexpr auto max() { return __remove_cvref_t<_Gen>::max(); }
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI
|
||||
constexpr explicit _ClassicGenAdaptor(_Gen& __g) : __gen_(__g) {}
|
||||
|
|
|
@ -28,7 +28,7 @@ concept __class_or_enum = is_class_v<_Tp> || is_union_v<_Tp> || is_enum_v<_Tp>;
|
|||
// Work around Clang bug https://llvm.org/PR52970
|
||||
// TODO: remove this workaround once libc++ no longer has to support Clang 13 (it was fixed in Clang 14).
|
||||
template<class _Tp>
|
||||
concept __workaround_52970 = is_class_v<__uncvref_t<_Tp>> || is_union_v<__uncvref_t<_Tp>>;
|
||||
concept __workaround_52970 = is_class_v<__remove_cvref_t<_Tp>> || is_union_v<__remove_cvref_t<_Tp>>;
|
||||
|
||||
#endif // _LIBCPP_STD_VER > 17
|
||||
|
||||
|
|
|
@ -115,7 +115,7 @@ public:
|
|||
|
||||
_LIBCPP_HIDE_FROM_ABI
|
||||
static coroutine_handle from_promise(_Promise& __promise) {
|
||||
using _RawPromise = typename remove_cv<_Promise>::type;
|
||||
using _RawPromise = __remove_cv_t<_Promise>;
|
||||
coroutine_handle __tmp;
|
||||
__tmp.__handle_ =
|
||||
__builtin_coro_promise(_VSTD::addressof(const_cast<_RawPromise&>(__promise)), alignof(_Promise), true);
|
||||
|
|
|
@ -141,15 +141,15 @@ struct __is_pathable_string<
|
|||
|
||||
template <class _Source, class _DS = typename decay<_Source>::type,
|
||||
class _UnqualPtrType =
|
||||
typename remove_const<typename remove_pointer<_DS>::type>::type,
|
||||
__remove_const_t<__remove_pointer_t<_DS> >,
|
||||
bool _IsCharPtr = is_pointer<_DS>::value&&
|
||||
__can_convert_char<_UnqualPtrType>::value>
|
||||
struct __is_pathable_char_array : false_type {};
|
||||
|
||||
template <class _Source, class _ECharT, class _UPtr>
|
||||
struct __is_pathable_char_array<_Source, _ECharT*, _UPtr, true>
|
||||
: __can_convert_char<typename remove_const<_ECharT>::type> {
|
||||
using _Base = __can_convert_char<typename remove_const<_ECharT>::type>;
|
||||
: __can_convert_char<__remove_const_t<_ECharT> > {
|
||||
using _Base = __can_convert_char<__remove_const_t<_ECharT> >;
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI
|
||||
static _ECharT const* __range_begin(const _ECharT* __b) { return __b; }
|
||||
|
|
|
@ -25,9 +25,9 @@ _LIBCPP_BEGIN_NAMESPACE_STD
|
|||
|
||||
template<class _Tp>
|
||||
struct is_bind_expression : _If<
|
||||
_IsSame<_Tp, __uncvref_t<_Tp> >::value,
|
||||
_IsSame<_Tp, __remove_cvref_t<_Tp> >::value,
|
||||
false_type,
|
||||
is_bind_expression<__uncvref_t<_Tp> >
|
||||
is_bind_expression<__remove_cvref_t<_Tp> >
|
||||
> {};
|
||||
|
||||
#if _LIBCPP_STD_VER > 14
|
||||
|
@ -37,9 +37,9 @@ inline constexpr size_t is_bind_expression_v = is_bind_expression<_Tp>::value;
|
|||
|
||||
template<class _Tp>
|
||||
struct is_placeholder : _If<
|
||||
_IsSame<_Tp, __uncvref_t<_Tp> >::value,
|
||||
_IsSame<_Tp, __remove_cvref_t<_Tp> >::value,
|
||||
integral_constant<int, 0>,
|
||||
is_placeholder<__uncvref_t<_Tp> >
|
||||
is_placeholder<__remove_cvref_t<_Tp> >
|
||||
> {};
|
||||
|
||||
#if _LIBCPP_STD_VER > 14
|
||||
|
@ -279,7 +279,7 @@ public:
|
|||
class = typename enable_if
|
||||
<
|
||||
is_constructible<_Fd, _Gp>::value &&
|
||||
!is_same<typename remove_reference<_Gp>::type,
|
||||
!is_same<__libcpp_remove_reference_t<_Gp>,
|
||||
__bind>::value
|
||||
>::type>
|
||||
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
|
||||
|
@ -324,7 +324,7 @@ public:
|
|||
class = typename enable_if
|
||||
<
|
||||
is_constructible<_Fd, _Gp>::value &&
|
||||
!is_same<typename remove_reference<_Gp>::type,
|
||||
!is_same<__libcpp_remove_reference_t<_Gp>,
|
||||
__bind_r>::value
|
||||
>::type>
|
||||
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
|
||||
|
|
|
@ -974,7 +974,7 @@ class _LIBCPP_TEMPLATE_VIS function<_Rp(_ArgTypes...)>
|
|||
__func __f_;
|
||||
|
||||
template <class _Fp, bool = _And<
|
||||
_IsNotSame<__uncvref_t<_Fp>, function>,
|
||||
_IsNotSame<__remove_cvref_t<_Fp>, function>,
|
||||
__invokable<_Fp, _ArgTypes...>
|
||||
>::value>
|
||||
struct __callable;
|
||||
|
|
|
@ -248,7 +248,7 @@ struct __member_pointer_traits_imp<_Rp _Class::*, false, true>
|
|||
|
||||
template <class _MP>
|
||||
struct __member_pointer_traits
|
||||
: public __member_pointer_traits_imp<typename remove_cv<_MP>::type,
|
||||
: public __member_pointer_traits_imp<__remove_cv_t<_MP>,
|
||||
is_member_function_pointer<_MP>::value,
|
||||
is_member_object_pointer<_MP>::value>
|
||||
{
|
||||
|
|
|
@ -57,7 +57,7 @@ template <class ..._Args>
|
|||
struct __is_hash_value_type : false_type {};
|
||||
|
||||
template <class _One>
|
||||
struct __is_hash_value_type<_One> : __is_hash_value_type_imp<__uncvref_t<_One> > {};
|
||||
struct __is_hash_value_type<_One> : __is_hash_value_type_imp<__remove_cvref_t<_One> > {};
|
||||
|
||||
_LIBCPP_FUNC_VIS
|
||||
size_t __next_prime(size_t __n);
|
||||
|
@ -67,7 +67,7 @@ struct __hash_node_base
|
|||
{
|
||||
typedef typename pointer_traits<_NodePtr>::element_type __node_type;
|
||||
typedef __hash_node_base __first_node;
|
||||
typedef typename __rebind_pointer<_NodePtr, __first_node>::type __node_base_pointer;
|
||||
typedef __rebind_pointer_t<_NodePtr, __first_node> __node_base_pointer;
|
||||
typedef _NodePtr __node_pointer;
|
||||
|
||||
#if defined(_LIBCPP_ABI_FIX_UNORDERED_NODE_POINTER_UB)
|
||||
|
@ -105,7 +105,7 @@ template <class _Tp, class _VoidPtr>
|
|||
struct _LIBCPP_STANDALONE_DEBUG __hash_node
|
||||
: public __hash_node_base
|
||||
<
|
||||
typename __rebind_pointer<_VoidPtr, __hash_node<_Tp, _VoidPtr> >::type
|
||||
__rebind_pointer_t<_VoidPtr, __hash_node<_Tp, _VoidPtr> >
|
||||
>
|
||||
{
|
||||
typedef _Tp __node_value_type;
|
||||
|
@ -217,9 +217,9 @@ struct __hash_map_pointer_types {};
|
|||
template <class _Tp, class _AllocPtr, class _KVTypes>
|
||||
struct __hash_map_pointer_types<_Tp, _AllocPtr, _KVTypes, true> {
|
||||
typedef typename _KVTypes::__map_value_type _Mv;
|
||||
typedef typename __rebind_pointer<_AllocPtr, _Mv>::type
|
||||
typedef __rebind_pointer_t<_AllocPtr, _Mv>
|
||||
__map_value_type_pointer;
|
||||
typedef typename __rebind_pointer<_AllocPtr, const _Mv>::type
|
||||
typedef __rebind_pointer_t<_AllocPtr, const _Mv>
|
||||
__const_map_value_type_pointer;
|
||||
};
|
||||
|
||||
|
@ -237,21 +237,21 @@ public:
|
|||
typedef ptrdiff_t difference_type;
|
||||
typedef size_t size_type;
|
||||
|
||||
typedef typename __rebind_pointer<_NodePtr, void>::type __void_pointer;
|
||||
typedef __rebind_pointer_t<_NodePtr, void> __void_pointer;
|
||||
|
||||
typedef typename pointer_traits<_NodePtr>::element_type __node_type;
|
||||
typedef _NodePtr __node_pointer;
|
||||
|
||||
typedef __hash_node_base<__node_pointer> __node_base_type;
|
||||
typedef typename __rebind_pointer<_NodePtr, __node_base_type>::type
|
||||
typedef __rebind_pointer_t<_NodePtr, __node_base_type>
|
||||
__node_base_pointer;
|
||||
|
||||
typedef typename __node_base_type::__next_pointer __next_pointer;
|
||||
|
||||
typedef _Tp __node_value_type;
|
||||
typedef typename __rebind_pointer<_VoidPtr, __node_value_type>::type
|
||||
typedef __rebind_pointer_t<_VoidPtr, __node_value_type>
|
||||
__node_value_type_pointer;
|
||||
typedef typename __rebind_pointer<_VoidPtr, const __node_value_type>::type
|
||||
typedef __rebind_pointer_t<_VoidPtr, const __node_value_type>
|
||||
__const_node_value_type_pointer;
|
||||
|
||||
private:
|
||||
|
@ -259,7 +259,7 @@ private:
|
|||
"_NodePtr should never be a pointer to const");
|
||||
static_assert((is_same<typename pointer_traits<_VoidPtr>::element_type, void>::value),
|
||||
"_VoidPtr does not point to unqualified void type");
|
||||
static_assert((is_same<typename __rebind_pointer<_VoidPtr, __node_type>::type,
|
||||
static_assert((is_same<__rebind_pointer_t<_VoidPtr, __node_type>,
|
||||
_NodePtr>::value), "_VoidPtr does not rebind to _NodePtr.");
|
||||
};
|
||||
|
||||
|
@ -278,7 +278,7 @@ struct __hash_node_types_from_iterator<__hash_const_local_iterator<_NodePtr> > :
|
|||
template <class _NodeValueTp, class _VoidPtr>
|
||||
struct __make_hash_node_types {
|
||||
typedef __hash_node<_NodeValueTp, _VoidPtr> _NodeTp;
|
||||
typedef typename __rebind_pointer<_VoidPtr, _NodeTp>::type _NodePtr;
|
||||
typedef __rebind_pointer_t<_VoidPtr, _NodeTp> _NodePtr;
|
||||
typedef __hash_node_types<_NodePtr> type;
|
||||
};
|
||||
|
||||
|
@ -623,8 +623,8 @@ class _LIBCPP_TEMPLATE_VIS __hash_const_local_iterator
|
|||
|
||||
typedef pointer_traits<__node_pointer> __pointer_traits;
|
||||
typedef typename __pointer_traits::element_type __node;
|
||||
typedef typename remove_const<__node>::type __non_const_node;
|
||||
typedef typename __rebind_pointer<__node_pointer, __non_const_node>::type
|
||||
typedef __remove_const_t<__node> __non_const_node;
|
||||
typedef __rebind_pointer_t<__node_pointer, __non_const_node>
|
||||
__non_const_node_pointer;
|
||||
public:
|
||||
typedef __hash_local_iterator<__non_const_node_pointer>
|
||||
|
|
|
@ -75,7 +75,7 @@ struct __fn {
|
|||
template<class _Ip, sized_sentinel_for<decay_t<_Ip>> _Sp>
|
||||
_LIBCPP_HIDE_FROM_ABI
|
||||
constexpr iter_difference_t<_Ip> operator()(_Ip&& __first, _Sp __last) const {
|
||||
if constexpr (sized_sentinel_for<_Sp, __uncvref_t<_Ip>>) {
|
||||
if constexpr (sized_sentinel_for<_Sp, __remove_cvref_t<_Ip>>) {
|
||||
return __last - __first;
|
||||
} else {
|
||||
return __last - decay_t<_Ip>(__first);
|
||||
|
|
|
@ -408,7 +408,7 @@ requires is_object_v<_Tp>
|
|||
struct _LIBCPP_TEMPLATE_VIS iterator_traits<_Tp*>
|
||||
{
|
||||
typedef ptrdiff_t difference_type;
|
||||
typedef typename remove_cv<_Tp>::type value_type;
|
||||
typedef __remove_cv_t<_Tp> value_type;
|
||||
typedef _Tp* pointer;
|
||||
typedef _Tp& reference;
|
||||
typedef random_access_iterator_tag iterator_category;
|
||||
|
@ -493,7 +493,7 @@ template<class _InputIterator>
|
|||
using __iter_value_type = typename iterator_traits<_InputIterator>::value_type;
|
||||
|
||||
template<class _InputIterator>
|
||||
using __iter_key_type = typename remove_const<typename iterator_traits<_InputIterator>::value_type::first_type>::type;
|
||||
using __iter_key_type = __remove_const_t<typename iterator_traits<_InputIterator>::value_type::first_type>;
|
||||
|
||||
template<class _InputIterator>
|
||||
using __iter_mapped_type = typename iterator_traits<_InputIterator>::value_type::second_type;
|
||||
|
|
|
@ -82,7 +82,7 @@ public:
|
|||
typedef typename iterator_traits<iterator_type>::reference __reference;
|
||||
typedef typename conditional<
|
||||
is_reference<__reference>::value,
|
||||
typename remove_reference<__reference>::type&&,
|
||||
__libcpp_remove_reference_t<__reference>&&,
|
||||
__reference
|
||||
>::type reference;
|
||||
#endif // _LIBCPP_STD_VER > 17
|
||||
|
|
|
@ -36,7 +36,7 @@ extern _LIBCPP_EXPORTED_FROM_ABI const allocator_arg_t allocator_arg;
|
|||
template <class _Tp, class _Alloc, class ..._Args>
|
||||
struct __uses_alloc_ctor_imp
|
||||
{
|
||||
typedef _LIBCPP_NODEBUG __uncvref_t<_Alloc> _RawAlloc;
|
||||
typedef _LIBCPP_NODEBUG __remove_cvref_t<_Alloc> _RawAlloc;
|
||||
static const bool __ua = uses_allocator<_Tp, _RawAlloc>::value;
|
||||
static const bool __ic =
|
||||
is_constructible<_Tp, allocator_arg_t, _Alloc, _Args...>::value;
|
||||
|
|
|
@ -33,7 +33,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
|
|||
// __pointer
|
||||
_LIBCPP_ALLOCATOR_TRAITS_HAS_XXX(__has_pointer, pointer);
|
||||
template <class _Tp, class _Alloc,
|
||||
class _RawAlloc = typename remove_reference<_Alloc>::type,
|
||||
class _RawAlloc = __libcpp_remove_reference_t<_Alloc>,
|
||||
bool = __has_pointer<_RawAlloc>::value>
|
||||
struct __pointer {
|
||||
using type _LIBCPP_NODEBUG = typename _RawAlloc::pointer;
|
||||
|
|
|
@ -151,14 +151,13 @@ public:
|
|||
{return _VSTD::addressof(__r);}
|
||||
};
|
||||
|
||||
template <class _From, class _To>
|
||||
struct __rebind_pointer {
|
||||
#ifndef _LIBCPP_CXX03_LANG
|
||||
typedef typename pointer_traits<_From>::template rebind<_To> type;
|
||||
template <class _From, class _To>
|
||||
using __rebind_pointer_t = typename pointer_traits<_From>::template rebind<_To>;
|
||||
#else
|
||||
typedef typename pointer_traits<_From>::template rebind<_To>::other type;
|
||||
template <class _From, class _To>
|
||||
using __rebind_pointer_t = typename pointer_traits<_From>::template rebind<_To>::other;
|
||||
#endif
|
||||
};
|
||||
|
||||
// to_address
|
||||
|
||||
|
|
|
@ -690,7 +690,7 @@ public:
|
|||
{
|
||||
typedef typename __shared_ptr_default_allocator<_Yp>::type _AllocT;
|
||||
typedef __shared_ptr_pointer<typename unique_ptr<_Yp, _Dp>::pointer,
|
||||
reference_wrapper<typename remove_reference<_Dp>::type>,
|
||||
reference_wrapper<__libcpp_remove_reference_t<_Dp> >,
|
||||
_AllocT> _CntrlBlk;
|
||||
__cntrl_ = new _CntrlBlk(__r.get(), _VSTD::ref(__r.get_deleter()), _AllocT());
|
||||
__enable_weak_this(__r.get(), __r.get());
|
||||
|
@ -805,7 +805,7 @@ public:
|
|||
}
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI
|
||||
typename add_lvalue_reference<element_type>::type operator*() const _NOEXCEPT
|
||||
__add_lvalue_reference_t<element_type> operator*() const _NOEXCEPT
|
||||
{
|
||||
return *__ptr_;
|
||||
}
|
||||
|
@ -858,7 +858,7 @@ public:
|
|||
|
||||
#if _LIBCPP_STD_VER > 14
|
||||
_LIBCPP_HIDE_FROM_ABI
|
||||
typename add_lvalue_reference<element_type>::type operator[](ptrdiff_t __i) const
|
||||
__add_lvalue_reference_t<element_type> operator[](ptrdiff_t __i) const
|
||||
{
|
||||
static_assert(is_array<_Tp>::value,
|
||||
"std::shared_ptr<T>::operator[] is only valid when T is an array type.");
|
||||
|
@ -907,7 +907,7 @@ private:
|
|||
_LIBCPP_HIDE_FROM_ABI
|
||||
void __enable_weak_this(const enable_shared_from_this<_Yp>* __e, _OrigPtr* __ptr) _NOEXCEPT
|
||||
{
|
||||
typedef typename remove_cv<_Yp>::type _RawYp;
|
||||
typedef __remove_cv_t<_Yp> _RawYp;
|
||||
if (__e && __e->__weak_this_.expired())
|
||||
{
|
||||
__e->__weak_this_ = shared_ptr<_RawYp>(*this,
|
||||
|
|
|
@ -558,7 +558,7 @@ struct __allocator_has_trivial_copy_construct<allocator<_Type>, _Type> : true_ty
|
|||
|
||||
template <class _Alloc,
|
||||
class _Type,
|
||||
class _RawType = typename remove_const<_Type>::type,
|
||||
class _RawType = __remove_const_t<_Type>,
|
||||
__enable_if_t<
|
||||
// using _RawType because of the allocator<T const> extension
|
||||
is_trivially_copy_constructible<_RawType>::value && is_trivially_copy_assignable<_RawType>::value &&
|
||||
|
|
|
@ -251,7 +251,7 @@ public:
|
|||
return *this;
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 typename add_lvalue_reference<_Tp>::type operator*() const {
|
||||
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 __add_lvalue_reference_t<_Tp> operator*() const {
|
||||
return *__ptr_.first();
|
||||
}
|
||||
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 pointer operator->() const _NOEXCEPT {
|
||||
|
@ -448,7 +448,7 @@ public:
|
|||
return *this;
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 typename add_lvalue_reference<_Tp>::type
|
||||
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 __add_lvalue_reference_t<_Tp>
|
||||
operator[](size_t __i) const {
|
||||
return __ptr_.first()[__i];
|
||||
}
|
||||
|
@ -673,7 +673,7 @@ make_unique(_Args&&... __args) {
|
|||
template <class _Tp>
|
||||
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 typename __unique_if<_Tp>::__unique_array_unknown_bound
|
||||
make_unique(size_t __n) {
|
||||
typedef typename remove_extent<_Tp>::type _Up;
|
||||
typedef __remove_extent_t<_Tp> _Up;
|
||||
return unique_ptr<_Tp>(new _Up[__n]());
|
||||
}
|
||||
|
||||
|
|
|
@ -91,8 +91,8 @@ class _LIBCPP_TEMPLATE_VIS __basic_node_handle
|
|||
_NodeType, __basic_node_handle<_NodeType, _Alloc, _MapOrSetSpecifics>>;
|
||||
|
||||
typedef allocator_traits<_Alloc> __alloc_traits;
|
||||
typedef typename __rebind_pointer<typename __alloc_traits::void_pointer,
|
||||
_NodeType>::type
|
||||
typedef __rebind_pointer_t<typename __alloc_traits::void_pointer,
|
||||
_NodeType>
|
||||
__node_pointer_type;
|
||||
|
||||
public:
|
||||
|
|
|
@ -60,8 +60,8 @@ common_type_t<_Tp,_Up>
|
|||
gcd(_Tp __m, _Up __n)
|
||||
{
|
||||
static_assert((is_integral<_Tp>::value && is_integral<_Up>::value), "Arguments to gcd must be integer types");
|
||||
static_assert((!is_same<typename remove_cv<_Tp>::type, bool>::value), "First argument to gcd cannot be bool" );
|
||||
static_assert((!is_same<typename remove_cv<_Up>::type, bool>::value), "Second argument to gcd cannot be bool" );
|
||||
static_assert((!is_same<__remove_cv_t<_Tp>, bool>::value), "First argument to gcd cannot be bool" );
|
||||
static_assert((!is_same<__remove_cv_t<_Up>, bool>::value), "Second argument to gcd cannot be bool" );
|
||||
using _Rp = common_type_t<_Tp,_Up>;
|
||||
using _Wp = make_unsigned_t<_Rp>;
|
||||
return static_cast<_Rp>(_VSTD::__gcd(
|
||||
|
@ -75,8 +75,8 @@ common_type_t<_Tp,_Up>
|
|||
lcm(_Tp __m, _Up __n)
|
||||
{
|
||||
static_assert((is_integral<_Tp>::value && is_integral<_Up>::value), "Arguments to lcm must be integer types");
|
||||
static_assert((!is_same<typename remove_cv<_Tp>::type, bool>::value), "First argument to lcm cannot be bool" );
|
||||
static_assert((!is_same<typename remove_cv<_Up>::type, bool>::value), "Second argument to lcm cannot be bool" );
|
||||
static_assert((!is_same<__remove_cv_t<_Tp>, bool>::value), "First argument to lcm cannot be bool" );
|
||||
static_assert((!is_same<__remove_cv_t<_Up>, bool>::value), "Second argument to lcm cannot be bool" );
|
||||
if (__m == 0 || __n == 0)
|
||||
return 0;
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ struct __is_seed_sequence
|
|||
{
|
||||
static _LIBCPP_CONSTEXPR const bool value =
|
||||
!is_convertible<_Sseq, typename _Engine::result_type>::value &&
|
||||
!is_same<typename remove_cv<_Sseq>::type, _Engine>::value;
|
||||
!is_same<__remove_cv_t<_Sseq>, _Engine>::value;
|
||||
};
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
|
|
@ -238,7 +238,7 @@ _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
|
|||
{
|
||||
static_assert(__libcpp_random_is_valid_urng<_URNG>::value, "");
|
||||
typedef typename conditional<sizeof(result_type) <= sizeof(uint32_t), uint32_t,
|
||||
typename make_unsigned<result_type>::type>::type _UIntType;
|
||||
__make_unsigned_t<result_type> >::type _UIntType;
|
||||
const _UIntType _Rp = _UIntType(__p.b()) - _UIntType(__p.a()) + _UIntType(1);
|
||||
if (_Rp == 1)
|
||||
return __p.a();
|
||||
|
|
|
@ -51,7 +51,7 @@ private:
|
|||
public:
|
||||
typedef _Tp value_type;
|
||||
typedef _Allocator allocator_type;
|
||||
typedef typename remove_reference<allocator_type>::type __alloc_rr;
|
||||
typedef __libcpp_remove_reference_t<allocator_type> __alloc_rr;
|
||||
typedef allocator_traits<__alloc_rr> __alloc_traits;
|
||||
typedef value_type& reference;
|
||||
typedef const value_type& const_reference;
|
||||
|
@ -67,8 +67,8 @@ public:
|
|||
pointer __end_;
|
||||
__compressed_pair<pointer, allocator_type> __end_cap_;
|
||||
|
||||
typedef typename add_lvalue_reference<allocator_type>::type __alloc_ref;
|
||||
typedef typename add_lvalue_reference<allocator_type>::type __alloc_const_ref;
|
||||
typedef __add_lvalue_reference_t<allocator_type> __alloc_ref;
|
||||
typedef __add_lvalue_reference_t<allocator_type> __alloc_const_ref;
|
||||
|
||||
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI __alloc_rr& __alloc() _NOEXCEPT {return __end_cap_.second();}
|
||||
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const __alloc_rr& __alloc() const _NOEXCEPT {return __end_cap_.second();}
|
||||
|
|
|
@ -560,7 +560,7 @@ template <class ..._Args>
|
|||
struct __is_tree_value_type : false_type {};
|
||||
|
||||
template <class _One>
|
||||
struct __is_tree_value_type<_One> : __is_tree_value_type_imp<__uncvref_t<_One> > {};
|
||||
struct __is_tree_value_type<_One> : __is_tree_value_type_imp<__remove_cvref_t<_One> > {};
|
||||
|
||||
template <class _Tp>
|
||||
struct __tree_key_value_types {
|
||||
|
@ -638,11 +638,11 @@ struct __tree_node_base_types {
|
|||
typedef _VoidPtr __void_pointer;
|
||||
|
||||
typedef __tree_node_base<__void_pointer> __node_base_type;
|
||||
typedef typename __rebind_pointer<_VoidPtr, __node_base_type>::type
|
||||
typedef __rebind_pointer_t<_VoidPtr, __node_base_type>
|
||||
__node_base_pointer;
|
||||
|
||||
typedef __tree_end_node<__node_base_pointer> __end_node_type;
|
||||
typedef typename __rebind_pointer<_VoidPtr, __end_node_type>::type
|
||||
typedef __rebind_pointer_t<_VoidPtr, __end_node_type>
|
||||
__end_node_pointer;
|
||||
#if defined(_LIBCPP_ABI_TREE_REMOVE_NODE_POINTER_UB)
|
||||
typedef __end_node_pointer __parent_pointer;
|
||||
|
@ -665,9 +665,9 @@ struct __tree_map_pointer_types {};
|
|||
template <class _Tp, class _AllocPtr, class _KVTypes>
|
||||
struct __tree_map_pointer_types<_Tp, _AllocPtr, _KVTypes, true> {
|
||||
typedef typename _KVTypes::__map_value_type _Mv;
|
||||
typedef typename __rebind_pointer<_AllocPtr, _Mv>::type
|
||||
typedef __rebind_pointer_t<_AllocPtr, _Mv>
|
||||
__map_value_type_pointer;
|
||||
typedef typename __rebind_pointer<_AllocPtr, const _Mv>::type
|
||||
typedef __rebind_pointer_t<_AllocPtr, const _Mv>
|
||||
__const_map_value_type_pointer;
|
||||
};
|
||||
|
||||
|
@ -689,9 +689,9 @@ public:
|
|||
typedef _NodePtr __node_pointer;
|
||||
|
||||
typedef _Tp __node_value_type;
|
||||
typedef typename __rebind_pointer<_VoidPtr, __node_value_type>::type
|
||||
typedef __rebind_pointer_t<_VoidPtr, __node_value_type>
|
||||
__node_value_type_pointer;
|
||||
typedef typename __rebind_pointer<_VoidPtr, const __node_value_type>::type
|
||||
typedef __rebind_pointer_t<_VoidPtr, const __node_value_type>
|
||||
__const_node_value_type_pointer;
|
||||
#if defined(_LIBCPP_ABI_TREE_REMOVE_NODE_POINTER_UB)
|
||||
typedef typename __base::__end_node_pointer __iter_pointer;
|
||||
|
@ -704,13 +704,13 @@ public:
|
|||
private:
|
||||
static_assert(!is_const<__node_type>::value,
|
||||
"_NodePtr should never be a pointer to const");
|
||||
static_assert((is_same<typename __rebind_pointer<_VoidPtr, __node_type>::type,
|
||||
static_assert((is_same<__rebind_pointer_t<_VoidPtr, __node_type>,
|
||||
_NodePtr>::value), "_VoidPtr does not rebind to _NodePtr.");
|
||||
};
|
||||
|
||||
template <class _ValueTp, class _VoidPtr>
|
||||
struct __make_tree_node_types {
|
||||
typedef typename __rebind_pointer<_VoidPtr, __tree_node<_ValueTp, _VoidPtr> >::type
|
||||
typedef __rebind_pointer_t<_VoidPtr, __tree_node<_ValueTp, _VoidPtr> >
|
||||
_NodePtr;
|
||||
typedef __tree_node_types<_NodePtr> type;
|
||||
};
|
||||
|
@ -1277,14 +1277,14 @@ public:
|
|||
}
|
||||
|
||||
template <class _Vp,
|
||||
class = __enable_if_t<!is_same<typename __unconstref<_Vp>::type, __container_value_type>::value> >
|
||||
class = __enable_if_t<!is_same<__remove_const_ref_t<_Vp>, __container_value_type>::value> >
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pair<iterator, bool> __insert_unique(_Vp&& __v) {
|
||||
return __emplace_unique(_VSTD::forward<_Vp>(__v));
|
||||
}
|
||||
|
||||
template <class _Vp,
|
||||
class = __enable_if_t<!is_same<typename __unconstref<_Vp>::type, __container_value_type>::value> >
|
||||
class = __enable_if_t<!is_same<__remove_const_ref_t<_Vp>, __container_value_type>::value> >
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
iterator __insert_unique(const_iterator __p, _Vp&& __v) {
|
||||
return __emplace_hint_unique(__p, _VSTD::forward<_Vp>(__v));
|
||||
|
|
|
@ -57,7 +57,7 @@ template <>
|
|||
struct __apply_cv_mf<true, true, true> {
|
||||
template <class _Tp> using __apply _LIBCPP_NODEBUG = const volatile _Tp&;
|
||||
};
|
||||
template <class _Tp, class _RawTp = typename remove_reference<_Tp>::type>
|
||||
template <class _Tp, class _RawTp = __libcpp_remove_reference_t<_Tp> >
|
||||
using __apply_cv_t _LIBCPP_NODEBUG = __apply_cv_mf<
|
||||
is_lvalue_reference<_Tp>::value,
|
||||
is_const<_RawTp>::value,
|
||||
|
|
|
@ -56,13 +56,13 @@ struct __make_tuple_types_flat<array<_Vt, _Np>, __tuple_indices<_Idx...>> {
|
|||
>;
|
||||
};
|
||||
|
||||
template <class _Tp, size_t _Ep = tuple_size<typename remove_reference<_Tp>::type>::value,
|
||||
template <class _Tp, size_t _Ep = tuple_size<__libcpp_remove_reference_t<_Tp> >::value,
|
||||
size_t _Sp = 0,
|
||||
bool _SameSize = (_Ep == tuple_size<typename remove_reference<_Tp>::type>::value)>
|
||||
bool _SameSize = (_Ep == tuple_size<__libcpp_remove_reference_t<_Tp> >::value)>
|
||||
struct __make_tuple_types
|
||||
{
|
||||
static_assert(_Sp <= _Ep, "__make_tuple_types input error");
|
||||
using _RawTp = typename remove_cv<typename remove_reference<_Tp>::type>::type;
|
||||
using _RawTp = __remove_cv_t<__libcpp_remove_reference_t<_Tp> >;
|
||||
using _Maker = __make_tuple_types_flat<_RawTp, typename __make_tuple_indices<_Ep, _Sp>::type>;
|
||||
using type = typename _Maker::template __apply_quals<_Tp>;
|
||||
};
|
||||
|
|
|
@ -58,7 +58,7 @@ struct __tuple_sfinae_base {
|
|||
|
||||
// __tuple_convertible
|
||||
|
||||
template <class _Tp, class _Up, bool = __tuple_like<typename remove_reference<_Tp>::type>::value,
|
||||
template <class _Tp, class _Up, bool = __tuple_like<__libcpp_remove_reference_t<_Tp> >::value,
|
||||
bool = __tuple_like<_Up>::value>
|
||||
struct __tuple_convertible
|
||||
: public false_type {};
|
||||
|
@ -73,7 +73,7 @@ struct __tuple_convertible<_Tp, _Up, true, true>
|
|||
|
||||
// __tuple_constructible
|
||||
|
||||
template <class _Tp, class _Up, bool = __tuple_like<typename remove_reference<_Tp>::type>::value,
|
||||
template <class _Tp, class _Up, bool = __tuple_like<__libcpp_remove_reference_t<_Tp> >::value,
|
||||
bool = __tuple_like<_Up>::value>
|
||||
struct __tuple_constructible
|
||||
: public false_type {};
|
||||
|
@ -88,7 +88,7 @@ struct __tuple_constructible<_Tp, _Up, true, true>
|
|||
|
||||
// __tuple_assignable
|
||||
|
||||
template <class _Tp, class _Up, bool = __tuple_like<typename remove_reference<_Tp>::type>::value,
|
||||
template <class _Tp, class _Up, bool = __tuple_like<__libcpp_remove_reference_t<_Tp> >::value,
|
||||
bool = __tuple_like<_Up>::value>
|
||||
struct __tuple_assignable
|
||||
: public false_type {};
|
||||
|
@ -115,7 +115,7 @@ template <class _SizeTrait, size_t _Expected>
|
|||
struct __tuple_like_with_size_imp<true, _SizeTrait, _Expected>
|
||||
: integral_constant<bool, _SizeTrait::value == _Expected> {};
|
||||
|
||||
template <class _Tuple, size_t _ExpectedSize, class _RawTuple = __uncvref_t<_Tuple> >
|
||||
template <class _Tuple, size_t _ExpectedSize, class _RawTuple = __libcpp_remove_reference_t<_Tuple> >
|
||||
using __tuple_like_with_size _LIBCPP_NODEBUG = __tuple_like_with_size_imp<
|
||||
__tuple_like<_RawTuple>::value,
|
||||
tuple_size<_RawTuple>, _ExpectedSize
|
||||
|
|
|
@ -19,23 +19,33 @@
|
|||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
#if __has_builtin(__add_lvalue_reference)
|
||||
|
||||
template <class _Tp>
|
||||
struct add_lvalue_reference {
|
||||
using type _LIBCPP_NODEBUG = __add_lvalue_reference(_Tp);
|
||||
};
|
||||
using __add_lvalue_reference_t = __add_lvalue_reference(_Tp);
|
||||
|
||||
#else
|
||||
|
||||
template <class _Tp, bool = __libcpp_is_referenceable<_Tp>::value>
|
||||
struct __add_lvalue_reference_impl {
|
||||
typedef _LIBCPP_NODEBUG _Tp type;
|
||||
};
|
||||
template <class _Tp > struct __add_lvalue_reference_impl<_Tp, true> { typedef _LIBCPP_NODEBUG _Tp& type; };
|
||||
template <class _Tp >
|
||||
struct __add_lvalue_reference_impl<_Tp, true> {
|
||||
typedef _LIBCPP_NODEBUG _Tp& type;
|
||||
};
|
||||
|
||||
template <class _Tp>
|
||||
using __add_lvalue_reference_t = typename __add_lvalue_reference_impl<_Tp>::type;
|
||||
|
||||
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS add_lvalue_reference
|
||||
{typedef _LIBCPP_NODEBUG typename __add_lvalue_reference_impl<_Tp>::type type;};
|
||||
#endif // __has_builtin(__add_lvalue_reference)
|
||||
|
||||
template <class _Tp>
|
||||
struct add_lvalue_reference {
|
||||
using type _LIBCPP_NODEBUG = __add_lvalue_reference_t<_Tp>;
|
||||
};
|
||||
|
||||
#if _LIBCPP_STD_VER > 11
|
||||
template <class _Tp> using add_lvalue_reference_t = typename add_lvalue_reference<_Tp>::type;
|
||||
template <class _Tp> using add_lvalue_reference_t = __add_lvalue_reference_t<_Tp>;
|
||||
#endif
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#include <__config>
|
||||
#include <__type_traits/is_referenceable.h>
|
||||
#include <__type_traits/is_same.h>
|
||||
#include <__type_traits/is_void.h>
|
||||
#include <__type_traits/remove_cv.h>
|
||||
#include <__type_traits/remove_reference.h>
|
||||
|
||||
|
@ -22,25 +23,31 @@
|
|||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
#if __has_builtin(__add_pointer)
|
||||
|
||||
template <class _Tp>
|
||||
struct add_pointer {
|
||||
using type _LIBCPP_NODEBUG = __add_pointer(_Tp);
|
||||
};
|
||||
using __add_pointer_t = __add_pointer(_Tp);
|
||||
|
||||
#else
|
||||
template <class _Tp,
|
||||
bool = __libcpp_is_referenceable<_Tp>::value || _IsSame<typename remove_cv<_Tp>::type, void>::value>
|
||||
bool = __libcpp_is_referenceable<_Tp>::value || is_void<_Tp>::value>
|
||||
struct __add_pointer_impl {
|
||||
typedef _LIBCPP_NODEBUG typename remove_reference<_Tp>::type* type;
|
||||
typedef _LIBCPP_NODEBUG __libcpp_remove_reference_t<_Tp>* type;
|
||||
};
|
||||
template <class _Tp> struct __add_pointer_impl<_Tp, false>
|
||||
{typedef _LIBCPP_NODEBUG _Tp type;};
|
||||
|
||||
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS add_pointer
|
||||
{typedef _LIBCPP_NODEBUG typename __add_pointer_impl<_Tp>::type type;};
|
||||
template <class _Tp>
|
||||
using __add_pointer_t = typename __add_pointer_impl<_Tp>::type;
|
||||
|
||||
#endif // __has_builtin(__add_pointer)
|
||||
|
||||
template <class _Tp>
|
||||
struct add_pointer {
|
||||
using type _LIBCPP_NODEBUG = __add_pointer_t<_Tp>;
|
||||
};
|
||||
|
||||
#if _LIBCPP_STD_VER > 11
|
||||
template <class _Tp> using add_pointer_t = typename add_pointer<_Tp>::type;
|
||||
template <class _Tp> using add_pointer_t = __add_pointer_t<_Tp>;
|
||||
#endif
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
|
|
@ -19,23 +19,34 @@
|
|||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
#if __has_builtin(__add_rvalue_reference)
|
||||
|
||||
template <class _Tp>
|
||||
struct add_rvalue_reference {
|
||||
using type _LIBCPP_NODEBUG = __add_rvalue_reference(_Tp);
|
||||
};
|
||||
using __add_rvalue_reference_t = __add_rvalue_reference(_Tp);
|
||||
|
||||
#else
|
||||
|
||||
template <class _Tp, bool = __libcpp_is_referenceable<_Tp>::value>
|
||||
struct __add_rvalue_reference_impl {
|
||||
typedef _LIBCPP_NODEBUG _Tp type;
|
||||
};
|
||||
template <class _Tp > struct __add_rvalue_reference_impl<_Tp, true> { typedef _LIBCPP_NODEBUG _Tp&& type; };
|
||||
template <class _Tp >
|
||||
struct __add_rvalue_reference_impl<_Tp, true> {
|
||||
typedef _LIBCPP_NODEBUG _Tp&& type;
|
||||
};
|
||||
|
||||
template <class _Tp>
|
||||
using __add_rvalue_reference_t = typename __add_rvalue_reference_impl<_Tp>::type;
|
||||
|
||||
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS add_rvalue_reference
|
||||
{typedef _LIBCPP_NODEBUG typename __add_rvalue_reference_impl<_Tp>::type type;};
|
||||
#endif // __has_builtin(__add_rvalue_reference)
|
||||
|
||||
template <class _Tp>
|
||||
struct add_rvalue_reference {
|
||||
using type = __add_rvalue_reference_t<_Tp>;
|
||||
};
|
||||
|
||||
#if _LIBCPP_STD_VER > 11
|
||||
template <class _Tp> using add_rvalue_reference_t = typename add_rvalue_reference<_Tp>::type;
|
||||
template <class _Tp>
|
||||
using add_rvalue_reference_t = __add_rvalue_reference_t<_Tp>;
|
||||
#endif
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
|
|
@ -21,8 +21,8 @@
|
|||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
template <class _Tp, class _Up, bool = is_const<typename remove_reference<_Tp>::type>::value,
|
||||
bool = is_volatile<typename remove_reference<_Tp>::type>::value>
|
||||
template <class _Tp, class _Up, bool = is_const<__libcpp_remove_reference_t<_Tp> >::value,
|
||||
bool = is_volatile<__libcpp_remove_reference_t<_Tp> >::value>
|
||||
struct __apply_cv
|
||||
{
|
||||
typedef _LIBCPP_NODEBUG _Up type;
|
||||
|
|
|
@ -29,21 +29,21 @@ struct __extract_key_self_tag {};
|
|||
struct __extract_key_first_tag {};
|
||||
|
||||
template <class _ValTy, class _Key,
|
||||
class _RawValTy = typename __unconstref<_ValTy>::type>
|
||||
class _RawValTy = __remove_const_ref_t<_ValTy> >
|
||||
struct __can_extract_key
|
||||
: conditional<_IsSame<_RawValTy, _Key>::value, __extract_key_self_tag,
|
||||
__extract_key_fail_tag>::type {};
|
||||
|
||||
template <class _Pair, class _Key, class _First, class _Second>
|
||||
struct __can_extract_key<_Pair, _Key, pair<_First, _Second> >
|
||||
: conditional<_IsSame<typename remove_const<_First>::type, _Key>::value,
|
||||
: conditional<_IsSame<__remove_const_t<_First>, _Key>::value,
|
||||
__extract_key_first_tag, __extract_key_fail_tag>::type {};
|
||||
|
||||
// __can_extract_map_key uses true_type/false_type instead of the tags.
|
||||
// It returns true if _Key != _ContainerValueTy (the container is a map not a set)
|
||||
// and _ValTy == _Key.
|
||||
template <class _ValTy, class _Key, class _ContainerValueTy,
|
||||
class _RawValTy = typename __unconstref<_ValTy>::type>
|
||||
class _RawValTy = __remove_const_ref_t<_ValTy> >
|
||||
struct __can_extract_map_key
|
||||
: integral_constant<bool, _IsSame<_RawValTy, _Key>::value> {};
|
||||
|
||||
|
|
|
@ -29,13 +29,13 @@ struct __copy_cvref
|
|||
template <class _From, class _To>
|
||||
struct __copy_cvref<_From&, _To>
|
||||
{
|
||||
using type = typename add_lvalue_reference<__copy_cv_t<_From, _To> >::type;
|
||||
using type = __add_lvalue_reference_t<__copy_cv_t<_From, _To> >;
|
||||
};
|
||||
|
||||
template <class _From, class _To>
|
||||
struct __copy_cvref<_From&&, _To>
|
||||
{
|
||||
using type = typename add_rvalue_reference<__copy_cv_t<_From, _To> >::type;
|
||||
using type = __add_rvalue_reference_t<__copy_cv_t<_From, _To> >;
|
||||
};
|
||||
|
||||
template <class _From, class _To>
|
||||
|
|
|
@ -33,7 +33,7 @@ struct decay {
|
|||
#else
|
||||
template <class _Up, bool>
|
||||
struct __decay {
|
||||
typedef _LIBCPP_NODEBUG typename remove_cv<_Up>::type type;
|
||||
typedef _LIBCPP_NODEBUG __remove_cv_t<_Up> type;
|
||||
};
|
||||
|
||||
template <class _Up>
|
||||
|
@ -42,12 +42,12 @@ public:
|
|||
typedef _LIBCPP_NODEBUG typename conditional
|
||||
<
|
||||
is_array<_Up>::value,
|
||||
typename remove_extent<_Up>::type*,
|
||||
__remove_extent_t<_Up>*,
|
||||
typename conditional
|
||||
<
|
||||
is_function<_Up>::value,
|
||||
typename add_pointer<_Up>::type,
|
||||
typename remove_cv<_Up>::type
|
||||
__remove_cv_t<_Up>
|
||||
>::type
|
||||
>::type type;
|
||||
};
|
||||
|
@ -56,7 +56,7 @@ template <class _Tp>
|
|||
struct _LIBCPP_TEMPLATE_VIS decay
|
||||
{
|
||||
private:
|
||||
typedef _LIBCPP_NODEBUG typename remove_reference<_Tp>::type _Up;
|
||||
typedef _LIBCPP_NODEBUG __libcpp_remove_reference_t<_Tp> _Up;
|
||||
public:
|
||||
typedef _LIBCPP_NODEBUG typename __decay<_Up, __libcpp_is_referenceable<_Up>::value>::type type;
|
||||
};
|
||||
|
|
|
@ -53,7 +53,7 @@ template <class _Tp> struct __is_array_function_or_void<_Tp, false, false, true>
|
|||
}
|
||||
|
||||
template <class _Tp,
|
||||
unsigned = __is_convertible_imp::__is_array_function_or_void<typename remove_reference<_Tp>::type>::value>
|
||||
unsigned = __is_convertible_imp::__is_array_function_or_void<__libcpp_remove_reference_t<_Tp> >::value>
|
||||
struct __is_convertible_check
|
||||
{
|
||||
static const size_t __v = 0;
|
||||
|
|
|
@ -24,8 +24,8 @@ template <class _Tp>
|
|||
struct _LIBCPP_TEMPLATE_VIS is_copy_assignable
|
||||
: public integral_constant<
|
||||
bool,
|
||||
__is_assignable(typename add_lvalue_reference<_Tp>::type,
|
||||
typename add_lvalue_reference<typename add_const<_Tp>::type>::type)> {};
|
||||
__is_assignable(__add_lvalue_reference_t<_Tp>,
|
||||
__add_lvalue_reference_t<typename add_const<_Tp>::type>)> {};
|
||||
|
||||
#if _LIBCPP_STD_VER > 14
|
||||
template <class _Tp>
|
||||
|
|
|
@ -24,7 +24,7 @@ template <class _Tp>
|
|||
struct _LIBCPP_TEMPLATE_VIS is_copy_constructible
|
||||
: public integral_constant<
|
||||
bool,
|
||||
__is_constructible(_Tp, typename add_lvalue_reference<typename add_const<_Tp>::type>::type)> {};
|
||||
__is_constructible(_Tp, __add_lvalue_reference_t<typename add_const<_Tp>::type>)> {};
|
||||
|
||||
#if _LIBCPP_STD_VER > 14
|
||||
template <class _Tp>
|
||||
|
|
|
@ -63,7 +63,7 @@ struct __destructible_imp;
|
|||
template <class _Tp>
|
||||
struct __destructible_imp<_Tp, false>
|
||||
: public integral_constant<bool,
|
||||
__is_destructor_wellformed<typename remove_all_extents<_Tp>::type>::value> {};
|
||||
__is_destructor_wellformed<__remove_all_extents_t<_Tp> >::value> {};
|
||||
|
||||
template <class _Tp>
|
||||
struct __destructible_imp<_Tp, true>
|
||||
|
|
|
@ -25,7 +25,7 @@ template <> struct __libcpp_is_floating_point<double> : public tru
|
|||
template <> struct __libcpp_is_floating_point<long double> : public true_type {};
|
||||
|
||||
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_floating_point
|
||||
: public __libcpp_is_floating_point<typename remove_cv<_Tp>::type> {};
|
||||
: public __libcpp_is_floating_point<__remove_cv_t<_Tp> > {};
|
||||
|
||||
#if _LIBCPP_STD_VER > 14
|
||||
template <class _Tp>
|
||||
|
|
|
@ -58,7 +58,7 @@ inline constexpr bool is_integral_v = __is_integral(_Tp);
|
|||
#else
|
||||
|
||||
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_integral
|
||||
: public _BoolConstant<__libcpp_is_integral<typename remove_cv<_Tp>::type>::value> {};
|
||||
: public _BoolConstant<__libcpp_is_integral<__remove_cv_t<_Tp> >::value> {};
|
||||
|
||||
#if _LIBCPP_STD_VER > 14
|
||||
template <class _Tp>
|
||||
|
|
|
@ -50,7 +50,7 @@ inline constexpr bool is_member_function_pointer_v = __is_member_function_pointe
|
|||
#else // __has_builtin(__is_member_function_pointer)
|
||||
|
||||
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_member_function_pointer
|
||||
: public _BoolConstant< __libcpp_is_member_pointer<typename remove_cv<_Tp>::type>::__is_func > {};
|
||||
: public _BoolConstant< __libcpp_is_member_pointer<__remove_cv_t<_Tp> >::__is_func > {};
|
||||
|
||||
#if _LIBCPP_STD_VER > 14
|
||||
template <class _Tp>
|
||||
|
|
|
@ -32,7 +32,7 @@ inline constexpr bool is_member_object_pointer_v = __is_member_object_pointer(_T
|
|||
#else // __has_builtin(__is_member_object_pointer)
|
||||
|
||||
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_member_object_pointer
|
||||
: public _BoolConstant< __libcpp_is_member_pointer<typename remove_cv<_Tp>::type>::__is_obj > {};
|
||||
: public _BoolConstant< __libcpp_is_member_pointer<__remove_cv_t<_Tp> >::__is_obj > {};
|
||||
|
||||
#if _LIBCPP_STD_VER > 14
|
||||
template <class _Tp>
|
||||
|
|
|
@ -31,7 +31,7 @@ inline constexpr bool is_member_pointer_v = __is_member_pointer(_Tp);
|
|||
#else // __has_builtin(__is_member_pointer)
|
||||
|
||||
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_member_pointer
|
||||
: public _BoolConstant< __libcpp_is_member_pointer<typename remove_cv<_Tp>::type>::__is_member > {};
|
||||
: public _BoolConstant< __libcpp_is_member_pointer<__remove_cv_t<_Tp> >::__is_member > {};
|
||||
|
||||
#if _LIBCPP_STD_VER > 14
|
||||
template <class _Tp>
|
||||
|
|
|
@ -24,7 +24,7 @@ template <class _Tp>
|
|||
struct _LIBCPP_TEMPLATE_VIS is_move_assignable
|
||||
: public integral_constant<
|
||||
bool,
|
||||
__is_assignable(typename add_lvalue_reference<_Tp>::type, typename add_rvalue_reference<_Tp>::type)> {};
|
||||
__is_assignable(__add_lvalue_reference_t<_Tp>, __add_rvalue_reference_t<_Tp>)> {};
|
||||
|
||||
#if _LIBCPP_STD_VER > 14
|
||||
template <class _Tp>
|
||||
|
|
|
@ -21,7 +21,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
|
|||
|
||||
template <class _Tp>
|
||||
struct _LIBCPP_TEMPLATE_VIS is_move_constructible
|
||||
: public integral_constant<bool, __is_constructible(_Tp, typename add_rvalue_reference<_Tp>::type)>
|
||||
: public integral_constant<bool, __is_constructible(_Tp, __add_rvalue_reference_t<_Tp>)>
|
||||
{};
|
||||
|
||||
#if _LIBCPP_STD_VER > 14
|
||||
|
|
|
@ -25,8 +25,8 @@ struct _LIBCPP_TEMPLATE_VIS is_nothrow_copy_assignable
|
|||
: public integral_constant<
|
||||
bool,
|
||||
__is_nothrow_assignable(
|
||||
typename add_lvalue_reference<_Tp>::type,
|
||||
typename add_lvalue_reference<typename add_const<_Tp>::type>::type)> {};
|
||||
__add_lvalue_reference_t<_Tp>,
|
||||
__add_lvalue_reference_t<typename add_const<_Tp>::type>)> {};
|
||||
|
||||
#if _LIBCPP_STD_VER > 14
|
||||
template <class _Tp>
|
||||
|
|
|
@ -26,7 +26,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
|
|||
|
||||
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_nothrow_copy_constructible
|
||||
: public is_nothrow_constructible<_Tp,
|
||||
typename add_lvalue_reference<typename add_const<_Tp>::type>::type> {};
|
||||
__add_lvalue_reference_t<typename add_const<_Tp>::type> > {};
|
||||
|
||||
#else // _LIBCPP_COMPILER_GCC
|
||||
|
||||
|
|
|
@ -71,7 +71,7 @@ template <class _Tp> struct __libcpp_nothrow_destructor
|
|||
is_reference<_Tp>::value> {};
|
||||
|
||||
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_nothrow_destructible
|
||||
: public __libcpp_nothrow_destructor<typename remove_all_extents<_Tp>::type> {};
|
||||
: public __libcpp_nothrow_destructor<__remove_all_extents_t<_Tp> > {};
|
||||
|
||||
template <class _Tp>
|
||||
struct _LIBCPP_TEMPLATE_VIS is_nothrow_destructible<_Tp[]>
|
||||
|
|
|
@ -24,7 +24,7 @@ template <class _Tp>
|
|||
struct _LIBCPP_TEMPLATE_VIS is_nothrow_move_assignable
|
||||
: public integral_constant<
|
||||
bool,
|
||||
__is_nothrow_assignable(typename add_lvalue_reference<_Tp>::type, typename add_rvalue_reference<_Tp>::type)> {
|
||||
__is_nothrow_assignable(__add_lvalue_reference_t<_Tp>, __add_rvalue_reference_t<_Tp>)> {
|
||||
};
|
||||
|
||||
#if _LIBCPP_STD_VER > 14
|
||||
|
|
|
@ -24,13 +24,13 @@ _LIBCPP_BEGIN_NAMESPACE_STD
|
|||
#ifndef _LIBCPP_COMPILER_GCC
|
||||
|
||||
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_nothrow_move_constructible
|
||||
: public integral_constant<bool, __is_nothrow_constructible(_Tp, typename add_rvalue_reference<_Tp>::type)>
|
||||
: public integral_constant<bool, __is_nothrow_constructible(_Tp, __add_rvalue_reference_t<_Tp>)>
|
||||
{};
|
||||
|
||||
#else // _LIBCPP_COMPILER_GCC
|
||||
|
||||
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_nothrow_move_constructible
|
||||
: public is_nothrow_constructible<_Tp, typename add_rvalue_reference<_Tp>::type>
|
||||
: public is_nothrow_constructible<_Tp, __add_rvalue_reference_t<_Tp> >
|
||||
{};
|
||||
|
||||
#endif // _LIBCPP_COMPILER_GCC
|
||||
|
|
|
@ -24,11 +24,11 @@ template <class _Tp> struct __is_nullptr_t_impl : public false_type {};
|
|||
template <> struct __is_nullptr_t_impl<nullptr_t> : public true_type {};
|
||||
|
||||
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS __is_nullptr_t
|
||||
: public __is_nullptr_t_impl<typename remove_cv<_Tp>::type> {};
|
||||
: public __is_nullptr_t_impl<__remove_cv_t<_Tp> > {};
|
||||
|
||||
#if _LIBCPP_STD_VER > 11
|
||||
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_null_pointer
|
||||
: public __is_nullptr_t_impl<typename remove_cv<_Tp>::type> {};
|
||||
: public __is_nullptr_t_impl<__remove_cv_t<_Tp> > {};
|
||||
|
||||
#if _LIBCPP_STD_VER > 14
|
||||
template <class _Tp>
|
||||
|
|
|
@ -43,7 +43,7 @@ template <class _Tp> struct __libcpp_remove_objc_qualifiers<_Tp __unsafe_unretai
|
|||
#endif
|
||||
|
||||
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_pointer
|
||||
: public __libcpp_is_pointer<typename __libcpp_remove_objc_qualifiers<typename remove_cv<_Tp>::type>::type> {};
|
||||
: public __libcpp_is_pointer<typename __libcpp_remove_objc_qualifiers<__remove_cv_t<_Tp> >::type> {};
|
||||
|
||||
#if _LIBCPP_STD_VER > 14
|
||||
template <class _Tp>
|
||||
|
|
|
@ -24,7 +24,7 @@ template <class _Tp> class _LIBCPP_TEMPLATE_VIS reference_wrapper;
|
|||
template <class _Tp> struct __is_reference_wrapper_impl : public false_type {};
|
||||
template <class _Tp> struct __is_reference_wrapper_impl<reference_wrapper<_Tp> > : public true_type {};
|
||||
template <class _Tp> struct __is_reference_wrapper
|
||||
: public __is_reference_wrapper_impl<typename remove_cv<_Tp>::type> {};
|
||||
: public __is_reference_wrapper_impl<__remove_cv_t<_Tp> > {};
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
|
|
|
@ -121,8 +121,8 @@ struct _LIBCPP_TEMPLATE_VIS is_swappable
|
|||
: public conditional<
|
||||
__libcpp_is_referenceable<_Tp>::value,
|
||||
is_swappable_with<
|
||||
typename add_lvalue_reference<_Tp>::type,
|
||||
typename add_lvalue_reference<_Tp>::type>,
|
||||
__add_lvalue_reference_t<_Tp>,
|
||||
__add_lvalue_reference_t<_Tp> >,
|
||||
false_type
|
||||
>::type
|
||||
{
|
||||
|
@ -139,8 +139,8 @@ struct _LIBCPP_TEMPLATE_VIS is_nothrow_swappable
|
|||
: public conditional<
|
||||
__libcpp_is_referenceable<_Tp>::value,
|
||||
is_nothrow_swappable_with<
|
||||
typename add_lvalue_reference<_Tp>::type,
|
||||
typename add_lvalue_reference<_Tp>::type>,
|
||||
__add_lvalue_reference_t<_Tp>,
|
||||
__add_lvalue_reference_t<_Tp> >,
|
||||
false_type
|
||||
>::type
|
||||
{
|
||||
|
|
|
@ -25,8 +25,8 @@ struct _LIBCPP_TEMPLATE_VIS is_trivially_copy_assignable
|
|||
: public integral_constant<
|
||||
bool,
|
||||
__is_trivially_assignable(
|
||||
typename add_lvalue_reference<_Tp>::type,
|
||||
typename add_lvalue_reference<typename add_const<_Tp>::type>::type)> {};
|
||||
__add_lvalue_reference_t<_Tp>,
|
||||
__add_lvalue_reference_t<typename add_const<_Tp>::type>)> {};
|
||||
|
||||
#if _LIBCPP_STD_VER > 14
|
||||
template <class _Tp>
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_trivially_copy_constructible
|
||||
: public integral_constant<bool, __is_trivially_constructible(_Tp, typename add_lvalue_reference<const _Tp>::type)>
|
||||
: public integral_constant<bool, __is_trivially_constructible(_Tp, __add_lvalue_reference_t<const _Tp>)>
|
||||
{};
|
||||
|
||||
#if _LIBCPP_STD_VER > 14
|
||||
|
|
|
@ -24,8 +24,7 @@ template <class _Tp>
|
|||
struct _LIBCPP_TEMPLATE_VIS is_trivially_move_assignable
|
||||
: public integral_constant<
|
||||
bool,
|
||||
__is_trivially_assignable(
|
||||
typename add_lvalue_reference<_Tp>::type, typename add_rvalue_reference<_Tp>::type)> {};
|
||||
__is_trivially_assignable(__add_lvalue_reference_t<_Tp>, __add_rvalue_reference_t<_Tp>)> {};
|
||||
|
||||
#if _LIBCPP_STD_VER > 14
|
||||
template <class _Tp>
|
||||
|
|
|
@ -21,7 +21,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
|
|||
|
||||
template <class _Tp>
|
||||
struct _LIBCPP_TEMPLATE_VIS is_trivially_move_constructible
|
||||
: public integral_constant<bool, __is_trivially_constructible(_Tp, typename add_rvalue_reference<_Tp>::type)> {};
|
||||
: public integral_constant<bool, __is_trivially_constructible(_Tp, __add_rvalue_reference_t<_Tp>)> {};
|
||||
|
||||
#if _LIBCPP_STD_VER > 14
|
||||
template <class _Tp>
|
||||
|
|
|
@ -31,7 +31,7 @@ inline constexpr bool is_void_v = __is_void(_Tp);
|
|||
#else
|
||||
|
||||
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_void
|
||||
: public is_same<typename remove_cv<_Tp>::type, void> {};
|
||||
: public is_same<__remove_cv_t<_Tp>, void> {};
|
||||
|
||||
#if _LIBCPP_STD_VER > 14
|
||||
template <class _Tp>
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
template<class _Tp>
|
||||
using __make_const_lvalue_ref = const typename remove_reference<_Tp>::type&;
|
||||
using __make_const_lvalue_ref = const __libcpp_remove_reference_t<_Tp>&;
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
|
|
|
@ -24,10 +24,10 @@
|
|||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
#if __has_builtin(__make_signed)
|
||||
|
||||
template <class _Tp>
|
||||
struct make_signed {
|
||||
using type _LIBCPP_NODEBUG = __make_signed(_Tp);
|
||||
};
|
||||
using __make_signed_t = __make_signed(_Tp);
|
||||
|
||||
#else
|
||||
typedef
|
||||
__type_list<signed char,
|
||||
|
@ -68,14 +68,17 @@ template <> struct __make_signed<__uint128_t, true> {typedef __int128_t t
|
|||
# endif
|
||||
|
||||
template <class _Tp>
|
||||
struct _LIBCPP_TEMPLATE_VIS make_signed
|
||||
{
|
||||
typedef typename __apply_cv<_Tp, typename __make_signed<typename remove_cv<_Tp>::type>::type>::type type;
|
||||
};
|
||||
using __make_signed_t = typename __apply_cv<_Tp, typename __make_signed<__remove_cv_t<_Tp> >::type>::type;
|
||||
|
||||
#endif // __has_builtin(__make_signed)
|
||||
|
||||
template <class _Tp>
|
||||
struct make_signed {
|
||||
using type _LIBCPP_NODEBUG = __make_signed_t<_Tp>;
|
||||
};
|
||||
|
||||
#if _LIBCPP_STD_VER > 11
|
||||
template <class _Tp> using make_signed_t = typename make_signed<_Tp>::type;
|
||||
template <class _Tp> using make_signed_t = __make_signed_t<_Tp>;
|
||||
#endif
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
|
|
@ -26,10 +26,10 @@
|
|||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
#if __has_builtin(__make_unsigned)
|
||||
|
||||
template <class _Tp>
|
||||
struct make_unsigned {
|
||||
using type _LIBCPP_NODEBUG = __make_unsigned(_Tp);
|
||||
};
|
||||
using __make_unsigned_t = __make_unsigned(_Tp);
|
||||
|
||||
#else
|
||||
typedef
|
||||
__type_list<unsigned char,
|
||||
|
@ -70,26 +70,29 @@ template <> struct __make_unsigned<__uint128_t, true> {typedef __uint128_
|
|||
# endif
|
||||
|
||||
template <class _Tp>
|
||||
struct _LIBCPP_TEMPLATE_VIS make_unsigned
|
||||
{
|
||||
typedef typename __apply_cv<_Tp, typename __make_unsigned<typename remove_cv<_Tp>::type>::type>::type type;
|
||||
};
|
||||
using __make_unsigned_t = typename __apply_cv<_Tp, typename __make_unsigned<__remove_cv_t<_Tp> >::type>::type;
|
||||
|
||||
#endif // __has_builtin(__make_unsigned)
|
||||
|
||||
template <class _Tp>
|
||||
struct make_unsigned {
|
||||
using type _LIBCPP_NODEBUG = __make_unsigned_t<_Tp>;
|
||||
};
|
||||
|
||||
#if _LIBCPP_STD_VER > 11
|
||||
template <class _Tp> using make_unsigned_t = typename make_unsigned<_Tp>::type;
|
||||
template <class _Tp> using make_unsigned_t = __make_unsigned_t<_Tp>;
|
||||
#endif
|
||||
|
||||
#ifndef _LIBCPP_CXX03_LANG
|
||||
template <class _Tp>
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr
|
||||
typename make_unsigned<_Tp>::type __to_unsigned_like(_Tp __x) noexcept {
|
||||
return static_cast<typename make_unsigned<_Tp>::type>(__x);
|
||||
__make_unsigned_t<_Tp> __to_unsigned_like(_Tp __x) noexcept {
|
||||
return static_cast<__make_unsigned_t<_Tp> >(__x);
|
||||
}
|
||||
#endif
|
||||
|
||||
template <class _Tp, class _Up>
|
||||
using __copy_unsigned_t = __conditional_t<is_unsigned<_Tp>::value, typename make_unsigned<_Up>::type, _Up>;
|
||||
using __copy_unsigned_t = __conditional_t<is_unsigned<_Tp>::value, __make_unsigned_t<_Up>, _Up>;
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
|
|
|
@ -23,6 +23,9 @@ template <class _Tp>
|
|||
struct remove_all_extents {
|
||||
using type _LIBCPP_NODEBUG = __remove_all_extents(_Tp);
|
||||
};
|
||||
|
||||
template <class _Tp>
|
||||
using __remove_all_extents_t = __remove_all_extents(_Tp);
|
||||
#else
|
||||
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_all_extents
|
||||
{typedef _Tp type;};
|
||||
|
@ -30,10 +33,13 @@ template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_all_extents<_Tp[]>
|
|||
{typedef typename remove_all_extents<_Tp>::type type;};
|
||||
template <class _Tp, size_t _Np> struct _LIBCPP_TEMPLATE_VIS remove_all_extents<_Tp[_Np]>
|
||||
{typedef typename remove_all_extents<_Tp>::type type;};
|
||||
|
||||
template <class _Tp>
|
||||
using __remove_all_extents_t = typename remove_all_extents<_Tp>::type;
|
||||
#endif // __has_builtin(__remove_all_extents)
|
||||
|
||||
#if _LIBCPP_STD_VER > 11
|
||||
template <class _Tp> using remove_all_extents_t = typename remove_all_extents<_Tp>::type;
|
||||
template <class _Tp> using remove_all_extents_t = __remove_all_extents_t<_Tp>;
|
||||
#endif
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
|
|
@ -22,13 +22,19 @@ template <class _Tp>
|
|||
struct remove_const {
|
||||
using type _LIBCPP_NODEBUG = __remove_const(_Tp);
|
||||
};
|
||||
|
||||
template <class _Tp>
|
||||
using __remove_const_t = __remove_const(_Tp);
|
||||
#else
|
||||
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_const {typedef _Tp type;};
|
||||
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_const<const _Tp> {typedef _Tp type;};
|
||||
|
||||
template <class _Tp>
|
||||
using __remove_const_t = typename remove_const<_Tp>::type;
|
||||
#endif // __has_builtin(__remove_const)
|
||||
|
||||
#if _LIBCPP_STD_VER > 11
|
||||
template <class _Tp> using remove_const_t = typename remove_const<_Tp>::type;
|
||||
template <class _Tp> using remove_const_t = __remove_const_t<_Tp>;
|
||||
#endif
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
|
|
@ -20,9 +20,7 @@
|
|||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
template <class _Tp>
|
||||
struct __unconstref {
|
||||
typedef _LIBCPP_NODEBUG typename remove_const<typename remove_reference<_Tp>::type>::type type;
|
||||
};
|
||||
using __remove_const_ref_t = __remove_const_t<__libcpp_remove_reference_t<_Tp> >;
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
|
|
|
@ -24,13 +24,19 @@ template <class _Tp>
|
|||
struct remove_cv {
|
||||
using type _LIBCPP_NODEBUG = __remove_cv(_Tp);
|
||||
};
|
||||
|
||||
template <class _Tp>
|
||||
using __remove_cv_t = __remove_cv(_Tp);
|
||||
#else
|
||||
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_cv
|
||||
{typedef typename remove_volatile<typename remove_const<_Tp>::type>::type type;};
|
||||
{typedef __remove_volatile_t<__remove_const_t<_Tp> > type;};
|
||||
|
||||
template <class _Tp>
|
||||
using __remove_cv_t = __remove_volatile_t<__remove_const_t<_Tp> >;
|
||||
#endif // __has_builtin(__remove_cv)
|
||||
|
||||
#if _LIBCPP_STD_VER > 11
|
||||
template <class _Tp> using remove_cv_t = typename remove_cv<_Tp>::type;
|
||||
template <class _Tp> using remove_cv_t = __remove_cv_t<_Tp>;
|
||||
#endif
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
|
|
@ -22,23 +22,22 @@ _LIBCPP_BEGIN_NAMESPACE_STD
|
|||
|
||||
#if __has_builtin(__remove_cvref)
|
||||
template <class _Tp>
|
||||
using __uncvref_t _LIBCPP_NODEBUG = __remove_cvref(_Tp);
|
||||
using __remove_cvref_t _LIBCPP_NODEBUG = __remove_cvref(_Tp);
|
||||
#else
|
||||
template <class _Tp>
|
||||
using __uncvref_t _LIBCPP_NODEBUG = typename remove_cv<typename remove_reference<_Tp>::type>::type;
|
||||
using __remove_cvref_t _LIBCPP_NODEBUG = __remove_cv_t<__libcpp_remove_reference_t<_Tp> >;
|
||||
#endif // __has_builtin(__remove_cvref)
|
||||
|
||||
template <class _Tp, class _Up>
|
||||
struct __is_same_uncvref : _IsSame<__uncvref_t<_Tp>, __uncvref_t<_Up> > {};
|
||||
struct __is_same_uncvref : _IsSame<__remove_cvref_t<_Tp>, __remove_cvref_t<_Up> > {};
|
||||
|
||||
#if _LIBCPP_STD_VER > 17
|
||||
// remove_cvref - same as __uncvref
|
||||
template <class _Tp>
|
||||
struct remove_cvref {
|
||||
using type _LIBCPP_NODEBUG = __uncvref_t<_Tp>;
|
||||
using type _LIBCPP_NODEBUG = __remove_cvref_t<_Tp>;
|
||||
};
|
||||
|
||||
template <class _Tp> using remove_cvref_t = typename remove_cvref<_Tp>::type;
|
||||
template <class _Tp> using remove_cvref_t = __remove_cvref_t<_Tp>;
|
||||
#endif
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
|
|
@ -23,6 +23,9 @@ template <class _Tp>
|
|||
struct remove_extent {
|
||||
using type _LIBCPP_NODEBUG = __remove_extent(_Tp);
|
||||
};
|
||||
|
||||
template <class _Tp>
|
||||
using __remove_extent_t = __remove_extent(_Tp);
|
||||
#else
|
||||
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_extent
|
||||
{typedef _Tp type;};
|
||||
|
@ -30,10 +33,13 @@ template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_extent<_Tp[]>
|
|||
{typedef _Tp type;};
|
||||
template <class _Tp, size_t _Np> struct _LIBCPP_TEMPLATE_VIS remove_extent<_Tp[_Np]>
|
||||
{typedef _Tp type;};
|
||||
|
||||
template <class _Tp>
|
||||
using __remove_extent_t = typename remove_extent<_Tp>::type;
|
||||
#endif // __has_builtin(__remove_extent)
|
||||
|
||||
#if _LIBCPP_STD_VER > 11
|
||||
template <class _Tp> using remove_extent_t = typename remove_extent<_Tp>::type;
|
||||
template <class _Tp> using remove_extent_t = __remove_extent_t<_Tp>;
|
||||
#endif
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
|
|
@ -22,16 +22,22 @@ template <class _Tp>
|
|||
struct remove_pointer {
|
||||
using type _LIBCPP_NODEBUG = __remove_pointer(_Tp);
|
||||
};
|
||||
|
||||
template <class _Tp>
|
||||
using __remove_pointer_t = __remove_pointer(_Tp);
|
||||
#else
|
||||
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_pointer {typedef _LIBCPP_NODEBUG _Tp type;};
|
||||
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_pointer<_Tp*> {typedef _LIBCPP_NODEBUG _Tp type;};
|
||||
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_pointer<_Tp* const> {typedef _LIBCPP_NODEBUG _Tp type;};
|
||||
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_pointer<_Tp* volatile> {typedef _LIBCPP_NODEBUG _Tp type;};
|
||||
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_pointer<_Tp* const volatile> {typedef _LIBCPP_NODEBUG _Tp type;};
|
||||
|
||||
template <class _Tp>
|
||||
using __remove_pointer_t = typename remove_pointer<_Tp>::type;
|
||||
#endif // __has_builtin(__remove_pointer)
|
||||
|
||||
#if _LIBCPP_STD_VER > 11
|
||||
template <class _Tp> using remove_pointer_t = typename remove_pointer<_Tp>::type;
|
||||
template <class _Tp> using remove_pointer_t = __remove_pointer_t<_Tp>;
|
||||
#endif
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
|
|
@ -23,14 +23,20 @@ template <class _Tp>
|
|||
struct remove_reference {
|
||||
using type _LIBCPP_NODEBUG = __remove_reference_t(_Tp);
|
||||
};
|
||||
|
||||
template <class _Tp>
|
||||
using __libcpp_remove_reference_t = __remove_reference_t(_Tp);
|
||||
#else
|
||||
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_reference {typedef _LIBCPP_NODEBUG _Tp type;};
|
||||
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_reference<_Tp&> {typedef _LIBCPP_NODEBUG _Tp type;};
|
||||
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_reference<_Tp&&> {typedef _LIBCPP_NODEBUG _Tp type;};
|
||||
|
||||
template <class _Tp>
|
||||
using __libcpp_remove_reference_t = typename remove_reference<_Tp>::type;
|
||||
#endif // __has_builtin(__remove_reference_t)
|
||||
|
||||
#if _LIBCPP_STD_VER > 11
|
||||
template <class _Tp> using remove_reference_t = typename remove_reference<_Tp>::type;
|
||||
template <class _Tp> using remove_reference_t = __libcpp_remove_reference_t<_Tp>;
|
||||
#endif
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
|
|
@ -22,13 +22,19 @@ template <class _Tp>
|
|||
struct remove_volatile {
|
||||
using type _LIBCPP_NODEBUG = __remove_volatile(_Tp);
|
||||
};
|
||||
|
||||
template <class _Tp>
|
||||
using __remove_volatile_t = __remove_volatile(_Tp);
|
||||
#else
|
||||
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_volatile {typedef _Tp type;};
|
||||
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_volatile<volatile _Tp> {typedef _Tp type;};
|
||||
|
||||
template <class _Tp>
|
||||
using __remove_volatile_t = typename remove_volatile<_Tp>::type;
|
||||
#endif // __has_builtin(__remove_volatile)
|
||||
|
||||
#if _LIBCPP_STD_VER > 11
|
||||
template <class _Tp> using remove_volatile_t = typename remove_volatile<_Tp>::type;
|
||||
template <class _Tp> using remove_volatile_t = __remove_volatile_t<_Tp>;
|
||||
#endif
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
|
|
@ -22,13 +22,13 @@ _LIBCPP_BEGIN_NAMESPACE_STD
|
|||
|
||||
template <class _Tp>
|
||||
_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR _Tp&&
|
||||
forward(typename remove_reference<_Tp>::type& __t) _NOEXCEPT {
|
||||
forward(__libcpp_remove_reference_t<_Tp>& __t) _NOEXCEPT {
|
||||
return static_cast<_Tp&&>(__t);
|
||||
}
|
||||
|
||||
template <class _Tp>
|
||||
_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR _Tp&&
|
||||
forward(typename remove_reference<_Tp>::type&& __t) _NOEXCEPT {
|
||||
forward(__libcpp_remove_reference_t<_Tp>&& __t) _NOEXCEPT {
|
||||
static_assert(!is_lvalue_reference<_Tp>::value, "cannot forward an rvalue as an lvalue");
|
||||
return static_cast<_Tp&&>(__t);
|
||||
}
|
||||
|
|
|
@ -43,13 +43,13 @@ template <class _Tp> struct __is_inplace_type_imp : false_type {};
|
|||
template <class _Tp> struct __is_inplace_type_imp<in_place_type_t<_Tp>> : true_type {};
|
||||
|
||||
template <class _Tp>
|
||||
using __is_inplace_type = __is_inplace_type_imp<__uncvref_t<_Tp>>;
|
||||
using __is_inplace_type = __is_inplace_type_imp<__remove_cvref_t<_Tp>>;
|
||||
|
||||
template <class _Tp> struct __is_inplace_index_imp : false_type {};
|
||||
template <size_t _Idx> struct __is_inplace_index_imp<in_place_index_t<_Idx>> : true_type {};
|
||||
|
||||
template <class _Tp>
|
||||
using __is_inplace_index = __is_inplace_index_imp<__uncvref_t<_Tp>>;
|
||||
using __is_inplace_index = __is_inplace_index_imp<__remove_cvref_t<_Tp>>;
|
||||
|
||||
#endif // _LIBCPP_STD_VER > 14
|
||||
|
||||
|
|
|
@ -20,9 +20,9 @@
|
|||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
template <class _Tp>
|
||||
_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR typename remove_reference<_Tp>::type&&
|
||||
_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR __libcpp_remove_reference_t<_Tp>&&
|
||||
move(_Tp&& __t) _NOEXCEPT {
|
||||
typedef _LIBCPP_NODEBUG typename remove_reference<_Tp>::type _Up;
|
||||
typedef _LIBCPP_NODEBUG __libcpp_remove_reference_t<_Tp> _Up;
|
||||
return static_cast<_Up&&>(__t);
|
||||
}
|
||||
|
||||
|
|
|
@ -605,7 +605,7 @@ inline _LIBCPP_INLINE_VISIBILITY
|
|||
_LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST
|
||||
_ValueType any_cast(any const & __v)
|
||||
{
|
||||
using _RawValueType = __uncvref_t<_ValueType>;
|
||||
using _RawValueType = __remove_cvref_t<_ValueType>;
|
||||
static_assert(is_constructible<_ValueType, _RawValueType const &>::value,
|
||||
"ValueType is required to be a const lvalue reference "
|
||||
"or a CopyConstructible type");
|
||||
|
@ -620,7 +620,7 @@ inline _LIBCPP_INLINE_VISIBILITY
|
|||
_LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST
|
||||
_ValueType any_cast(any & __v)
|
||||
{
|
||||
using _RawValueType = __uncvref_t<_ValueType>;
|
||||
using _RawValueType = __remove_cvref_t<_ValueType>;
|
||||
static_assert(is_constructible<_ValueType, _RawValueType &>::value,
|
||||
"ValueType is required to be an lvalue reference "
|
||||
"or a CopyConstructible type");
|
||||
|
@ -635,7 +635,7 @@ inline _LIBCPP_INLINE_VISIBILITY
|
|||
_LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST
|
||||
_ValueType any_cast(any && __v)
|
||||
{
|
||||
using _RawValueType = __uncvref_t<_ValueType>;
|
||||
using _RawValueType = __remove_cvref_t<_ValueType>;
|
||||
static_assert(is_constructible<_ValueType, _RawValueType>::value,
|
||||
"ValueType is required to be an rvalue reference "
|
||||
"or a CopyConstructible type");
|
||||
|
@ -675,7 +675,7 @@ any_cast(any * __any) _NOEXCEPT
|
|||
using __any_imp::_Action;
|
||||
static_assert(!is_reference<_ValueType>::value,
|
||||
"_ValueType may not be a reference.");
|
||||
typedef typename add_pointer<_ValueType>::type _ReturnType;
|
||||
typedef add_pointer_t<_ValueType> _ReturnType;
|
||||
if (__any && __any->__h_) {
|
||||
void *__p = __any->__call(_Action::_Get, nullptr,
|
||||
#if !defined(_LIBCPP_NO_RTTI)
|
||||
|
|
|
@ -944,13 +944,13 @@ void __cxx_atomic_store(__cxx_atomic_base_impl<_Tp> * __a, _Tp __val, memory_ord
|
|||
template<class _Tp>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
_Tp __cxx_atomic_load(__cxx_atomic_base_impl<_Tp> const volatile* __a, memory_order __order) _NOEXCEPT {
|
||||
using __ptr_type = typename remove_const<decltype(__a->__a_value)>::type*;
|
||||
using __ptr_type = __remove_const_t<decltype(__a->__a_value)>*;
|
||||
return __c11_atomic_load(const_cast<__ptr_type>(&__a->__a_value), static_cast<__memory_order_underlying_t>(__order));
|
||||
}
|
||||
template<class _Tp>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
_Tp __cxx_atomic_load(__cxx_atomic_base_impl<_Tp> const* __a, memory_order __order) _NOEXCEPT {
|
||||
using __ptr_type = typename remove_const<decltype(__a->__a_value)>::type*;
|
||||
using __ptr_type = __remove_const_t<decltype(__a->__a_value)>*;
|
||||
return __c11_atomic_load(const_cast<__ptr_type>(&__a->__a_value), static_cast<__memory_order_underlying_t>(__order));
|
||||
}
|
||||
|
||||
|
@ -1802,28 +1802,28 @@ struct atomic<_Tp*>
|
|||
_LIBCPP_INLINE_VISIBILITY
|
||||
_Tp* fetch_add(ptrdiff_t __op, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT {
|
||||
// __atomic_fetch_add accepts function pointers, guard against them.
|
||||
static_assert(!is_function<typename remove_pointer<_Tp>::type>::value, "Pointer to function isn't allowed");
|
||||
static_assert(!is_function<__remove_pointer_t<_Tp> >::value, "Pointer to function isn't allowed");
|
||||
return __cxx_atomic_fetch_add(&this->__a_, __op, __m);
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
_Tp* fetch_add(ptrdiff_t __op, memory_order __m = memory_order_seq_cst) _NOEXCEPT {
|
||||
// __atomic_fetch_add accepts function pointers, guard against them.
|
||||
static_assert(!is_function<typename remove_pointer<_Tp>::type>::value, "Pointer to function isn't allowed");
|
||||
static_assert(!is_function<__remove_pointer_t<_Tp> >::value, "Pointer to function isn't allowed");
|
||||
return __cxx_atomic_fetch_add(&this->__a_, __op, __m);
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
_Tp* fetch_sub(ptrdiff_t __op, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT {
|
||||
// __atomic_fetch_add accepts function pointers, guard against them.
|
||||
static_assert(!is_function<typename remove_pointer<_Tp>::type>::value, "Pointer to function isn't allowed");
|
||||
static_assert(!is_function<__remove_pointer_t<_Tp> >::value, "Pointer to function isn't allowed");
|
||||
return __cxx_atomic_fetch_sub(&this->__a_, __op, __m);
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
_Tp* fetch_sub(ptrdiff_t __op, memory_order __m = memory_order_seq_cst) _NOEXCEPT {
|
||||
// __atomic_fetch_add accepts function pointers, guard against them.
|
||||
static_assert(!is_function<typename remove_pointer<_Tp>::type>::value, "Pointer to function isn't allowed");
|
||||
static_assert(!is_function<__remove_pointer_t<_Tp> >::value, "Pointer to function isn't allowed");
|
||||
return __cxx_atomic_fetch_sub(&this->__a_, __op, __m);
|
||||
}
|
||||
|
||||
|
|
|
@ -259,7 +259,7 @@ public:
|
|||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static coroutine_handle from_promise(_Promise& __promise) _NOEXCEPT {
|
||||
typedef typename remove_cv<_Promise>::type _RawPromise;
|
||||
typedef __remove_cv_t<_Promise> _RawPromise;
|
||||
coroutine_handle __tmp;
|
||||
__tmp.__handle_ = __builtin_coro_promise(
|
||||
_VSTD::addressof(const_cast<_RawPromise&>(__promise)),
|
||||
|
|
|
@ -161,7 +161,7 @@ private:
|
|||
typedef _Value value_type;
|
||||
typedef _Key key_type;
|
||||
|
||||
typedef typename make_unsigned<key_type>::type unsigned_key_type;
|
||||
typedef __make_unsigned_t<key_type> unsigned_key_type;
|
||||
typedef std::array<value_type, 256> skip_map;
|
||||
skip_map __table_;
|
||||
|
||||
|
|
|
@ -145,9 +145,9 @@ public:
|
|||
"Instantiation of propagate_const with an array type is ill-formed.");
|
||||
static_assert(!is_reference<_Tp>::value,
|
||||
"Instantiation of propagate_const with a reference type is ill-formed.");
|
||||
static_assert(!(is_pointer<_Tp>::value && is_function<typename remove_pointer<_Tp>::type>::value),
|
||||
static_assert(!(is_pointer<_Tp>::value && is_function<__remove_pointer_t<_Tp> >::value),
|
||||
"Instantiation of propagate_const with a function-pointer type is ill-formed.");
|
||||
static_assert(!(is_pointer<_Tp>::value && is_same<typename remove_cv<typename remove_pointer<_Tp>::type>::type, void>::value),
|
||||
static_assert(!(is_pointer<_Tp>::value && is_same<__remove_cv_t<__remove_pointer_t<_Tp> >, void>::value),
|
||||
"Instantiation of propagate_const with a pointer to (possibly cv-qualified) void is ill-formed.");
|
||||
|
||||
private:
|
||||
|
|
|
@ -1057,7 +1057,7 @@ struct simd_size<_Tp, __simd_abi<__kind, _Np>>
|
|||
: std::integral_constant<size_t, _Np> {
|
||||
static_assert(
|
||||
std::is_arithmetic<_Tp>::value &&
|
||||
!std::is_same<typename std::remove_const<_Tp>::type, bool>::value,
|
||||
!std::is_same<__remove_const_t<_Tp>, bool>::value,
|
||||
"Element type should be vectorizable");
|
||||
};
|
||||
|
||||
|
@ -1299,7 +1299,7 @@ class const_where_expression {
|
|||
public:
|
||||
const_where_expression(const const_where_expression&) = delete;
|
||||
const_where_expression& operator=(const const_where_expression&) = delete;
|
||||
typename remove_const<_Tp>::type operator-() const&&;
|
||||
__remove_const_t<_Tp> operator-() const&&;
|
||||
template <class _Up, class _Flags>
|
||||
void copy_to(_Up*, _Flags) const&&;
|
||||
};
|
||||
|
@ -1366,8 +1366,8 @@ private:
|
|||
__is_non_narrowing_arithmetic_convertible<_Up, _Tp>()) ||
|
||||
(!std::is_arithmetic<_Up>::value &&
|
||||
std::is_convertible<_Up, _Tp>::value) ||
|
||||
std::is_same<typename std::remove_const<_Up>::type, int>::value ||
|
||||
(std::is_same<typename std::remove_const<_Up>::type,
|
||||
std::is_same<__remove_const_t<_Up>, int>::value ||
|
||||
(std::is_same<__remove_const_t<_Up>,
|
||||
unsigned int>::value &&
|
||||
std::is_unsigned<_Tp>::value);
|
||||
}
|
||||
|
|
|
@ -378,7 +378,7 @@ public:
|
|||
typedef std::pair<key_type, mapped_type> value_type;
|
||||
typedef typename _HashIterator::difference_type difference_type;
|
||||
typedef value_type& reference;
|
||||
typedef typename std::__rebind_pointer<typename _HashIterator::pointer, value_type>::type
|
||||
typedef std::__rebind_pointer_t<typename _HashIterator::pointer, value_type>
|
||||
pointer;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY __hash_map_iterator() {}
|
||||
|
@ -423,7 +423,7 @@ public:
|
|||
typedef std::pair<key_type, mapped_type> value_type;
|
||||
typedef typename _HashIterator::difference_type difference_type;
|
||||
typedef const value_type& reference;
|
||||
typedef typename std::__rebind_pointer<typename _HashIterator::pointer, const value_type>::type
|
||||
typedef std::__rebind_pointer_t<typename _HashIterator::pointer, const value_type>
|
||||
pointer;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY __hash_map_const_iterator() {}
|
||||
|
|
|
@ -241,14 +241,13 @@ struct __forward_list_node_value_type<__forward_list_node<_Tp, _VoidPtr> > {
|
|||
template <class _NodePtr>
|
||||
struct __forward_node_traits {
|
||||
|
||||
typedef typename remove_cv<
|
||||
typename pointer_traits<_NodePtr>::element_type>::type __node;
|
||||
typedef __remove_cv_t<
|
||||
typename pointer_traits<_NodePtr>::element_type> __node;
|
||||
typedef typename __forward_list_node_value_type<__node>::type __node_value_type;
|
||||
typedef _NodePtr __node_pointer;
|
||||
typedef __forward_begin_node<_NodePtr> __begin_node;
|
||||
typedef typename __rebind_pointer<_NodePtr, __begin_node>::type
|
||||
__begin_node_pointer;
|
||||
typedef typename __rebind_pointer<_NodePtr, void>::type __void_pointer;
|
||||
typedef __rebind_pointer_t<_NodePtr, __begin_node> __begin_node_pointer;
|
||||
typedef __rebind_pointer_t<_NodePtr, void> __void_pointer;
|
||||
|
||||
#if defined(_LIBCPP_ABI_FORWARD_LIST_REMOVE_NODE_POINTER_UB)
|
||||
typedef __begin_node_pointer __iter_node_pointer;
|
||||
|
@ -280,7 +279,7 @@ template <class _NodePtr>
|
|||
struct __forward_begin_node
|
||||
{
|
||||
typedef _NodePtr pointer;
|
||||
typedef typename __rebind_pointer<_NodePtr, __forward_begin_node>::type __begin_node_pointer;
|
||||
typedef __rebind_pointer_t<_NodePtr, __forward_begin_node> __begin_node_pointer;
|
||||
|
||||
pointer __next_;
|
||||
|
||||
|
@ -296,7 +295,7 @@ template <class _Tp, class _VoidPtr>
|
|||
struct _LIBCPP_HIDDEN __begin_node_of
|
||||
{
|
||||
typedef __forward_begin_node<
|
||||
typename __rebind_pointer<_VoidPtr, __forward_list_node<_Tp, _VoidPtr> >::type
|
||||
__rebind_pointer_t<_VoidPtr, __forward_list_node<_Tp, _VoidPtr> >
|
||||
> type;
|
||||
};
|
||||
|
||||
|
@ -355,7 +354,7 @@ public:
|
|||
typedef value_type& reference;
|
||||
typedef typename pointer_traits<__node_pointer>::difference_type
|
||||
difference_type;
|
||||
typedef typename __rebind_pointer<__node_pointer, value_type>::type pointer;
|
||||
typedef __rebind_pointer_t<__node_pointer, value_type> pointer;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__forward_list_iterator() _NOEXCEPT : __ptr_(nullptr) {}
|
||||
|
@ -436,7 +435,7 @@ public:
|
|||
typedef const value_type& reference;
|
||||
typedef typename pointer_traits<__node_pointer>::difference_type
|
||||
difference_type;
|
||||
typedef typename __rebind_pointer<__node_pointer, const value_type>::type
|
||||
typedef __rebind_pointer_t<__node_pointer, const value_type>
|
||||
pointer;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
|
|
|
@ -637,7 +637,7 @@ public:
|
|||
void set_value_at_thread_exit(_Arg&& __arg);
|
||||
|
||||
_Rp move();
|
||||
typename add_lvalue_reference<_Rp>::type copy();
|
||||
__add_lvalue_reference_t<_Rp> copy();
|
||||
};
|
||||
|
||||
template <class _Rp>
|
||||
|
@ -688,7 +688,7 @@ __assoc_state<_Rp>::move()
|
|||
}
|
||||
|
||||
template <class _Rp>
|
||||
typename add_lvalue_reference<_Rp>::type
|
||||
__add_lvalue_reference_t<_Rp>
|
||||
__assoc_state<_Rp>::copy()
|
||||
{
|
||||
unique_lock<mutex> __lk(this->__mut_);
|
||||
|
@ -1750,7 +1750,7 @@ template <class _Fp>
|
|||
__packaged_task_function<_Rp(_ArgTypes...)>::__packaged_task_function(_Fp&& __f)
|
||||
: __f_(nullptr)
|
||||
{
|
||||
typedef typename remove_reference<typename decay<_Fp>::type>::type _FR;
|
||||
typedef __libcpp_remove_reference_t<typename decay<_Fp>::type> _FR;
|
||||
typedef __packaged_task_func<_FR, allocator<_FR>, _Rp(_ArgTypes...)> _FF;
|
||||
if (sizeof(_FF) <= sizeof(__buf_))
|
||||
{
|
||||
|
@ -1774,7 +1774,7 @@ __packaged_task_function<_Rp(_ArgTypes...)>::__packaged_task_function(
|
|||
allocator_arg_t, const _Alloc& __a0, _Fp&& __f)
|
||||
: __f_(nullptr)
|
||||
{
|
||||
typedef typename remove_reference<typename decay<_Fp>::type>::type _FR;
|
||||
typedef __libcpp_remove_reference_t<typename decay<_Fp>::type> _FR;
|
||||
typedef __packaged_task_func<_FR, _Alloc, _Rp(_ArgTypes...)> _FF;
|
||||
if (sizeof(_FF) <= sizeof(__buf_))
|
||||
{
|
||||
|
@ -1887,11 +1887,11 @@ public:
|
|||
_LIBCPP_INLINE_VISIBILITY
|
||||
packaged_task() _NOEXCEPT : __p_(nullptr) {}
|
||||
template <class _Fp,
|
||||
class = __enable_if_t<!is_same<__uncvref_t<_Fp>, packaged_task>::value> >
|
||||
class = __enable_if_t<!is_same<__remove_cvref_t<_Fp>, packaged_task>::value> >
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit packaged_task(_Fp&& __f) : __f_(_VSTD::forward<_Fp>(__f)) {}
|
||||
template <class _Fp, class _Allocator,
|
||||
class = __enable_if_t<!is_same<__uncvref_t<_Fp>, packaged_task>::value> >
|
||||
class = __enable_if_t<!is_same<__remove_cvref_t<_Fp>, packaged_task>::value> >
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
packaged_task(allocator_arg_t, const _Allocator& __a, _Fp&& __f)
|
||||
: __f_(allocator_arg, __a, _VSTD::forward<_Fp>(__f)),
|
||||
|
@ -2002,11 +2002,11 @@ public:
|
|||
_LIBCPP_INLINE_VISIBILITY
|
||||
packaged_task() _NOEXCEPT : __p_(nullptr) {}
|
||||
template <class _Fp,
|
||||
class = __enable_if_t<!is_same<__uncvref_t<_Fp>, packaged_task>::value> >
|
||||
class = __enable_if_t<!is_same<__remove_cvref_t<_Fp>, packaged_task>::value> >
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit packaged_task(_Fp&& __f) : __f_(_VSTD::forward<_Fp>(__f)) {}
|
||||
template <class _Fp, class _Allocator,
|
||||
class = __enable_if_t<!is_same<__uncvref_t<_Fp>, packaged_task>::value> >
|
||||
class = __enable_if_t<!is_same<__remove_cvref_t<_Fp>, packaged_task>::value> >
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
packaged_task(allocator_arg_t, const _Allocator& __a, _Fp&& __f)
|
||||
: __f_(allocator_arg, __a, _VSTD::forward<_Fp>(__f)),
|
||||
|
|
|
@ -451,9 +451,9 @@ protected:
|
|||
|
||||
template <class _Tp>
|
||||
class _LIBCPP_TEMPLATE_VIS numeric_limits
|
||||
: private __libcpp_numeric_limits<typename remove_cv<_Tp>::type>
|
||||
: private __libcpp_numeric_limits<__remove_cv_t<_Tp> >
|
||||
{
|
||||
typedef __libcpp_numeric_limits<typename remove_cv<_Tp>::type> __base;
|
||||
typedef __libcpp_numeric_limits<__remove_cv_t<_Tp> > __base;
|
||||
typedef typename __base::type type;
|
||||
public:
|
||||
static _LIBCPP_CONSTEXPR const bool is_specialized = __base::is_specialized;
|
||||
|
|
|
@ -239,9 +239,9 @@ template <class _Tp, class _VoidPtr> struct __list_node_base;
|
|||
|
||||
template <class _Tp, class _VoidPtr>
|
||||
struct __list_node_pointer_traits {
|
||||
typedef typename __rebind_pointer<_VoidPtr, __list_node<_Tp, _VoidPtr> >::type
|
||||
typedef __rebind_pointer_t<_VoidPtr, __list_node<_Tp, _VoidPtr> >
|
||||
__node_pointer;
|
||||
typedef typename __rebind_pointer<_VoidPtr, __list_node_base<_Tp, _VoidPtr> >::type
|
||||
typedef __rebind_pointer_t<_VoidPtr, __list_node_base<_Tp, _VoidPtr> >
|
||||
__base_pointer;
|
||||
|
||||
#if defined(_LIBCPP_ABI_LIST_REMOVE_NODE_POINTER_UB)
|
||||
|
@ -342,7 +342,7 @@ public:
|
|||
typedef bidirectional_iterator_tag iterator_category;
|
||||
typedef _Tp value_type;
|
||||
typedef value_type& reference;
|
||||
typedef typename __rebind_pointer<_VoidPtr, value_type>::type pointer;
|
||||
typedef __rebind_pointer_t<_VoidPtr, value_type> pointer;
|
||||
typedef typename pointer_traits<pointer>::difference_type difference_type;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
|
@ -450,7 +450,7 @@ public:
|
|||
typedef bidirectional_iterator_tag iterator_category;
|
||||
typedef _Tp value_type;
|
||||
typedef const value_type& reference;
|
||||
typedef typename __rebind_pointer<_VoidPtr, const value_type>::type pointer;
|
||||
typedef __rebind_pointer_t<_VoidPtr, const value_type> pointer;
|
||||
typedef typename pointer_traits<pointer>::difference_type difference_type;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
|
|
|
@ -753,11 +753,11 @@ __num_get_signed_integral(const char* __a, const char* __a_end,
|
|||
{
|
||||
if (__a != __a_end)
|
||||
{
|
||||
typename remove_reference<decltype(errno)>::type __save_errno = errno;
|
||||
__libcpp_remove_reference_t<decltype(errno)> __save_errno = errno;
|
||||
errno = 0;
|
||||
char *__p2;
|
||||
long long __ll = strtoll_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
|
||||
typename remove_reference<decltype(errno)>::type __current_errno = errno;
|
||||
__libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
|
||||
if (__current_errno == 0)
|
||||
errno = __save_errno;
|
||||
if (__p2 != __a_end)
|
||||
|
@ -793,11 +793,11 @@ __num_get_unsigned_integral(const char* __a, const char* __a_end,
|
|||
__err = ios_base::failbit;
|
||||
return 0;
|
||||
}
|
||||
typename remove_reference<decltype(errno)>::type __save_errno = errno;
|
||||
__libcpp_remove_reference_t<decltype(errno)> __save_errno = errno;
|
||||
errno = 0;
|
||||
char *__p2;
|
||||
unsigned long long __ll = strtoull_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
|
||||
typename remove_reference<decltype(errno)>::type __current_errno = errno;
|
||||
__libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
|
||||
if (__current_errno == 0)
|
||||
errno = __save_errno;
|
||||
if (__p2 != __a_end)
|
||||
|
@ -847,11 +847,11 @@ __num_get_float(const char* __a, const char* __a_end, ios_base::iostate& __err)
|
|||
{
|
||||
if (__a != __a_end)
|
||||
{
|
||||
typename remove_reference<decltype(errno)>::type __save_errno = errno;
|
||||
__libcpp_remove_reference_t<decltype(errno)> __save_errno = errno;
|
||||
errno = 0;
|
||||
char *__p2;
|
||||
_Tp __ld = __do_strtod<_Tp>(__a, &__p2);
|
||||
typename remove_reference<decltype(errno)>::type __current_errno = errno;
|
||||
__libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
|
||||
if (__current_errno == 0)
|
||||
errno = __save_errno;
|
||||
if (__p2 != __a_end)
|
||||
|
|
|
@ -365,7 +365,7 @@ _LIBCPP_NODISCARD_AFTER_CXX17 inline _LIBCPP_HIDE_FROM_ABI
|
|||
_LIBCPP_CONSTEXPR _Tp* __launder(_Tp* __p) _NOEXCEPT
|
||||
{
|
||||
static_assert (!(is_function<_Tp>::value), "can't launder functions" );
|
||||
static_assert (!(is_same<void, typename remove_cv<_Tp>::type>::value), "can't launder cv-void" );
|
||||
static_assert (!(is_same<void, __remove_cv_t<_Tp> >::value), "can't launder cv-void" );
|
||||
return __builtin_launder(__p);
|
||||
}
|
||||
|
||||
|
|
|
@ -402,14 +402,14 @@ struct __optional_storage_base<_Tp, true>
|
|||
|
||||
template <class _Up>
|
||||
static constexpr bool __can_bind_reference() {
|
||||
using _RawUp = typename remove_reference<_Up>::type;
|
||||
using _RawUp = __libcpp_remove_reference_t<_Up>;
|
||||
using _UpPtr = _RawUp*;
|
||||
using _RawTp = typename remove_reference<_Tp>::type;
|
||||
using _RawTp = __libcpp_remove_reference_t<_Tp>;
|
||||
using _TpPtr = _RawTp*;
|
||||
using _CheckLValueArg = integral_constant<bool,
|
||||
(is_lvalue_reference<_Up>::value && is_convertible<_UpPtr, _TpPtr>::value)
|
||||
|| is_same<_RawUp, reference_wrapper<_RawTp>>::value
|
||||
|| is_same<_RawUp, reference_wrapper<typename remove_const<_RawTp>::type>>::value
|
||||
|| is_same<_RawUp, reference_wrapper<__remove_const_t<_RawTp>>>::value
|
||||
>;
|
||||
return (is_lvalue_reference<_Tp>::value && _CheckLValueArg::value)
|
||||
|| (is_rvalue_reference<_Tp>::value && !is_lvalue_reference<_Up>::value &&
|
||||
|
@ -637,9 +637,9 @@ public:
|
|||
|
||||
private:
|
||||
// Disable the reference extension using this static assert.
|
||||
static_assert(!is_same_v<__uncvref_t<value_type>, in_place_t>,
|
||||
static_assert(!is_same_v<__remove_cvref_t<value_type>, in_place_t>,
|
||||
"instantiation of optional with in_place_t is ill-formed");
|
||||
static_assert(!is_same_v<__uncvref_t<value_type>, nullopt_t>,
|
||||
static_assert(!is_same_v<__remove_cvref_t<value_type>, nullopt_t>,
|
||||
"instantiation of optional with nullopt_t is ill-formed");
|
||||
static_assert(!is_reference_v<value_type>,
|
||||
"instantiation of optional with a reference type is ill-formed");
|
||||
|
@ -664,8 +664,8 @@ private:
|
|||
};
|
||||
template <class _Up>
|
||||
using _CheckOptionalArgsCtor = _If<
|
||||
_IsNotSame<__uncvref_t<_Up>, in_place_t>::value &&
|
||||
_IsNotSame<__uncvref_t<_Up>, optional>::value,
|
||||
_IsNotSame<__remove_cvref_t<_Up>, in_place_t>::value &&
|
||||
_IsNotSame<__remove_cvref_t<_Up>, optional>::value,
|
||||
_CheckOptionalArgsConstructor,
|
||||
__check_tuple_constructor_fail
|
||||
>;
|
||||
|
@ -825,9 +825,9 @@ public:
|
|||
template <class _Up = value_type,
|
||||
class = enable_if_t<
|
||||
_And<
|
||||
_IsNotSame<__uncvref_t<_Up>, optional>,
|
||||
_IsNotSame<__remove_cvref_t<_Up>, optional>,
|
||||
_Or<
|
||||
_IsNotSame<__uncvref_t<_Up>, value_type>,
|
||||
_IsNotSame<__remove_cvref_t<_Up>, value_type>,
|
||||
_Not<is_scalar<value_type>>
|
||||
>,
|
||||
is_constructible<value_type, _Up>,
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue