I have gotten many cyclic dependencies recently when my header files includes each other. See also here: What are forward declarations in C++?
I actually do not get totally why its a cycle. When the compiler looks inside the header-file of the include, why does it not recognize the class declaration?
Is there an more elegant/other way to break these cycles instead of a forward declaration of the other class? I do not like that there is a other class declaration in front of my current class. E.g.
#include "Wheel.h" // Include Wheel's definition so it can be used in Car.
#include <vector>
class Wheel;
class Car
{
std::vector<Wheel> wheels;
};