4 ms·
Since he mentions C++, I would add you don't have to give up on RAII to adopt this approach. You obviously can't use the standard smart pointers, but developin
by stonemetal12 3y ago
Since he mentions C++, I would add you don't have to give up on RAII to adopt this approach. You obviously can't use the standard smart pointers, but developing similar smart handles isn't that much extra effort.
- cshokie 3y agoThe C++ standard library smart pointers (e.g. unique_ptr) have optional template parameters for the allocator and destruction method. It seems like the standard C++ smart pointer types could still be used with handles. All you need is the right typedef.