Vector concept

Description

The Vector concept is intended to define a vector that can be used in linear-algebra operations.

Refinement of

VectorCollection, DefaultConstructible [1] and SizeConstructible.

Note that both Collection and SizeConstructible define a size() member and thus the Vector concept need to comply with both definitions.

Associated types

Notation

X Type that is a model of the Vector concept
a object of type X::value_type

Definitions

Valid expressions

In addition to those of Collection, DefaultConstructible and SizeConstructible:
Name Expression Type requirements Return type
Destructor a.~X() Although the destructor is already defined in Collection, an extra semantic is required here: all elements in the vector will be destroyed.

Expression semantics

Name Expression Preconditions Semantics Postconditions
Destructor a.~X() Destroys the vector and all its elements

Complexity guarantees

Invariants

Models

Notes

[1] Being DefaultConstructible makes it possible for instance to create an std::vector of vectors. The initial size of these vectors will be zero and thus are not very usable. Therefore vector's are also resizeable.