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

Front Page / Sequences / Concepts / Integral Sequence Wrapper

Integral Sequence Wrapper

Description

An Integral Sequence Wrapper is a class template that provides a concise interface for creating a corresponding sequence of Integral Constants. In particular, assuming that seq is a name of the wrapper's underlying sequence and c1,c2,... cn are integral constants of an integral type T to be stored in the sequence, the wrapper provides us with the following notation:

seq_c<T,c1,c2,... cn>

If seq is a Variadic Sequence, numbered wrapper forms are also avaialable:

seqn_c<T,c1,c2,... cn>

Expression requirements

In the following table and subsequent specifications, seq is a placeholder token for the Integral Sequence Wrapper's underlying sequence's name.

Expression Type Complexity
seq_c<T,c1,c2,... cn> Forward Sequence Amortized constant time.
seq_c<T,c1,c2,... cn>::type Forward Sequence Amortized constant time.
seq_c<T,c1,c2,... cn>::value_type An integral type Amortized constant time.
seqn_c<T,c1,c2,... cn> Forward Sequence Amortized constant time.
seqn_c<T,c1,c2,... cn>::type Forward Sequence Amortized constant time.
seqn_c<T,c1,c2,... cn>::value_type An integral type Amortized constant time.

Expression semantics

typedef seq_c<T,c1,c2,... cn> s;
typedef seqn_c<T,c1,c2,... cn> s;
Semantics:s is a sequence seq of integral constant wrappers integral_c<T,c1>, integral_c<T,c2>, ... integral_c<T,cn>.
Postcondition:size<s>::value == n.
typedef seq_c<T,c1,c2,... cn>::type s;
typedef seqn_c<T,c1,c2,... cn>::type s;
Semantics:s is identical to seqn<integral_c<T,c1>,integral_c<T,c2>, ... integral_c<T,cn> >.
typedef seq_c<T,c1,c2,... cn>::value_type t;
typedef seqn_c<T,c1,c2,... cn>::value_type t;
Semantics:is_same<t,T>::value == true.

Models

See also

Sequences, Variadic Sequence, Integral Constant