Destructor for static fields. Singleton realization

后端 未结 3 1732
醉话见心
醉话见心 2020-12-28 19:42

So, classic simple Singleton realization is following:

class Singleton
{
private:
    static Singleton* singleton;
    Singleton() {}
public:
    static Sing         


        
3条回答
  •  滥情空心
    2020-12-28 20:28

    When a variable local to a function is declared "static", it means that it isn't allocated on the stack - and that its value persists from one call to the next.

提交回复
热议问题