samedi 26 décembre 2015

std::unique_ptr using custom deleter with few arguments

I wonder whether it is possible to specify custom deleter for std::unique_ptr with more than one argument (standard deleter signature). I know that with std::shared_ptr exists workaround with std::bind which makes it possible but is some trick for std::unique_ptr exists?

For me seems like it's not because according to http://ift.tt/12HCXZS:

Type requirements -Deleter must be FunctionObject or lvalue reference to a FunctionObject or lvalue reference to function, callable with an argument of type unique_ptr::pointer

Aucun commentaire:

Enregistrer un commentaire