Why do shared_ptr deleters have to be CopyConstructible?
问题 In C++11 std::shared_ptr has four constructors which can be passed deleter objects d of type D . The signatures of these constructors are the following: template<class Y, class D> shared_ptr(Y * p, D d); template<class Y, class D, class A> shared_ptr(Y * p, D d, A a); template <class D> shared_ptr(nullptr_t p, D d); template <class D, class A> shared_ptr(nullptr_t p, D d, A a); The standard requires in [util.smartptr.shared.const] type D to be CopyConstructible. Why is this needed? If shared