I have two classes. One of them is the management class, which stores a bunch of working classes. Workers are actually templates.
#include "worker.h"
class Management {
private:
worker<type1> worker1;
worker<type2> worker2;
...
};
The problem arises because the template classes must use Management.
Example:
class Worker{
...
};
#include "Worker.inl"
Working inl file:
#include "Management.h"
Worker::Worker(){
Management mgmt1();
mgmt1.doSomething();
}
...
Typically, you send a Management.h declaration to the Worker header file and name it day. Unfortunately, since the template is templated, it will always be included.
I assume that you can argue that the design is bad, because the template does not have to be template if it needs to know such information, but that’s what it is and I have to work with it.
You can also consider this issue as a microcosm of office life.