
A unique_ptr With a Custom Deleter That Costs Zero Bytes
Wrapping a C handle in unique_ptr with a function-pointer deleter doubles the pointer to 16 bytes. Putting the function into the deleter type instead, with an alias template over decltype of a static lambda, brings it back to 8. Sizes checked on GCC 14.2, GCC 16.2, Clang 22.1 and MSVC 19.44, with live Godbolt sessions.






