
A Buffer is something in which items can be put and removed. The Buffer concept has very few requirements. It does not require any particular ordering of how the items are stored or in what order they will appear when removed, however, there is typically some sort of ordering policy.
For a type to model the Buffer concept it must have the following members.
| Member | Description |
|---|---|
| value_type | The type of object stored in the Buffer. The value type must be Assignable. |
| size_type | An unsigned integral type for representing the number of objects in the Buffer. |
| void push(const T& t) | Inserts t into the Buffer. size() will be incremented by one. |
| void pop() | Removes an object from the Buffer. size() will be decremented by one. Precondition: empty() is false. |
| T& top() | Returns a mutable reference to some object in the Buffer. Precondition: empty() is false. |
| const T& top() const | Returns a const reference to some object in the Buffer. Precondition: empty() is false. |
| void size() const | Returns the number of objects in the Buffer. Invariant: size() >= 0. |
| bool empty() const | Equivalent to b.size() == 0. |
| Copyright © 2004 | Jeremy Siek, Univ. of Notre Dame (jsiek@lsc.nd.edu) |
Use, modification, and distribution are subject to the Boost Software License, Version 1.0 at http://www.boost.org/LICENSE_1_0.txt