WebHosting

Wednesday, June 29, 2011

Singleton Pattern & its implementation with C++

#include
#include "Singleton.h"
using namespace std;

void useSingleton(){
Singleton* singletoneg= Singleton::getInstance();
singleton->doSummut();

// this shouldn't be allowed
Singleton* doubleton;
doubleton->doSummutElse();
}

int main(int argc, char** argv) {
useSingleton();
return (EXIT_SUCCESS);
}

No comments:

Post a Comment

Thank you for Commenting Will reply soon ......

Featured Posts

Warp AI Terminal 🔥 | The Future of Coding? Agentic Dev Environment Explained!

  Warp AI Terminal 🔥 | The Future of Coding? Agentic Dev Environment Explained! What if your terminal could think, assist, and even act li...