When working with a library, be it my own or external, there are many classes with forward declarations. The same classes are also included depending on the situation. When I use a specific class, I need to know if certain objects that the class uses are declared, or if they include #include (d). The reason is because I want to know if I should include both headers or only one.
Now I know that this is pretty simple to check, just compile (or look through all the headers until you find the object in question, either #include (d) or declared ahead). But with large projects, a simple compiler takes a lot of time, and each include file checks to see if the class in question is included or if a delay is announced, but this is tedious, especially if it's several levels. To illustrate the problem further:
Class A is class B, it is class C that has a pointer to class Foo
I turn on class A and want to know if the Foo class is ready to be used right away, or I need to do the following:
#include "ClassA.h"
#include "ClassFoo.h"
So, is there a quick and easy way to find out about this dependency without compiling or going into dependent headers? (one of the reasons why I ask this question is because I want, in the end, to make an add-on for VS and / or a stand-alone program for this, if the functionality does not exist yet)
Thank!
source
share