beautypg.com

HP Integrity NonStop J-Series User Manual

Page 139

background image

Existing code using these templates will not provide the number of template arguments
expected by this version of Tools.h++ when used with the Standard C++ Library. The solution
to this problem is to use the macros discussed in in

An Example of Using Templates Without the

Standard Library

. Using the macros described there will satisfy the compiler and preserve the

semantics of your existing code.

The class hierarchy has changed for:

RWTPtrHashSet

RWTValHashSet

RWTPtrHashTable

RWTValHashTable

RWTPtrOrderedVector RWTValOrderedVector

RWTPtrSortedVector

RWTValSortedVector

If you have existing code that makes use of any of the inheritance relationships among the
collection class templates, that code will not compile with this version of Tools.h++ when used
with the Standard C++ Library. There are no inheritance relationships among the standard
library-based implementations of the collection class templates. For example, in the previous
version of Tools.h++,

RWTPtrHashSet

inherited from

RWTPtrHashTable

,

RWTValOrderedVector

inherited from

RWTValVector

, and

RWTValSortedVector

inherited

from RWTValOrderedVector. The pointer-based versions of these templates followed a similar
pattern. These relationships do not hold in the new version of Tools.h++. If you have code
based on this inheritance, you will need to modify it .

The most likely place where you will find this problem in your existing code is when building
an

RWTValHashTableIterator

from an

RWTValHashSet

, or an

RWTPtrHashTableIterator

from an

RWTPtrHashSet

. Because the constructor for RWTValHashTableIterator is expecting

a reference to an

RWTValHashTable

, passing in an RWTValHashSet instead depends on the

inheritance relationship.

The solution to this particular problem is found in the new class

RWTPtrHashSetIterator

.

Wherever you find code which constructs an

RWTValHashTableIterator

from an

RWTValHashSet

, use an

RWTValHashSetIterator

instead. Note that RWTValHashSetIterator

is provided whether or not the Standard C++ Library is available, so you can modify your code
now in anticipation of migrating your code to the standard library-based implementations.

Required less-than semantics for an element type may affect:

RWTPtrDlist

RWTValDlist

RWTPtrOrderedVector RWTValOrderedVector

RWTPtrSlist

RWTValSlist

RWTPtrSortedVector

RWTValSortedVector

This manual is related to the following products: