A Front Insertion Sequence is a Sequence where it is possible to insert an element at the beginning, or to access the first element, in amortized constant time. Front Insertion Sequences have special member functions as a shorthand for those operations.
- Refinement Of:
- Associated Types:
- None, except for those of Sequence.
A type that is a model of Front Insertion Sequence
Object of type
The value type of
Object of type
- Valid Expressions:
- In addition to the expressions defined in Sequence, the following expressions must be valid.
Name Expression Type requirements Return type Front
ais mutable, otherwise
- Expression Semantics:
Name Expression Precondition Semantics Postcondition Front
a.sizeis incremented by 1.
a.front()is a copy of
a.size()is decremented by 1.
- Complexity Guarantees:
- Front, push front, and pop front are amortized constant time. 
Symmetry of push and pop
pop_front()is a null operation.
- Type(s) Modeling this Concept:
 Front is actually defined in Sequence, since it is always possible to implement it in amortized constant time. Its definition is repeated here, along with push front and pop front, in the interest of clarity.
 This complexity guarantee is the only reason that
pop_front() are defined: they provide no additional functionality. Not every sequence must define these operations, but it is guaranteed that they are efficient if they exist at all.
- See Also:
- Container, Sequence, BackInsertionSequence,