[libcxx-commits] [PATCH] D62274: shared_ptr deleter requirements (2802)

Eric Fiselier via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed May 22 23:22:11 PDT 2019


EricWF requested changes to this revision.
EricWF added a comment.
This revision now requires changes to proceed.

This patch is missing the main point of LWG 2802, and that is making `std::shared_ptr` support move-only deleters.  You need to make this test that constructors and make functions accepting a deleter accept this code:

  template <class ValueT>
  struct MyDeleter {
    MyDeleter() = delete;
    MyDeleter(MyDeleter const&) = delete;
    MyDeleter(MyDeleter&&) = default;
  
    explicit MyDeleter(secret_type) {} // so you can construct it for the test.
  
    void operator()(ValueT*); 
  };

Additionally, the static asserts you're adding are required to be SFINAE checks according to the standard.
This was added by LWG 2875 (https://cplusplus.github.io/LWG/lwg-defects.html#2875)



================
Comment at: include/memory:3719
+template<typename _Tp, class _Up>
+struct __libcpp_has_call_op<_Tp, _Up,
+                            std::void_t<decltype(std::declval<_Tp>()(std::declval<_Up>()))>>
----------------
Does this compile in C++03, C++11, or C++14?


Repository:
  rCXX libc++

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

https://reviews.llvm.org/D62274





More information about the libcxx-commits mailing list