I'm trying to simplify a bunch of header file "include spaghetti" by using forward declarations and moving #includes into the implementation file. However, I keep coming upon the following scenario:
//Foo.h
#include "Bar.h"
class Foo
{
public:
void someMethod(Bar::someType_t &val);
};
//Bar.h
.
.
.
class Bar
{
public:
typedef std::vector<SomeClass> someType_t;
};
I want to remove #include "Bar.h" in as many cases as possible. I also see the situation where the typedef in Bar.h is listed outside of the Bar class. I'm assuming both situations can be addressed in the same manner.
Any ideas?