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

front_extended_deque

Description

front_extended_deque allows a deque to be front extended. It shares the same properties as the deque.

Header
See deque
Synopsis
template <typename Deque, typename T>
struct front_extended_deque;
Template parameters

Parameter

Description

Default

Deque

Deque type

T

Element type

Model of

Notation

D

A front_extended_deque type

e

Heterogeneous value

N

An MPL Integral Constant

Expression Semantics

Semantics of an expression is defined only where it differs from, or is not defined in Bidirectional Sequence.

Expression

Semantics

D(d, e)

Extend d prepending e to its front.

at<N>(d)

The Nth element from the beginning of the sequence; see at.

Example
typedef deque<int, float> initial_deque;
initial_deque d(12, 5.5f);
front_extended_deque<initial_deque, int> d2(d, 999);
std::cout << at_c<0>(d2) << std::endl;
std::cout << at_c<1>(d2) << std::endl;
std::cout << at_c<2>(d2) << std::endl;

PrevUpHomeNext