[libcxx-commits] [PATCH] D81417: [libcxx] Fix LWG 2874: Constructor shared_ptr::shared_ptr(Y*) should be constrained.

Zoe Carver via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Apr 14 12:32:56 PDT 2021


zoecarver accepted this revision as: zoecarver.
zoecarver added a comment.

Two nits, feel free to take or leave them. LGTM.



================
Comment at: libcxx/include/__memory/shared_ptr.h:382
 
+template <class _Ptr, class=void>
+struct __is_deletable : false_type { };
----------------
Nit: spaces around `=`.


================
Comment at: libcxx/include/__memory/shared_ptr.h:439
+    template<class _Yp, class = _EnableIf<
+        _And<
+            __compatible_with<_Yp, _Tp>
----------------
Another nit, feel free to take it or leave it: I don't think we need to introduce `_And` and `_If` here. Why don't we just do:
```
_EnableIf<
  __compatible_with<_Yp, _Tp>::value 
#if
  && (is_array<_Tp>::value ? 
        __is_array_deletable<_Yp*>::value : 
        __is_deletable<_Yp*>::value)
#endif
>
```


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D81417/new/

https://reviews.llvm.org/D81417



More information about the libcxx-commits mailing list