
On Tue, Mar 21, 2017 at 11:10 AM, TONGARI J via Boost wrote: 2017-03-21 15:04 GMT+08:00 Andrey Davydov via Boost :
[...] I have implemented smart pointer with semantics of unique ownership and
type erased deleter (https://github.com/AndreyG/unnamed). It has size
of 3
pointers and it doesn't require additional memory allocations for the
case
when deleter is empty class (for example, std::default_delete or
non-capturing lambda) and for the case when deleter is known at compile
time function (for instance, fclose). The are some simple examples of
usage
and tests in the repo. Why don't just use unique_ptr Does it seem useful? Why not:
```
template<class T>
using my_ptr = unique_ptr Because I'd like, for example, cast my_ptr<Derived> to my_ptr<Base>.
--
Andrey Davydov