31 #include <MUtils/Exception.h> 34 #include <QScopedPointer> 35 #include <QAtomicPointer> 46 template<
typename T>
class Lazy 53 if (T *
const initializer = create())
55 if (m_data.testAndSetOrdered(NULL, initializer))
62 MUTILS_THROW(
"Initializer function returned NULL!");
69 virtual T *create() = 0;
72 QAtomicPointer<T> m_data;
This file contains miscellaneous functions that are generally useful for Qt-based applications...
Lazy initialization template class.
Definition: Lazy.h:46
Global MUtils namespace.
Definition: CPUFeatures.h:37