HP aC++/HP C Programmer's Guide (B3901-90036; A.06.26; September 2011)
Example 2.............................................................................................153
Using Constants and Inline Functions Instead of Macros...................................153
Example................................................................................................153
Predefined Macros......................................................................................154
Assertions (#assert, #unassert)...........................................................................155
Syntax.......................................................................................................155
Description.................................................................................................155
Conditional Compilation (#if, #ifdef, .. #endif)....................................................156
Syntax.......................................................................................................156
Description.................................................................................................156
Using the defined Operator..........................................................................156
Using the #if Directive.................................................................................157
The #endif Directive....................................................................................157
Using the #ifdef and #ifndef Directives..........................................................157
Nesting Conditional Compilation Directives....................................................157
Using the #else Directive..............................................................................157
Using the #elif Directive...............................................................................158
Examples...................................................................................................158
Line Control (#line)...........................................................................................158
Syntax.......................................................................................................158
Description.................................................................................................159
Example....................................................................................................159
IOSTREAM Performance Improvement Pragma.....................................................159
Syntax:......................................................................................................159
Pragma Directive (#pragma) and _Pragma Operator............................................160
Syntax.......................................................................................................160
Description.................................................................................................160
Example....................................................................................................160
Error Directive (#error)......................................................................................160
Syntax.......................................................................................................161
Example....................................................................................................161
Warning Directive............................................................................................161
Syntax.......................................................................................................161
Trigraph Sequences..........................................................................................161
Examples........................................................................................................162
5 Using HP aC++ Templates....................................................................................................163
Invoking Compile-Time Instantiation.........................................................................163
Scope and Precedence.....................................................................................163
Template Processing.........................................................................................163
Explicit Instantiation.........................................................................................164
Usage.......................................................................................................164
Performance...............................................................................................164
Examples...................................................................................................165
Class Template.......................................................................................165
12 Contents