the sequence of including headfiles

the sequence of including headfiles may affect the success of compilation.
and now i am wondering if it is important to include headfiles in a particular sequence if all the headfiles included in my program are the headfiles all included in GNU C/C++ Library.
just like:
1
2
#include<iostream>
#include<vector> 

1
2
#include<vector>
#include<iostream> 

(just an example.both complier)
the sequence of including headfiles may affect the success of compilation.
That's only the case if your headers are poorly-written. If only one order of inclusion is valid then probably one of those headers needs to include the other.

Standard headers do not care in which order they're included.
No, the ordering of standard library headers should not matter (assuming you don't have code in-between the #includes, then it would of course matter).

This might not be true in general for custom headers, where you could have, for example, a conflicting macro that bleeds into the other header.
Topic archived. No new replies allowed.