I’ve used some very large scale systems and never seen a required order, but came across it recently. Does the STL or STD library or even Boost have any cases where certain includes must come in a certain order?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
For the standard, the answer is emphatically, no. I imagine the same is true for Boost, though I haven’t looked it up.
From the C standard:
the C++ standard has similar wording.
My preference is that headers should include their own dependencies, but I’ve worked with people who believe this to be ‘wasteful’. In my opinion, not having headers include their dependencies is a worthless early optimization.