Go back to Richel Bilderbeek's homepage.
Go back to Richel Bilderbeek's C++ page.
A forward declaration is the declaration of a data type the compiler will encounter further on. Because this lets the compiler check less code, forward declarations speed up compilation.
Never #include a header file when a forward declaration will suffice [1].
A forward declaration of a class can be used when nothing needs to be known about that class:
For a list of VCL forward declarations, go to the VCL forward declaration page.
This example shows the header file of a class before and after using as much forward declarations as possible.
#ifndef Unit1H |
#ifndef Unit1H |
Go back to Richel Bilderbeek's C++ page.
Go back to Richel Bilderbeek's homepage.