Implementation of a new kind of smart pointer in C++ I'm tempted to write a new kind of smart pointer which, I believe, is less intrusive than boost::intrusive_ptr and has the same memory footprint.

The code for the smart pointer, which I called less_intrusive_ptr, is shown below (the boost version used is 1.57.0):

#include &lt;utility&gt;
#include &lt;boost/intrusive_ptr.hpp&gt;
#include &lt;boost/smart_ptr/intrusive_ref_counter.hpp&gt;

template &lt;class T&gt;
class less_intrusive_ref_counter :
    public boost::intrusive_ref_counter&lt;less_intrusive_ref_counter&lt;T&gt;&gt;, public T
{
    using T::T;
};

template &lt;class T&gt;
class less_intrusive_ptr :
    public boost::intrusive_ptr&lt;less_intrusive_ref_counter&lt;T&gt;&gt;
{
    using boost::intrusive_ptr&lt;less_intrusive_ref_counter&lt;T&gt;&gt;::intrusive_ptr;
};

template &lt;class T, class... Args&gt;
less_intrusive_ptr&lt;T&gt; make_less_intrusive(Args&amp;&amp;... args)
{
    return less_intrusive_ptr&lt;T&gt;(
        new less_intrusive_ref_counter&lt;T&gt;(std::forward&lt;Args&gt;(args)...));
}


The code used to test it is shown below:

#include &lt;iostream&gt;
#include &lt;boost/smart_ptr/shared_ptr.hpp&gt;
#include "less_intrusive_ptr.h"

class MyClass1 {};
class MyClass2 : public boost::intrusive_ref_counter&lt;MyClass2&gt; {};
class MyClass3 {};

int main()
{
    boost::shared_ptr&lt;MyClass1&gt; p1(new MyClass1);
    boost::intrusive_ptr&lt;MyClass2&gt; p2(new MyClass2);
    less_intrusive_ptr&lt;MyClass3&gt; p3(new less_intrusive_ref_counter&lt;MyClass3&gt;);
    // or, more friendly syntax:
    //auto p3 = make_less_intrusive&lt;MyClass3&gt;();

    std::cout &lt;&lt; sizeof(p1) &lt;&lt; std::endl;   // output: 8
    std::cout &lt;&lt; sizeof(p2) &lt;&lt; std::endl;   // output: 4
    std::cout &lt;&lt; sizeof(p3) &lt;&lt; std::endl;   // output: 4
    return 0;
}


The advantages I can see are:


less memory usage (compared to shared_ptr)
ref-counting is used only when necessary
no need to write boilerplate code (compared to intrusive_ptr)
no need for a common base class (as is common when using intrusive_ptr)


The disadvantages I can see are:


we cannot use an existing raw pointer and add ref-counting behavior to it, we must always create an object by means of less_intrusive_ref_counter when we need such behavior
we cannot up-cast the underlying raw pointer (which is of type less_intrusive_ref_counter&lt;T&gt; *) to T * and then try to delete it, unless T's destructor is declared virtual. If it's not, and we try to delete the object trough T's pointer, we get undefined behavior.
we must be able to derive from the passed in T, which excludes built-in and (maybe?) POD types, as well as classes marked as final. [pointed out by Filip Roséen and Morwenn]
we cannot make an assignment such as the following: less_intrusive_ptr&lt;Base&gt; p = make_less_intrusive&lt;Derived&gt;(), because less_intrusive_ref_counter&lt;Derived&gt; does not inherit from less_intrusive_ref_counter&lt;Base&gt;.


My question is: can you spot other disadvantages to this approach? In fact, do you think this design is flawed in some way? I really am not an experienced C++ programmer.
To answer my own question, in light of the disadvantages that were gathered, I guess that the usage of the proposed smart pointer would be severely limited. Hence, I would rather rely on the flexibility of the standard smart pointers, especially through the use of std::make_shared.