This is a rather basic question, but it\'s one that\'s bugged me for awhile.
My project has a bunch of .cpp (Implementation) and .hpp (Definition) files.
I f
I always use the principle of least coupling. I only include a file if the current file actually needs it; if I can get away with a forward declaration instead of a full definition, I'll use that instead. My .cpp files always have a pile of #includes at the top.
Bar.h:
class Foo;
class Bar
{
Foo * m_foo;
};
Bar.cpp:
#include "Foo.h"
#include "Bar.h"