Data Structures, Containers, Iterators, and Algorithms


Boost.Any

The Any library supports typesafe storage and retrieval of values of any type. When the need for a variant type arises, there are three possible solutions:

  • Indiscriminate types, such as void*. This solution can almost never be made typesafe; avoid it like the plague.

  • Variant typesthat is, types that support the storage and retrieval of a set of types.

  • Types that support conversions, such as between string types and integral types.

Any implements the second solutiona value-based variant type, with an unbounded set of possible types. The library is often used for storing heterogeneous types in Standard Library containers. Read more in "Library 6: Any."

The author of Any is Kevlin Henney.

Boost.Array

This library is a wrapper around ordinary C-style arrays, augmenting them with the functions and typedefs from the Standard Library containers. In effect, this makes it possible to treat ordinary arrays as Standard Library containers. This is useful because it adds safety without impeding efficiency and it enables uniform syntax for Standard Library containers and ordinary arrays. The latter means that it enables the use of ordinary arrays with most functions that require a container type to operate on. Array is typically used when performance issues mandate that ordinary arrays be used rather than std::vector.

The author of Array is Nicolai Josuttis, who built the library upon ideas brought forth by Matt Austern and Bjarne Stroustrup.

Boost.Compressed_pair

This library consists of a single parameterized type, compressed_pair, which is very similar to the Standard Library's std::pair. The difference from std::pair is that boost::compressed_pair evaluates the template arguments to see if one of them is empty and, if so, uses the empty base optimization to compress the size of the pair.

Boost.Compressed_pair is used for storing a pair, where one or both of the types is possibly empty.

The authors of Compressed_pair are Steve Cleary, Beman Dawes, Howard Hinnant, and John Maddock.

Boost.Dynamic_bitset

The Dynamic_bitset library very closely resembles std::bitset, except that whereas std::bitset is parameterized on the number of bits (that is, the size of the container), boost::dynamic_bitset supports runtime size configuration. Although dynamic_bitset supports the same interface as std::bitset, it adds functions that support runtime-specific functionality and some that aren't available in std::bitset. The library is typically used instead of std::bitset, in scenarios where the size of the bitset isn't necessarily known at compile time, or may change during program execution.

The authors of Dynamic_bitset are Jeremy Siek and Chuck Allison.

Boost.Graph

Graph is a library for processing graph structures, using a design heavily influenced by the STL. It is generic and highly configurable, and includes different data structures: adjacency lists, adjacency matrices, and edge lists. Graph also provides a large number of graph algorithms, such as Dijsktra's shortest path, Kruskal's minimum spanning tree, topological sort, and many more.

The authors of Graph are Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine.

Boost.Iterator

This library provides a framework for creating new iterator types, and it also offers a number of useful iterator adaptors beyond those defined by the C++ Standard. Creating new iterator types that conform to the standard is a difficult and tedious task. Iterator simplifies that task by automating most of the details, such as providing the required typedefs. Iterator also makes it possible to adapt an existing iterator type to give it new behavior. For example, the indirect iterator adaptor applies an extra dereferencing operation, making it possible to treat a container of pointers (or smart pointers) to a type as if it contained objects of that type.

The authors of Iterator are Jeremy Siek, David Abrahams, and Thomas Witt.

Boost.MultiArray

MultiArray provides a multidimensional container that closely resembles the Standard Library containers and is more effective, efficient, and straightforward than vectors of vectors. The dimensions of the container are set at declaration time, but there is support for slicing and projecting different views, and also runtime resizing of the dimensions.

The author of MultiArray is Ronald Garcia.

Boost.Multi-index

Multi-index offers multiple indices into an underlying container. This means that it is possible to have different sorting orders and different access semantics for one underlying container. Boost.Multi-index is used when std::set and std::map isn't enough, often due to the need of maintaining multiple indices for efficient element retrieval.

The author of Multi-index is Joaquín M López Muñoz.

Boost.Range

This library is a collection of concepts and utilities for ranges. Rather than having algorithms be specified in terms of pairs of iterators for denoting ranges, using ranges greatly simplifies the use of algorithms and raises the abstraction level of user code.

The author of Range is Thorsten Ottosen.

Boost.Tuple

Pairs are available in Standard C++ (from the class template std::pair), but there is currently no support for n-tuples. Enter Tuple. Unlike when using structs or classes for defining n-tuples, the class template tuple supports direct declaration and use as function return type or argument, and provides a generic way of accessing the tuple's elements. See "Library 8: Tuple 8" for the details of this great library. Tuple has been accepted for the upcoming Library Technical Report.

The author of Tuple is Jaakko Järvi.

Boost.Variant

The Variant library contains a generic discriminated union class for storing and manipulating an object from a set of heterogeneous types. A unique feature of the library is the support for type-safe visitation, which alleviates the common problem of type-switching code for variant data types.

The authors of Variant are Eric Friedman and Itay Maman.



    Beyond the C++ Standard Library(c) An Introduction to Boost
    Beyond the C++ Standard Library: An Introduction to Boost
    ISBN: 0321133544
    EAN: 2147483647
    Year: 2006
    Pages: 125

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net