beautypg.com

Iterators and the std() gateway – HP Integrity NonStop J-Series User Manual

Page 130

background image

Click on the banner to return to the user guide home page.

©Copyright 1996 Rogue Wave Software

Iterators and the std() Gateway

The Tools.h++ templates are meant to enhance the Standard C++ Library, not to stand as a
barrier to it. The iterators described in the previous section are standard iterators, and you can
use them in conjunction with any components offering a standard iterator-based interface. In
particular, you can use all of the standard algorithms with the Rogue Wave standard
library-based collections. For example:

RWTValOrderedVector vec;

// ... < put stuff in vector >

// Set the first 5 elements to 0:
fill(vec.begin(), vec.begin() + 5, 0);

In addition, you are always free to access, and in some cases to manipulate, the underlying
Standard C++ Library collection class. This is accomplished via the std() member function,
which returns a reference to the implementation.

This manual is related to the following products: