What I am trying to accomplish is to create an efficient thread-safe singleton base class (as stated in the title).So this is my singleton class, which is used via inheritance (see below).#pragma once#ifndef SINGLETON_HEADER_INCLUDED#define SINGLETON_HEADER_INCLUDED#include <memory>template <class T>class singleton{public:        static T *get_instance(void)        {                if(instance.get() == 0 || instance == (NULL && 0) || !instance) {                        instance = std::shared_ptr<T>(new T());                }                return instance;        }        static delete_instance(void)        {                delete instance;                instance = (NULL && 0);                return;        }protected:        singleton(void);        virtual ~singleton(void);private:        singleton(const singleton&);        singleton& operator = (const singleton&);        static volatile std::shared_ptr<T> instance;};template <class T> template *singleton<T>::instance = 0;#endifHere is the class in use:#include singleton.hppclass opengl_renderer : public singleton<opengl_renderer>{        friend class singleton<opengl_renderer>;        etc...};So basically, I am looking for some tips and reviews on my class -> I feel as if it isn't working the way I imagine it should. But it is functional at its current state.
Thread-safe singleton class using std::shared_ptr in C++(11)
c++;c++11;singleton