HP aC++/HP C A.06.20 Programmer's Guide

Error Directive (#error)................................................................................................167
Syntax.....................................................................................................................167
Example..................................................................................................................167
Warning Directive........................................................................................................167
Syntax.....................................................................................................................167
Trigraph Sequences.....................................................................................................168
Examples......................................................................................................................168
5 Using HP aC++ Templates.......................................................................................................169
Invoking Compile-Time Instantiation..............................................................................169
Scope and Precedence.................................................................................................169
Template Processing....................................................................................................169
Explicit Instantiation...................................................................................................170
Usage......................................................................................................................170
Performance...........................................................................................................170
Examples................................................................................................................171
Class Template..................................................................................................171
Function Template............................................................................................171
Command-Line Option Instantiation..........................................................................172
Compile-Time Instantiation........................................................................................172
Why Use Compile-Time Instantiation...................................................................173
Scope......................................................................................................................173
Usage......................................................................................................................173
Migrating from Automatic Instantiation to Compile-time Instantiation....................173
Possible Duplicate Symbols in Shared Libraries....................................................173
Possible Duplicate Symbols in Archive Libraries..................................................174
Building an Archive Library with +inst_auto/+inst_close................................174
Building an Archive Library with Compile-time Instantiation........................174
C++ Template Tutorial.................................................................................................175
Class Templates......................................................................................................175
Function Templates................................................................................................176
6 Standardizing Your Code........................................................................................................177
HP aC++ Keywords...........................................................................................................177
bool Keyword..............................................................................................................177
Usage......................................................................................................................177
Example..................................................................................................................178
dynamic_cast Keyword...............................................................................................178
Usage......................................................................................................................178
Example..................................................................................................................178
explicit Keyword.........................................................................................................181
Usage......................................................................................................................181
Example..................................................................................................................182
Table of Contents 13