So i've just read about forward declarations at various sources (e.g googles c++ style guide) and i am quite confused when i should and when i shouldn't use forward declarations.
One one hand if I always forward declare classes i will never have troubles with circular dependencies and faster compile times.
But on the other hand i will have to use almost exclusively work with pointers to objects which seems quite unsafe considering memory leaks and also unnecessary complicated to work with.
So should i use forward declarations whenever I possibly can or only when its needed to avoid stuff like circular dependencies?
And another question regarding forward declarations. If im working with extern libraries such as GLM (which is a math library) and i need it in many different classes is there a way to forward declare those aswell / does it even make sense to do so?
Examples of what i have to include (GLM):
#include <glm.hpp>
#include <gtc/matrix_transform.hpp>
#include <gtc/type_ptr.hpp>
And for example i will use it like this:
std::vector <glm::vec3> vertices;