beautypg.com

The standard c++ library containers – HP Integrity NonStop J-Series User Manual

Page 117

background image

Library iterators. The Tools.h++ Class Reference contains entries for both the full and the
subset interfaces for all of the templates that can be used either with or without the Standard
C++ Library.

There are two reasons you may want to use the restricted subset interface for a collection class
template:

You may be operating in an environment that does not yet support a version of the
Standard C++ Library compatible with this version of Tools.h++. In that case, you have
no choice but to use the restricted subset interface. The good news is that by using the
interface, you will be ready to start using the full interface as soon as the Standard C++
Library becomes available on your platform.

1.

Another reason to stick to the subset interface is that you want to write portable code_a
class library, perhaps_that can be deployed on multiple platforms, some without support
for the Standard C++ Library. Clients of that code can still take full advantage of their
individual environments; you aren't forced to inflict on them a "lowest common
denominator." See

Using Templates Without the Standard Library

toward the end of this

chapter for more information on the restricted subset interface.

2.

The Standard C++ Library Containers

There are seven Standard C++ Library containers: deque, list, vector, set, multiset, map, and
multimap. Tools.h++ extends these with five additional containers which are compliant with
the Standard C++ Library:

rw_slist

,

rw_hashset

,

rw_hashmultiset

,

rw_hashmap

, and

rw_hashmultimap

. Each of these has value-based and pointer-based Rogue Wave wrapper

templates. Tools.h++ also offers always-sorted versions, both value-based and pointer-based, of
the doubly-linked list and vector collections. The total: 28 new or re-engineered collection class
templates, all based on the Standard C++ Library!

Tools.h++ Standard Library-Based Templates

Division // Notes

Value-based

Pointer-based

Standard
Library
Required?

Sequence Based

//External Ordering, access by
index

RWTValDlist
RWTValDeque
RWTValOrderedVector
RWTValSlist

RWTPtrDlist
RWTPtrDeque
RWTPtrOrderedVector
RWTPtrSlist

No

Yes

No
No

Sorted sequence-based
//Internal ordering, access by
index

RWTValSortedDlist
RWTValSortedVector

RWTPtrSortedDlist
RWTPtrSortedVector

Yes

No

This manual is related to the following products: