Not directly, no. You can use private inheritance to inherit components instead of aggregating them (note that private inheritance does not express is-a ) and then publishes some of its using member functions. Something like that:
class Object1 : public Object, private Component1, private Component2, ..., private ComponentN { public: using Component1::function1(); using Component1::function2(); ... using ComponentN::functionM(); };
I am not saying that this is the best way to do this, but it is a way.
source share