In many articles, there is such a coding guideline:

>> On a .cpp file always include the corresponding header file first, like this:
Code:
// This is Foo.cpp
 
#include "Foo.h"  
#include "tao/Bar.h" 
#include "ace/Baz.h" 
 
// Here comes the Foo.cpp code....
>> In this way we are sure that the header file is self-contained and can be safely included from some place else.

Why it can make sure the header file is self-contained by including the header file first in the corresponding implementation file? Can anybody explain it a little bit more?

Last edited by princemaozh; 15Jan2008 at 07:26..