News for hackers. Stuff that matters.
Re:Why should I use a pointer rather than the object itself? by DerKommissar on Friday March 07, 2014 @04:54PM (#7362992)

  mutex.lock();
  doStuff(); /*throws an exception, mutex is never unlocked*/
  mutex.unlock();

  ScopedLock lock(mutex);
  doStuff(); /*mutex unlocked by destructor in all cases*/
It guarantees that resources are freed no matter how the scope exits.

There are no comments on this comment yet.