Skip to content

Commit c2f29ca

Browse files
authored
[libc++][NFC] Explicitly delete assignment operator in tuple (#90604)
1 parent 69e7cb5 commit c2f29ca

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

libcxx/include/tuple

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ class __tuple_leaf {
304304
# endif
305305
}
306306

307-
_LIBCPP_CONSTEXPR_SINCE_CXX14 __tuple_leaf& operator=(const __tuple_leaf&);
307+
_LIBCPP_CONSTEXPR_SINCE_CXX14 __tuple_leaf& operator=(const __tuple_leaf&) = delete;
308308

309309
public:
310310
_LIBCPP_HIDE_FROM_ABI constexpr __tuple_leaf() _NOEXCEPT_(is_nothrow_default_constructible<_Hp>::value) : __value_() {
@@ -380,7 +380,7 @@ public:
380380

381381
template <size_t _Ip, class _Hp>
382382
class __tuple_leaf<_Ip, _Hp, true> : private _Hp {
383-
_LIBCPP_CONSTEXPR_SINCE_CXX14 __tuple_leaf& operator=(const __tuple_leaf&);
383+
_LIBCPP_CONSTEXPR_SINCE_CXX14 __tuple_leaf& operator=(const __tuple_leaf&) = delete;
384384

385385
public:
386386
_LIBCPP_HIDE_FROM_ABI constexpr __tuple_leaf() _NOEXCEPT_(is_nothrow_default_constructible<_Hp>::value) {}
@@ -1375,22 +1375,22 @@ inline _LIBCPP_HIDE_FROM_ABI constexpr _Tp __make_from_tuple_impl(_Tuple&& __t,
13751375
}
13761376
#else
13771377
template <class _Tp, class _Tuple, size_t... _Idx>
1378-
inline _LIBCPP_HIDE_FROM_ABI constexpr _Tp __make_from_tuple_impl(_Tuple&& __t, __tuple_indices<_Idx...>,
1378+
inline _LIBCPP_HIDE_FROM_ABI constexpr _Tp __make_from_tuple_impl(_Tuple&& __t, __tuple_indices<_Idx...>,
13791379
enable_if_t<is_constructible_v<_Tp, decltype(std::get<_Idx>(std::forward<_Tuple>(__t)))...>> * = nullptr)
13801380
_LIBCPP_NOEXCEPT_RETURN(_Tp(std::get<_Idx>(std::forward<_Tuple>(__t))...))
13811381
#endif // _LIBCPP_STD_VER >= 20
13821382

1383-
template <class _Tp, class _Tuple,
1383+
template <class _Tp, class _Tuple,
13841384
class _Seq = typename __make_tuple_indices<tuple_size_v<remove_reference_t<_Tuple>>>::type, class = void>
13851385
inline constexpr bool __can_make_from_tuple = false;
13861386

13871387
template <class _Tp, class _Tuple, size_t... _Idx>
1388-
inline constexpr bool __can_make_from_tuple<_Tp, _Tuple, __tuple_indices<_Idx...>,
1388+
inline constexpr bool __can_make_from_tuple<_Tp, _Tuple, __tuple_indices<_Idx...>,
13891389
enable_if_t<is_constructible_v<_Tp, decltype(std::get<_Idx>(std::declval<_Tuple>()))...>>> = true;
13901390

1391-
// Based on LWG3528(https://wg21.link/LWG3528) and http://eel.is/c++draft/description#structure.requirements-9,
1392-
// the standard allows to impose requirements, we constraint std::make_from_tuple to make std::make_from_tuple
1393-
// SFINAE friendly and also avoid worse diagnostic messages. We still keep the constraints of std::__make_from_tuple_impl
1391+
// Based on LWG3528(https://wg21.link/LWG3528) and http://eel.is/c++draft/description#structure.requirements-9,
1392+
// the standard allows to impose requirements, we constraint std::make_from_tuple to make std::make_from_tuple
1393+
// SFINAE friendly and also avoid worse diagnostic messages. We still keep the constraints of std::__make_from_tuple_impl
13941394
// so that std::__make_from_tuple_impl will have the same advantages when used alone.
13951395
#if _LIBCPP_STD_VER >= 20
13961396
template <class _Tp, class _Tuple>

0 commit comments

Comments
 (0)