C++ Headers Include Order
As working on my side project, one thing I have settled down is to have a consistent header file include order. My solution is very similar to what Google recommends in its C++ style guide.
Here is mine:
<<Current file’s header file>>
<<C library files>>
<<C++ library files>>
<<Other library files>>
<<header files under the same module as the current file>>
<<header files in other modules>>
<<header files in utility module>>
- Every file path is specified to be relative to the project source directory.
- Inside each section, files are ordered in alphabetic order.
- For clarity, sections are separated by one empty line.
Here is a bogus code snippet for my ParserDriver.cpp
So far, I am pretty happy with it and will stick with this order in my project.