Containers library

MPL Easy containers library is a generic collection of class templates and algorithms. Programmers can easily implement common data structures like queues, lists, and stacks.

There are five types of containers -- Array, LinkedList, HashTable, BitSet, RedBlackTree -- each of which is designed to support a different set of operations.

A container manages storage space that is allocated for its elements and provides member functions to access them, either directly or through iterators (objects with properties similar to pointers).

Every container can contain values of different types, and there is no need to specify value types when constructing a container.

Most containers have at least several member functions in common and share their functionalities. Selecting the best container for a particular application should be not only based on the functionality offered by different containers but should also take their efficiency under different workloads into account.

Containers

Array is the most effective container providing quick access to every element by index.

LinkedList is a container capable of inserting or deleting an element at any position very fast but providing only sequential access to its elements.

HashTable is a container providing access to every element by its key. Sequential access is also available by using iterators.

BitSet is a container with reduced functionality that efficiently stores integers within a specified range.

RedBlackTree allows to access every element by its key. Elements are always sorted in ascending order, so the elements that are greater or less than some bound value can be selected quickly.

All keys in a RedBlackTree must be comparable with each other by

<
and
>
operators.

Supporting concepts

Iterator is a pointer to an element of a container. The value of an element can be obtained or set using the iterator. An iterator can be moved to the previous or the next element of a container.

Range is a pointer to a pointer to several consecutive elements. A range can be used to enumerate elements directly or using iterators or to construct another container from it.