Cpp Coding Standards/HEADERS/IncGuards

From Apache OpenOffice Wiki
< Cpp Coding Standards‎ | HEADERS
Revision as of 16:38, 22 May 2007 by Np (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Internal Include Guards (IncGuards)

Internal include guards are good but don't use the external ones. They add a lot of noise for a non-existent benefit. Also, they add anwanted, and not always noted, dependencies, if for any reason the guarding define changes.

// Foo.hxx

// Yes, use internal include guards

// No include guards here
#include "Superclass.hxx" 

// Bar.cxx

// No include guards here
#include "Bar.hxx"
#include "Foo.hxx"
#include "Baz.hxx"
Personal tools