#ifndef MBGL_UTIL_EXCLUSIVE #define MBGL_UTIL_EXCLUSIVE #include #include namespace mbgl { namespace util { template class exclusive { public: inline exclusive(T* val, std::unique_ptr> mtx) : ptr(val), lock(std::move(mtx)) {} inline T* operator->() { return ptr; } inline const T* operator->() const { return ptr; } inline T* operator*() { return ptr; } inline const T* operator*() const { return ptr; } private: T *ptr; std::unique_ptr> lock; }; } // end namespace util } // end namespace mbgl #endif