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
What kind of ID? Are you looking for an atomically increasing int? If a string is fine, what about:
static string s_id()
{
return typeid(Foo).name();
}
If it needs to be an int, but not automatically increasing, you could hash that for a 128-bit integer unlikely to have collisions (though likely a larger number than you need)