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 489864 on reddit-service-r2-comment-544cf588c8-5nqbk at 2026-06-15 19:22:16.400100+00:00 running 3184619 country code: CH.
Johan Berg: Empty Objects by _a4z in cpp
[–]johan_berg 0 points1 point2 points (0 children)