Hi,

While reading singleton.h, I noticed that instance() copies the pointer before returning it.
I could not prove to myself that

  static singleton<T>* instance()
  {
    _inst_m.lock();
    if(!_instance) {
      _instance = new singleton<T>();
    }

    _inst_m.unlock();

    return _instance;
  }

is wrong. What do I miss?

TIA

br

Szo
_______________________________________________
Semsdev mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/semsdev

Reply via email to