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?
(v) SHORT DETENTION ORDER If a Short Detention Order (SDO) is made, the offender can be detained in prison for a period not exceeding 14 days.
(1) “Relevant persons” are persons who have an involvement in P's life and/or who are likely to have an interest in the application.
First introduced by the Legislative Council of the Colony of Singapore, the Criminal Procedure Code is a set of laws imperative for the management of a fair trial where rights of the accused are not compromised in any way.
Does the STL or STD library or even Boost have any cases where certain includes must come in a certain order?
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:
Standard headers may be included in any order; each may be included more than once in a given scope, with no effect different from being included only once, except that the effect of including
<assert.h>
depends on the definition ofNDEBUG
(see 7.2).
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.
This definitely sounds like a bad design. If somehow a specific order was required, the library should provide one header that includes the other ones in the correct order.
As far as boost, and the STL, I'm pretty sure I haven't encountered this situation yet.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With