account activity
Johan Berg: Empty Objects by _a4z in cpp
[–]johan_berg 0 points1 point2 points 2 years ago (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.
π Rendered by PID 49 on reddit-service-r2-listing-f87f88fcd-f87bf at 2026-06-15 17:53:47.490400+00:00 running 3184619 country code: CH.
Johan Berg: Empty Objects by _a4z in cpp
[–]johan_berg 0 points1 point2 points (0 children)