What Is a Forward Declaration?
A forward declaration introduces the name and basic shape of a type or function so it can be referenced before the compiler sees its complete definition. It is enough for uses that only need a pointer or a signature, not the full layout. The complete definition must still appear before code that requires the type details.
Why it matters
Forward declarations break include cycles and cut compile dependencies, which can speed up builds and reduce coupling. They also enable mutually referencing types that could not otherwise be defined.
Related guides
What Is a Header Guard?A header guard is a preprocessor pattern that ensures a header file is included only once per translation uni…
What Is a Translation Unit?A translation unit is the complete source seen by the compiler after preprocessing one source file, the unit…
What Is Template Instantiation?Template instantiation is the compiler generating concrete code from a generic template for each specific set…