Oracle® Solaris Studio 12.4: C++ User's Guide

Exit Print View

Updated: March 2015
 
 

Please tell us how to improve our documentation:


0 of 500

0 of 500



0 of 500
Thank you for your feedback! If you want to participate in content improvement and share additional information, please click Feedback button.
Rate this document:

5.1.2 Idempotent Header Files

Your header files should be idempotent, that is, the effect of including a header file many times should be exactly the same as including the header file only once. This property is especially important for templates. You can best accomplish idempotency by setting preprocessor conditions that prevent the body of your header file from appearing more than once.

#ifndef HEADER_H
#define HEADER_H
/* contents of header file */
#endif