I have a header with a template class that has only static functions and fields.
template<typename T> class Luaproxy { static std::map<std::string, fieldproxy> fields; static const char * const CLASS_NAME; static void addfields(); static int __newindex(lua_State * l){
As you can see, some of the functions are declared only because I intend to implement them using specialized specialization.
In the .ccp file, I have:
struct test { int a; } template<> map<string, fieldproxy> Luaproxy<test>::fields; template<> const char * const Luaproxy<test>::CLASS_NAME=typeid(test).name(); template<> void Luaproxy<test>::addfields(){
I get undefined reference errors to Luaproxy<test>::fields from both the functions that are implemented in the header and those that specialize only in .cpp. Note that Luaproxy<test>::CLASS_NAME and Luaproxy<test>::addfields seem to be in the link.
What makes this map so special?
source share