|
| | Vector ()=default |
| | Empty vector.
|
| |
| | Vector (const std::vector< T > &v) |
| | Copy the elements of a std::vector.
|
| |
| | Vector (std::vector< T > &&v) |
| | Take over the buffer of a std::vector without copying elements.
|
| |
| decltype(auto) | first () |
| | Reference to the first element (front()); the vector must not be empty.
|
| |
| decltype(auto) | first () const |
| | Read-only reference to the first element; the vector must not be empty.
|
| |
| decltype(auto) | last () |
| | Reference to the last element (back()); the vector must not be empty.
|
| |
| decltype(auto) | last () const |
| | Read-only reference to the last element; the vector must not be empty.
|
| |
| const T * | constData () const |
| | Read-only pointer to the contiguous elements (data()).
|
| |
| Vector | mid (std::ptrdiff_t at, std::ptrdiff_t count=-1) const |
| | Copy of a contiguous run of elements.
|
| |
| void | prepend (const T &v) |
| | Insert a copy of v before the first element; linear in size().
|
| |
| void | append (const Vector &v) |
| | Append copies of all elements of v.
|
| |
| void | append (const T &v) |
| | Append a copy of v (push_back).
|
| |
| void | append (T &&v) |
| | Append v by move (push_back).
|
| |
| Vector & | operator+= (const Vector &v) |
| | Append copies of all elements of v; same as append(const Vector &).
|
| |
| Vector & | operator<< (const T &v) |
| | Append one element.
|
| |
| std::ptrdiff_t | size () const noexcept |
| | Number of elements as a signed std::ptrdiff_t.
|
| |
| bool | isEmpty () const |
| | True when the vector holds no elements.
|
| |
| T | takeLast () |
| | Remove the last element and return it by move; the vector must not be empty.
|
| |
| T | takeFirst () |
| | Remove the first element and return it by move; linear in size().
|
| |
| void | removeLast () |
| | Remove the last element (pop_back); the vector must not be empty.
|
| |
| void | removeAt (int at) |
| | Erase one element; the elements after it shift down by one.
|
| |
| void | fill (const T &v) |
| | Assign v to every existing element; the size is unchanged.
|
| |
| void | fill (const T &v, std::size_t size) |
| | Replace the contents with size copies of v (assign()).
|
| |
| bool | contains (const T &v) const |
| | Linear search with operator==.
|
| |
template<class T>
class meshkit::plan::Vector< T >
std::vector<T> with the QVector-style member names the CDT kernel and plan model use.
Lets the same kernel code compile against StandardStorage and against QVector in the Qt storage. Storage, iterator and reference invalidation are those of std::vector, and there is no internal synchronization. size() hides std::vector::size() and returns a signed count. The element helpers (first(), last(), takeFirst(), takeLast(), removeLast(), removeAt()) keep std::vector's preconditions: they do not check for an empty vector or an out-of-range index.
- Template Parameters
-