Re: multiple inclusion of header files accross

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Aaron,

In typical C/C++ files, header files should not generate any bytes of output.  Declarations are okay, instantiated definitions are not.

 From Stroustrup's C++PL section 9.2.1

As a rule of thumb, a header may contain:
+ named namespaces
+ type definitions
+ template declarations
+ template definitions
+ function declarations
+ inline function definitions
+ data declarations
+ constant defintions
+ enumerations
+ name declarations (forward declarations)
+ include directives
+ macro definitions
+ conditional compilation directives
+ comments

Conversely, a header should never contain:
+ ordinary function definitions
+ data definitions
+ aggregate definitions
+ unnamed namespaces
+ exported template definitions

HTH,
--Eljay



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux