Add support for named deleter

Closes #4469.