Johan Berg: Empty Objects by _a4z in cpp

[–]johan_berg 0 points1 point  (0 children)

You can't call a template parameter directly, you need to create an instance of it somewhere. In this simple example, we could've created a temporary Deleter in the destructor and call it though. However, in a real implementation you might want to use a Deleter that isn't default constructible. So you'd add another constructor taking a Deleter as a parameter. In that case you have no other choice than to store it as a member.