Suppose my code is setup like this:
Code:
class A
{
};

class B
{
};

class C : A,B
{
};

A* someFunction()
{
    return (A*) new C;
}
Notice I've casted a C into an A. C inherits A, but also B. Is this safe to do if I still know what type it is and cast it back latter, or does multi-inheritance bring up problems with polymorphism? As a second part to my question, would it also be okay to cast from C to B? In other words, does their order in the inheritance area of C's class definition matter, or can you only revert to the first inherited class? Thanks in advance.