Q:

Creating a smart pointer member of class referencing itself is a elegant design pattern in c++?

I would like to know if following code is a good pattern in C++?
There is no problem at all. The code works. But I would like to know if this can lead to some sort of problem.
#include <iostream>
#include <memory>

template <typename T>
class Class {
    public:
        std::shared_ptr<Class> shared_ptr;

        Class() : shared_ptr(this) {}
        ~Class() { shared_ptr.reset(); }
};

A:

No, the code posted is neither useful nor safe.
There are three scenarios, and none of them have a positive result:

The object is created in automatic storage

In this case, the object will be destroyed when it goes out of scope.  It's destructor will be run and attempt to free memory it does not own, resulting in undefined behavior.
Example

The object is created in dynamic storage and gets deleted by the caller

In this case the destructor will be invoked when the caller (or some smart pointer created by the caller) deletes the object.  Your destructor will then try to delete the object again, resulting in undefined behavior.
Example

The object is created in dynamic storage and doesn't get deleted by the caller

In this case, the object will never be destroyed.  It's destructor will never be invoked, and its storage will be leaked.  Your extra shared_ptr member achieved nothing.
Example

