mardi 15 février 2022

Why unique_ptr's Deleter need an argument of type unique_ptr

I see the describtion about unique_ptr on cppreference, it says Deleter must be FunctionObject or lvalue reference to a FunctionObject or lvalue reference to function, callable with an argument of type unique_ptr<T, Deleter>::pointer, I don't understand why there is such a requirement that FunctionObject must have an argument and if I want to implement the requirement,How shoud I do?

Aucun commentaire:

Enregistrer un commentaire