Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Introduction to SourcePro C++
Rogue Wave web site:  Home Page  |  Main Documentation Page

3.2 An Example Using the Essential Tools Module and the C++ Standard Library

The C++ Standard Library is perhaps the ultimate in general purpose functionality, but its range of low-level features can be daunting. The Essential Tools Module builds on the standard library to provide richer interfaces and easier semantics. At the same time, the design preserves the ability to exchange objects between the libraries so that they work well together.

In the following example, the RWTValDlist class template from the Essential Tools Module is used to construct a doubly-linked list of integers. Once the list is created, the Essential Tools Module functionality is used to add elements, sort, and persist the list. At the same time, algorithms from the C++ Standard Library are used to manipulate the list and output the results. The begin() and end() member functions of RWTValDlist return bidirectional iterators of the C++ Standard Library std::list container that it builds on. If desired, you could also use the std() member function to access the list container directly and perform any C++ Standard Library operations with it.


This example has been tested internally at Rogue Wave, but not in all possible configurations. Depending on your environment and the options chosen when you built your SourcePro libraries, minor syntactical changes may be needed for a successful build.

Example 1: Using the Essential Tools Module and the C++ Standard Library

Program output:



Previous fileTop of DocumentContentsNo linkNext file

Copyright © Rogue Wave Software, Inc. All Rights Reserved.

The Rogue Wave name and logo, and SourcePro, are registered trademarks of Rogue Wave Software. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.