Why #include BEFORE accommodation includes guards

Is there a good reason to place #include directives before including guards in the header file as follows:

#include "jsarray.h"
#include "jsanalyze.h"
#include "jscompartment.h"
#include "jsgcmark.h"
#include "jsinfer.h"
#include "jsprf.h"
#include "vm/GlobalObject.h"

#include "vm/Stack-inl.h"

#ifndef jsinferinlines_h___
#define jsinferinlines_h___

//main body mostly inline functions 

#endif

Please note: this example is taken from an open source project with a high profile in real time, which should be developed by experienced programmers - the open source Javascript engine Mozilla Spidermonkey used in Firefox 10 (the same header file also exists in the latest version).

, . #include ? , ? , (jsinferinlines.h) #include "vm/Stack-inl.h" ( , jsinferinlines.h ) , .

+4
2

SpiderMonkey, - , .

, .

SM, python script, . jsinferinlines.h , , , .

+1

, , .

, (jsinferinlines.h) #include "vm/Stack-inl.h" ( , jsinferinlines.h ) , .

, , , :

  • "vm/Stack-inl.h"
  • "vm/Stack-inl.h" #include "jsinferinlines.h" ( )
  • jsinferinlines.h ( , )
  • #include "vm/Stack-inl.h"
  • - #ifndef jsinferinlines_h___ on

, , .

+4

Source: https://habr.com/ru/post/1535327/


All Articles