C++ Header order [closed]

In a header file you have to include ALL the headers to make it compilable. And don’t forget to use forward declarations instead of some headers.

In a source file:

  • corresponded header file
  • necessary project headers
  • 3rd party libraries headers
  • standard libraries headers
  • system headers

In that order you will not miss any of your header files that forgot to include libraries by their own.

Leave a Comment