#include <iostream>
inline int getLastId() { static int last{0}; return last++; }
template<typename T> struct IdInfo { static int id; };
template<typename T> int IdInfo<T>::id{getLastId()};
struct Type00 { };
struct Type01 { };
struct Type02 { };
int main(void)
{
using namespace std;
cout << IdInfo<Type00>::id << "\n"
<< IdInfo<Type01>::id << "\n"
<< IdInfo<Type02>::id << endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKaW5saW5lIGludCBnZXRMYXN0SWQoKSB7IHN0YXRpYyBpbnQgbGFzdHswfTsgcmV0dXJuIGxhc3QrKzsgfQoKdGVtcGxhdGU8dHlwZW5hbWUgVD4gc3RydWN0IElkSW5mbyB7IHN0YXRpYyBpbnQgaWQ7IH07CnRlbXBsYXRlPHR5cGVuYW1lIFQ+IGludCBJZEluZm88VD46Omlke2dldExhc3RJZCgpfTsKCnN0cnVjdCBUeXBlMDAgeyB9OwpzdHJ1Y3QgVHlwZTAxIHsgfTsKc3RydWN0IFR5cGUwMiB7IH07CgppbnQgbWFpbih2b2lkKSAKewoJdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCQoJY291dCA8PCBJZEluZm88VHlwZTAwPjo6aWQgPDwgIlxuIgoJICAgICA8PCBJZEluZm88VHlwZTAxPjo6aWQgPDwgIlxuIgoJICAgICA8PCBJZEluZm88VHlwZTAyPjo6aWQgPDwgZW5kbDsKCQoJcmV0dXJuIDA7Cn0K