Browse Source

ResourceManager: allow users to instantiate internalInstance() only once.

It is cumbersome, but otherwise the linking (on mingw) fails with
multiple definition errors.
pull/7/head
Vladimír Vondruš 14 years ago
parent
commit
b2a5f535d7
  1. 2
      src/ResourceManager.h

2
src/ResourceManager.h

@ -567,10 +567,12 @@ template<class... Types> class ResourceManager: protected Implementation::Resour
static ResourceManager<Types...>*& internalInstance();
};
#ifndef MAGNUM_RESOURCEMANAGER_DONT_DEFINE_INTERNALINSTANCE
template<class ...Types> ResourceManager<Types...>*& ResourceManager<Types...>::internalInstance() {
static ResourceManager<Types...>* _instance(nullptr);
return _instance;
}
#endif
/** @debugoperator{Magnum::ResourceKey} */
template<class T> inline Corrade::Utility::Debug operator<<(Corrade::Utility::Debug debug, const ResourceKey& value) {

Loading…
Cancel
Save