Singleton class and correct way to access it in C++ I'm currently trying to implement the singleton pattern in C++. After reading about it for a while now, it seems like there are a really large amount of different ways to do this. 

Is the way I ended up doing it correct or did I miss out on something important here? Is this implementation thread safe in modern C++ (I read there were some changes to that in particular with C++11)? In addition I am not sure at all about the way I am accessing the class within MyFunction(). 

Is it really necessary to use a raw pointer there? Does this code contain any memory leaks?

#include &lt;iostream&gt;

class Singleton
{
private:

    Singleton();
    ~Singleton();  

public:

    static Singleton&amp; instance()
    {
        static Singleton INSTANCE;
        return INSTANCE;
    }

    void Test();
};

void Singleton::Test()
{
    std::cout &lt;&lt; "Test() called" &lt;&lt; std::endl;
}

Singleton::Singleton()
{
    std::cout &lt;&lt; "CONSTRUCTOR CALLED" &lt;&lt; std::endl;
}

Singleton::~Singleton()
{
    std::cout &lt;&lt; "DESTRUCTOR CALLED" &lt;&lt; std::endl;
}

void MyFunction()
{
    // use the singleton class
    Singleton * MySingleton = &amp;Singleton::instance();   
    MySingleton-&gt;Test();    
}


int main()
{
    MyFunction();
    return 0;
}
Thread safety
Accessing the singleton is thread-safe. The change in C++11 has forced compilers to implement the construction of local static variables (like INSTANCE) in a thread-safe manner.
Note, however, that this doesn't make Singleton thread-safe under all circumstances: If multiple threads are calling Singleton::Test, I wouldn't be surprised to see some garbled output, as access to std::cout isn't synchronized.
Correctness
The current implementation violates the rule of 5: It has a custom destructor, but no custom copy and move constructors and assignment operators. And, to prevent making a copy of the singleton instance (or moving from it!), these 4 special functions should be deleted, like so:
public:
    Singleton(const Singleton&amp;) = delete;
    Singleton(Singleton&amp;&amp;) = delete;
    Singleton&amp; operator=(const Singleton&amp;) = delete;
    Singleton&amp; operator=(Singleton&amp;&amp;) = delete;

Note the public specifier, this ensures that these deletions are visible everywhere needed.
Access
While taking a pointer from the reference returned by Singleton::instance() is a valid use, it seems unnecessary in MyFunction as the pointer isn't required. Why not simply capture by a reference, like so:
auto&amp; MySingleton = Singleton::instance();
MySingleton.Test();

Or if only one call is done:
Singleton::instance().Test();