class MyClass
{
public:
void DoSomething(OtherClass *ptr);
private:
.....
};
The compiler complains because it doesn't know what OtherClass is. Yet, as long as I don't use specific parts of OtherClass, I can just pre-def OtherClass at the top of this header:
// at the top:
class OtherClass;
My question is: Is there a way to have the compiler be okay with this, without adding pre-defs for every variable type passed to a function in the header? Perhaps some compiler option (Microsoft Visual Studio 2010)? Or maybe some type of pointer-type-hiding mechanism?
Thank you for any help.