@@ -403,7 +403,7 @@ struct __shared_ptr_deleter_ctor_reqs {
403
403
__well_formed_deleter<_Dp, _Yp*>::value;
404
404
};
405
405
406
- template <class _Dp , class _Tp >
406
+ template <class _Dp >
407
407
using __shared_ptr_nullptr_deleter_ctor_reqs = _And<is_move_constructible<_Dp>, __well_formed_deleter<_Dp, nullptr_t > >;
408
408
409
409
#if defined(_LIBCPP_ABI_ENABLE_SHARED_PTR_TRIVIAL_ABI)
@@ -414,6 +414,8 @@ using __shared_ptr_nullptr_deleter_ctor_reqs = _And<is_move_constructible<_Dp>,
414
414
415
415
template <class _Tp >
416
416
class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS shared_ptr {
417
+ struct __nullptr_sfinae_tag {};
418
+
417
419
public:
418
420
#if _LIBCPP_STD_VER >= 17
419
421
typedef weak_ptr<_Tp> weak_type;
@@ -505,8 +507,12 @@ class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS shared_ptr {
505
507
#endif // _LIBCPP_HAS_NO_EXCEPTIONS
506
508
}
507
509
508
- template <class _Dp , __enable_if_t <__shared_ptr_nullptr_deleter_ctor_reqs<_Dp, _Tp>::value, int > = 0 >
509
- _LIBCPP_HIDE_FROM_ABI shared_ptr (nullptr_t __p, _Dp __d) : __ptr_ (nullptr ) {
510
+ template <class _Dp >
511
+ _LIBCPP_HIDE_FROM_ABI shared_ptr (
512
+ nullptr_t __p,
513
+ _Dp __d,
514
+ __enable_if_t <__shared_ptr_nullptr_deleter_ctor_reqs<_Dp>::value, __nullptr_sfinae_tag> = __nullptr_sfinae_tag ())
515
+ : __ptr_ (nullptr ) {
510
516
#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
511
517
try {
512
518
#endif // _LIBCPP_HAS_NO_EXCEPTIONS
@@ -525,8 +531,13 @@ class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS shared_ptr {
525
531
#endif // _LIBCPP_HAS_NO_EXCEPTIONS
526
532
}
527
533
528
- template <class _Dp , class _Alloc , __enable_if_t <__shared_ptr_nullptr_deleter_ctor_reqs<_Dp, _Tp>::value, int > = 0 >
529
- _LIBCPP_HIDE_FROM_ABI shared_ptr (nullptr_t __p, _Dp __d, _Alloc __a) : __ptr_ (nullptr ) {
534
+ template <class _Dp , class _Alloc >
535
+ _LIBCPP_HIDE_FROM_ABI shared_ptr (
536
+ nullptr_t __p,
537
+ _Dp __d,
538
+ _Alloc __a,
539
+ __enable_if_t <__shared_ptr_nullptr_deleter_ctor_reqs<_Dp>::value, __nullptr_sfinae_tag> = __nullptr_sfinae_tag ())
540
+ : __ptr_ (nullptr ) {
530
541
#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
531
542
try {
532
543
#endif // _LIBCPP_HAS_NO_EXCEPTIONS
0 commit comments