Friday, 27 May 2011

C++ tips: use forward declaration when possible

Found a good explanation of forward declaration in C++ header files here. Basically, if a class A is only used as a reference or a pointer, it should only need to be included as:
class A;
//#include <A.h> // Not like this

No comments :

Post a Comment