Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

default_delete

 

Deletes objects allocated with operator new. Suitable for use with unique_ptr.

template<class T>    struct default_delete {        constexpr default_delete() noexcept = default;         template<class Other,                     class = typename enable_if<is_convertible< Other*, T*>::value, void>::type>>
            default_delete(                const default_delete<Other>&            ) noexcept;         void operator()(T*Ptr) const noexcept;     };

template<class T>    struct default_delete<T[]>    {        constexpr default_delete() noexcept = default;    template<class Other,     class = typename enable_if<is_convertible<Other(*)[], T(*)[]>::value, void>::type>        default_delete(const default_delete<Other[]>&) noexcept    template<class Other,      class = typename enable_if<is_convertible<Other(*)[], T(*)[]>::value, void>::type>        void operator()(Other*) const noexcept;    };

Ptr

Pointer to the object to delete.

Other

The type of elements in the array to be deleted.

Exception Condition

The template class describes a deleter that deletes scalar objects allocated with operator new, suitable for use with template class unique_ptr. It also has the explicit specialization default_delete<Type[]>.

Requirements

Header: <memory>

Namespace: std

Show: