Skip to content

Instantly share code, notes, and snippets.

View dylan1p's full-sized avatar

Dylan Clarke dylan1p

View GitHub Profile
@Qix-
Qix- / order-of-includes.md
Last active December 10, 2021 14:49
Order of includes

C/C++ Order of Includes

The order in which I group my header includes is as follows. Each section is separated by exactly one blank line, even if the section only has one include.

  1. "" Internal headers
  2. "" Internal generated headers (e.g. from version.h.in; okay to use from include path)
  3. "" Internal third-party headers (vendored into project)
  4. "" Private API headers (always relative paths)
  5. "" Public API headers
  6. <> Build-system level third party headers (e.g. from CMake's add_subdirectory(); always from include path)