@@ -211,6 +211,13 @@ struct _LIBCPP_VISIBLE pair
211
211
_LIBCPP_INLINE_VISIBILITY pair (const _T1& __x, const _T2& __y)
212
212
: first(__x), second(__y) {}
213
213
214
+ template <class _U1 , class _U2 >
215
+ _LIBCPP_INLINE_VISIBILITY
216
+ pair (const pair<_U1, _U2>& __p,
217
+ typename enable_if<is_convertible<_U1, _T1>::value &&
218
+ is_convertible<_U2, _T2>::value>::type* = 0 )
219
+ : first(__p.first), second(__p.second) {}
220
+
214
221
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
215
222
216
223
template <class _U1 , class _U2 ,
@@ -222,6 +229,14 @@ struct _LIBCPP_VISIBLE pair
222
229
second(_STD::forward<_U2>(__u2))
223
230
{}
224
231
232
+ template <class _U1 , class _U2 >
233
+ _LIBCPP_INLINE_VISIBILITY
234
+ pair (pair<_U1, _U2>&& __p,
235
+ typename enable_if<is_convertible<_U1, _T1>::value &&
236
+ is_convertible<_U2, _T2>::value>::type* = 0 )
237
+ : first(_STD::forward<_U1>(__p.first)),
238
+ second(_STD::forward<_U2>(__p.second)) {}
239
+
225
240
#ifndef _LIBCPP_HAS_NO_VARIADICS
226
241
227
242
template <class _Tuple ,
@@ -261,10 +276,6 @@ struct _LIBCPP_VISIBLE pair
261
276
262
277
#endif // _LIBCPP_HAS_NO_VARIADICS
263
278
264
- #else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
265
- template <class _U1 , class _U2 >
266
- _LIBCPP_INLINE_VISIBILITY pair (const pair<_U1, _U2>& __p)
267
- : first(__p.first), second(__p.second) {}
268
279
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
269
280
void _LIBCPP_INLINE_VISIBILITY swap (pair& __p) {_STD::swap (*this , __p);}
270
281
private:
0 commit comments