I'm trying to build codeblocks with llvm clang, this has to be used as i am cross compiling. i've hit a snag that i can't figure out how to work around it
it's related to the manager.h
template <class MgrT> class DLLIMPORT Mgr
{
static MgrT *instance;
static bool isShutdown;
explicit Mgr(const Mgr<MgrT>&) { ; };
Mgr<MgrT>& operator=(Mgr<MgrT> const&) { ; };
protected:
Mgr() { assert(Mgr<MgrT>::instance == nullptr); }
virtual ~Mgr() { Mgr<MgrT>::instance = nullptr; }
public:
static bool Valid() { return instance; }
static MgrT* Get()
{
if (instance == nullptr)
{
if (isShutdown == false)
instance = new MgrT();
else
cbAssert(false && "Calling Get after the subsystem has been shutdown is an error!");
}
return instance;
}
static void Free()
{
isShutdown = true;
delete instance;
instance = nullptr;
}
};
template<> ColourManager* Mgr<ColourManager>::instance = nullptr;
template<> bool Mgr<ColourManager>::isShutdown = false;
cbcolourmanager.cpp|18|error: explicit specialization of 'instance' after instantiation|how can i modify the code to get around this issue. i understand i need to declare the explicit specialization.. but how can i do this? how do i modify the header in such a way that this satisfies the c++ standard that llvm clang is trying to adhere to?