Root base class in C++

c++, inheritance

Solution

There is no common root class. Use either void* to pass any object into a function, or better define some base class.

Problem

Every object in .NET inherits (directly or indirectly) from the common root base "Object". Is there such a common object root in C++? How do I pass any object to a function? ``` public void DoSomeStuff(object o) { ... } ``` EDIT: To clarify, the purpose: In that function I want to invoke a pointer to member function. For that I need the object instance and pointer to the required function. To simplify readability I want to make a wrapper containing the both required information. I'm not sure if that is the best way, but it is the background idea.

Original source