Google c++ style has the following. I don't understand why forward declaration will call f(void*).
It can be difficult to determine whether a forward declaration or a full #include is needed. Replacing an #include with a forward declaration can silently change the meaning of code:
// b.h: struct B {}; struct D : B {}; // good_user.cc: #include "b.h" void f(B*); void f(void*); void test(D* x) { f(x); } // calls f(B*) If the #include was replaced with forward decls for B and D, test() would call f(void*).
struct D;then the inheritance is not known.