|
| | Cell ()=default |
| | Cell (const std::size_t aReserve) |
| | Creates an empty Cell with capacity for aReserve elements.
|
| | Cell (const std::size_t aSize, const T aInitializationValue) |
| | Cell (const std::initializer_list< T > &aInitList) |
| | Cell (const Cell< T > &other) |
| | Cell (Cell< T > &&other) noexcept |
| Cell< T > & | operator= (const Cell< T > &other) |
| Cell< T > & | operator= (Cell< T > &&other) noexcept |
| | ~Cell ()=default |
| T * | data () |
| | Returns a borrowed pointer into contiguous storage, possibly nullptr when the Cell is empty ( test size(), never data() ).
|
| const T * | data () const |
| std::vector< T > & | vector_data () |
| | The underlying vector.
|
| const std::vector< T > & | vector_data () const |
| auto | operator() (size_t aIndex) -> decltype(mCell[aIndex]) |
| auto | operator() (size_t aIndex) const -> decltype(mCell[aIndex]) |
| size_t | size () const |
| void | set_size (const size_t aSize) |
| | New elements are value-initialized ( zero for arithmetic T, nullptr for pointers ).
|
| void | set_size (const size_t aSize, const T &aValue) |
| auto | begin () -> decltype(mCell.begin()) |
| auto | end () -> decltype(mCell.end()) |
| auto | begin () const -> decltype(mCell.begin()) |
| auto | end () const -> decltype(mCell.end()) |
| void | clear () |
| | Empties the Cell.
|
| void | reserve (const size_t aSize) |
| void | push (const T &aValue) |
| void | push (T &&aValue) |
| template<typename... Args> |
| void | emplace (Args &&... args) |
| T | pop () |
| void | shrink_to_fit () |
| T & | first () |
| const T & | first () const |
| T & | last () |
| const T & | last () const |
| void | swap (Cell< T > &other) noexcept |
| | Swap contents with another Cell.
|
| bool | empty () const |
| size_t | capacity () const |
| auto | insert (typename std::vector< T >::const_iterator pos, const T &valuevalue) -> decltype(mCell.insert(pos, valuevalue)) |
| auto | insert (typename std::vector< T >::const_iterator pos, T &&valuevalue) -> decltype(mCell.insert(pos, std::move(valuevalue))) |
| auto | erase (typename std::vector< T >::const_iterator pos) -> decltype(mCell.erase(pos)) |
| auto | erase (typename std::vector< T >::const_iterator first, typename std::vector< T >::const_iterator last) -> decltype(mCell.erase(first, last)) |
| | Erase range of elements.
|
| void | print (const std::string aLabel="") const |
| void | print (const std::string aLabel) const |
template<typename T>
class belfem::Cell< T >
A bounds-checked wrapper around std::vector.
A Cell< T > owns its elements. A Cell< T* > stores pointers but does not own the pointees. Destruction, clear() and set_size() do not delete them. Copying a Cell< T* > copies the pointers. sort(), unique(), reverse() and append() are free functions.
- See also
- BELFEM Container Classes - Usage Guide