Complete Traversals and their Implementation Using the Standard Template Library

A complete traversal of a container C (such as a set) is informally described by the iteration scheme for x in C F(x,C) where F is a function that might possibly modify C by inserting new elements into it. We assume that the order in which the elements are treated is not relevant, as long as the ite...

Full description

Bibliographic Details
Main Authors: Eric Gamess, David R. Musser, Arturo J. Sanchez Ruiz
Format: Article
Language:English
Published: Centro Latinoamericano de Estudios en Informática 1998-12-01
Series:CLEI Electronic Journal
Online Access:http://clei.org/cleiej-beta/index.php/cleiej/article/view/378
Description
Summary:A complete traversal of a container C (such as a set) is informally described by the iteration scheme for x in C F(x,C) where F is a function that might possibly modify C by inserting new elements into it. We assume that the order in which the elements are treated is not relevant, as long as the iteration continues until F has been applied to all elements currently in C, including those F has inserted. Standard iteration mechanisms, such as the iterators provided in the C++ Standard Template Library (STL), do not directly support complete traversals. In this paper we present two approaches to complete traversals, both extending the STL framework, one by means of generic algorithms and the other by means of a container adaptor.
ISSN:0717-5000