Skip to content

Commit 0c90ff8

Browse files
committed
update tuple declaration
1 parent 9463177 commit 0c90ff8

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

libcxx/include/tuple

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,9 @@ public:
391391
};
392392

393393
template <size_t _Ip, class _Hp>
394-
class __tuple_leaf<_Ip, _Hp, true> : private _Hp {
394+
class __tuple_leaf<_Ip, _Hp, true> : private __remove_cv_t<_Hp> {
395+
typedef __remove_cv_t<_Hp> _BaseT;
396+
395397
public:
396398
_LIBCPP_CONSTEXPR_SINCE_CXX14 __tuple_leaf& operator=(const __tuple_leaf&) = delete;
397399

@@ -402,29 +404,29 @@ public:
402404

403405
template <class _Alloc>
404406
_LIBCPP_HIDE_FROM_ABI constexpr __tuple_leaf(integral_constant<int, 1>, const _Alloc& __a)
405-
: _Hp(allocator_arg_t(), __a) {}
407+
: _BaseT(allocator_arg_t(), __a) {}
406408

407409
template <class _Alloc>
408-
_LIBCPP_HIDE_FROM_ABI constexpr __tuple_leaf(integral_constant<int, 2>, const _Alloc& __a) : _Hp(__a) {}
410+
_LIBCPP_HIDE_FROM_ABI constexpr __tuple_leaf(integral_constant<int, 2>, const _Alloc& __a) : _BaseT(__a) {}
409411

410412
template <class _Tp,
411413
__enable_if_t< _And< _IsNotSame<__remove_cvref_t<_Tp>, __tuple_leaf>, is_constructible<_Hp, _Tp> >::value,
412414
int> = 0>
413415
_LIBCPP_HIDE_FROM_ABI
414416
_LIBCPP_CONSTEXPR_SINCE_CXX14 explicit __tuple_leaf(_Tp&& __t) noexcept(is_nothrow_constructible<_Hp, _Tp>::value)
415-
: _Hp(std::forward<_Tp>(__t)) {}
417+
: _BaseT(std::forward<_Tp>(__t)) {}
416418

417419
template <class _Tp, class _Alloc>
418420
_LIBCPP_HIDE_FROM_ABI constexpr explicit __tuple_leaf(integral_constant<int, 0>, const _Alloc&, _Tp&& __t)
419-
: _Hp(std::forward<_Tp>(__t)) {}
421+
: _BaseT(std::forward<_Tp>(__t)) {}
420422

421423
template <class _Tp, class _Alloc>
422424
_LIBCPP_HIDE_FROM_ABI constexpr explicit __tuple_leaf(integral_constant<int, 1>, const _Alloc& __a, _Tp&& __t)
423-
: _Hp(allocator_arg_t(), __a, std::forward<_Tp>(__t)) {}
425+
: _BaseT(allocator_arg_t(), __a, std::forward<_Tp>(__t)) {}
424426

425427
template <class _Tp, class _Alloc>
426428
_LIBCPP_HIDE_FROM_ABI constexpr explicit __tuple_leaf(integral_constant<int, 2>, const _Alloc& __a, _Tp&& __t)
427-
: _Hp(std::forward<_Tp>(__t), __a) {}
429+
: _BaseT(std::forward<_Tp>(__t), __a) {}
428430

429431
__tuple_leaf(__tuple_leaf const&) = default;
430432
__tuple_leaf(__tuple_leaf&&) = default;

0 commit comments

Comments
 (0)