After trying to understand what the error messages meant I figured out that I had to make a container class, so I did and here's the relevant code:
Code: Select all
...
#include <string>
#include <map>
class varholder {
template <class T>
T* varpnt; //error
};
std::map<std::string, varholder> variablemap;
...
int main() ...
lispmain.cpp:8: error: data member ‘varpnt’ cannot be a member template
Any ideas on how I should do this? Is there a nice way to get this working or do I have to make an ugly container class that contains pointers to all the datatypes I want, with only one actually being used?