Singleton: Porovnání verzí
Smazaný obsah Přidaný obsah
pouze Kategorie:Návrhové vzory |
Bez shrnutí editace |
||
Řádek 159:
}
}
</source>
<source>
class Singleton {
private:
static Singleton *instance;
public:
static Singleton *GetInstance()
{
if (instance == NULL) {
instance = new Singleton();
}
return instance;
}
}
</source>
|