Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

Click here to view the latest version of this page.
PrevUpHomeNext

Size

Size

intervals

interval
sets

interval
maps

element
sets

element
maps

size_type T::size()const
size_type size(const T&)

O(1)

O(n)

O(n)

O(1)

O(1)

size_type cardinality(const T&)

O(1)

O(n)

O(n)

O(1)

O(1)

difference_type length(const T&)

O(1)

O(n)

O(n)

size_type iterative_size(const T&)

O(1)

O(1)

O(1)

O(1)

size_type interval_count(const T&)

O(1)

O(1)

For icl containers the single size function known from std containers branches into tree to five different members functions. The table above shows the types, size functions are implemented for, together with their complexities. Linear complexities O(n) refer to the container's iterative_size:

n = y.iterative_size()

The next table gives a short definition for the different size functions.

Size

Types

Description

size_type interval_count(const T&)

S M

The number of intervals of an interval container.

size_type iterative_size(const T&)

S M s m

The number of objects in an icl container that can be iterated over.

difference_type length(const T&)

i S M

The length of an interval or the sum of lengths of an interval container's intervals, that's domain_type has a difference_type.

size_type cardinality(const T&)

i S M s m

The number of elements of an interval or a container. For continuous data types cardinality can be infinite.

size_type T::size()const
size_type size(const T&)

i S M s m

The number of elements of an interval or a container, which is also it's cardinality.

Back to section . . .

Function Synopsis

Interface


PrevUpHomeNext