I ended up having strange requirement. I have multiple derived classes from one base class, like below.
class base
{
}
class derived1 : base
{
}
class derived2 : base
{
}
.
.
.
.
class derivedN : base
{
}
void someFunction(base bObj)
{
//get me derived class object with which bObj was created.
}
Now at some point of my code, I get base class object (this is argument for a function). Can this function extract exact derived class object from which this base class object was created?
It may not make sense, but I have a strong feeling that there must be a way.