Is there any standard order of inclusion to avoid hidden dependencies?
if yes,is this correct order?
- C library headers
- C++ library headers
- Other library headers
- Related headers
- our projects headers
Is there any standard order of inclusion to avoid hidden dependencies?
if yes,is this correct order?
There is no standard order, but if you want to avoid hidden dependencies, you have to go in the exact opposite order: include the most project-specific headers first, then specific library headers, then more generic library headers (such as e.g. Qt and boost), and eventually standard library headers last.
This way, you will be certain that missing dependencies of your project's headers are not accidentally satisfied by the headers which you've included earlier.