Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Concept O1SizeSequence

O1SizeSequence

Description

A O1SizeSequence is a Sequence for which the size of the sequence can be queried with O(1) complexity.

Refinement of

Associated types

  • size_type

    boost::sequence::traits::size_type<S>::type

    A type representing the size of the sequence.

  • index_type

    boost::sequence::traits::index_type<S>::type

    A type that can act as an index into the sequence. Because size_type may be a wrapper for a compile-time constant, e.g. mpl::integral_c<std::ptrdiff_t, N>, we need a distinct type in order to be able to count at runtime.

Notation

S
A type playing the role of sequence-type in the O1SizeSequence concept.
s
Object of type S
size
Object of type size_type
index
Object of type index_type

Valid expressions

Name Expression Type Semantics

Size

boost::sequence::size(s)

size_type

Returns the size of the sequence s.

Index convertability

boost::sequence::size(s)

Convertible to index_type

Returns the size of the sequence s.

Index equal-to comparison 1

size == index

Convertible to bool

Compares an index to a size for equality.

Index equal-to comparison 2

index == size

Convertible to bool

Compares an index to a size for equality.

Index not-equal-to comparison 1

size != index

Convertible to bool

Compares an index to a size for inequality.

Index not-equal-to comparison 2

index != size

Convertible to bool

Compares an index to a size for inequality.


PrevUpHomeNext