I would appreciate any help as C++ is not my primary language.
I have a template class that is derived in multiple libraries. I am trying to figure out a way to uniq
You can do the following:
#include
template
class blah
{
public:
static const int cid = id;
};
int main(int argc, char *argv[])
{
std::cout << blah<>::cid << " " << blah<10>::cid << std::endl;
}
I don't know if it's a good idea though. The blah<> part is a bit unintuitive too. Maybe you're better off assigning them ids manually, or you can create a base type, give it a template argument with your class id.