Or You Could Simplify The Error-Recovery Paths
Or You Could Simplify The Error-Recovery Paths
Posted Dec 30, 2014 23:28 UTC (Tue) by cesarb (subscriber, #6266)In reply to: Or You Could Simplify The Error-Recovery Paths by rleigh
Parent article: The "too small to fail" memory-allocation rule
Wouldn't it be more like a unique_ptr custom deleter instead of a shared_ptr custom deleter?
Posted Dec 31, 2014 11:17 UTC (Wed)
by rleigh (guest, #14622)
[Link]
Or You Could Simplify The Error-Recovery Paths
Yes, either works for the example above (I originally wrote it to use shared_ptr but updated the example to use unique_ptr).