39 #ifndef BLOCXX_LAZY_GLOBAL_HPP_INCLUDE_GUARD_ 40 #define BLOCXX_LAZY_GLOBAL_HPP_INCLUDE_GUARD_ 42 #include "blocxx/BLOCXX_config.h" 46 #ifdef BLOCXX_HAVE_STD_TR1_IS_POD 49 #include <tr1/type_traits> 55 template <
typename T,
typename PODType>
113 template <
typename T,
typename PODType,
typename FactoryT = DefaultVariableConstructorFactory<T, PODType> >
116 #ifdef BLOCXX_HAVE_STD_TR1_IS_POD 131 m_p = static_cast<T*>(FactoryT::create(
m_pod));
147 OnceFlag tmp = BLOCXX_ONCE_INIT;
165 operator const T&()
const 170 template<
typename T2>
174 return (
get() = rhs);
188 #define BLOCXX_LAZY_GLOBAL_INIT(...) { __VA_ARGS__, 0, BLOCXX_ONCE_INIT }
void BLOCXX_COMMON_API callOnce(OnceFlag &flag, FuncT F)
The first time callOnce is called with a given onceFlag argument, it calls func with no argument and ...
#define BLOCXX_STATIC_ASSERT(B)
This class can be used to store a global variable that is lazily initialized in a thread safe manner.
static T * create(const PODType &t)
InitPtr(T *&p, const PODType &str)
T & operator=(const T2 &rhs)