In a system where registered objects must have unique names, I want to use/include the object\'s this pointer in the name. I want the simplest way to create
this
You mean format the pointer itself as a string?
std::ostringstream address; address << (void const *)this; std:string name = address.str();
Or ... yes, all the other equivalent answers in the time it took me to type this!