HP aC++/HP C A.06.28 Programmer's Guide Integrity servers (769150-001, March 2014)
5 Using HP aC++ Templates.......................................................................132
Invoking Compile-Time Instantiation.........................................................................................132
Scope and Precedence.....................................................................................................132
Template Processing.........................................................................................................132
Explicit Instantiation..........................................................................................................133
Usage.......................................................................................................................133
Performance...............................................................................................................133
Examples...................................................................................................................133
Class Template.......................................................................................................133
Function Template...................................................................................................134
Command-Line Option Instantiation....................................................................................134
Compile-Time Instantiation.................................................................................................134
Why Use Compile-Time Instantiation..............................................................................135
Scope........................................................................................................................135
Usage.......................................................................................................................135
Migrating from Automatic Instantiation to Compile-time Instantiation.......................................135
Possible Duplicate Symbols in Shared Libraries................................................................135
Possible Duplicate Symbols in Archive Libraries................................................................135
Building an Archive Library with +inst_auto/+inst_close...............................................136
Building an Archive Library with Compile-time Instantiation..........................................136
C++ Template Tutorial......................................................................................................136
Class Templates..........................................................................................................136
Function Templates......................................................................................................137
6 Standardizing Your Code........................................................................138
HP aC++ Keywords..............................................................................................................138
bool Keyword..................................................................................................................138
Usage.......................................................................................................................138
Example....................................................................................................................138
dynamic_cast Keyword.....................................................................................................139
Usage.......................................................................................................................139
Example....................................................................................................................139
explicit Keyword..............................................................................................................141
Usage.......................................................................................................................141
Example....................................................................................................................141
mutable Keyword.............................................................................................................143
Usage.......................................................................................................................143
Example....................................................................................................................143
namespace and using Keywords........................................................................................144
Connections Across Translation Units.............................................................................144
An Auxiliary Translation Unit.........................................................................................145
using- declarations and using- directives.........................................................................145
using- declaration...................................................................................................145
using- directive.......................................................................................................145
typeid Keyword...............................................................................................................146
Usage.......................................................................................................................146
typeid Example......................................................................................................146
volatile Keyword..............................................................................................................148
Usage.......................................................................................................................148
Example....................................................................................................................148
wchar_t Keyword.............................................................................................................149
Usage.......................................................................................................................149
Example....................................................................................................................149
template Keyword............................................................................................................149
Usage.......................................................................................................................149
Contents 11