/* Collection of code snippets by Arne Vajhøj */
/* (from articles on eksperten.dk / vajhoej.dk written sometime between 2004 and now) */
#ifndef SYNCHRONIZED_SINGLETON_11_H
#define SYNCHRONIZED_SINGLETON_11_H

#include <iostream>

using namespace std;

class SynchronizedSingleton11
{
private:
    static SynchronizedSingleton11* instance;
    int SomeState;
    SynchronizedSingleton11() { SomeState = 123; }
public:
    SynchronizedSingleton11(const SynchronizedSingleton11& original) = delete;
    SynchronizedSingleton11& operator=(const SynchronizedSingleton11& original) = delete;
    static SynchronizedSingleton11& Instance();
    void SomeMethod() { cout << SomeState << endl; }
};

#endif
