Expression concept
Description
Expressions contain readonly data originating from a sequence of
glas-operators acting on (glas-)operands. Any glas-operand (without
any operator) can also be interpreted as being an expression.
An expression is some form of transformation of its argument(s).
In general, this transformation is not an invertible function and thus
is it not clear how writing into an expression would alter the contents
of its arguments.
Therefore, an expression is read-only.
Refinement of
EqualityComparable
Associated types
Notation
X |
Type that is a model of Expression |
a,b |
Objects of type X |
Definitions
Valid expressions
Name |
Expression |
Type requirements |
Return type |
Concept type |
concept<X>::type |
|
|
SizeType |
size<X>::type |
|
ValueType |
value<X>::type |
|
Size |
size(a) |
|
size<X>::type |
Copy constructor [1] |
X a(b) |
|
X& |
Destructor |
a.~X() |
|
|
Expression semantics
Name |
Expression |
Precondition |
Semantics |
Postcondition |
Concept type |
concept<X>::type |
|
Returns the concept of the expression |
|
SizeType |
size<X>::type |
|
Returns a type that unambiguously can express the size of the expression |
ValueType |
value<X>::type |
|
Returns the type of the elements in the expression |
Size |
size(a) |
|
Returns the size of the expression |
Copy constructor |
X a(b) |
|
Makes a copy of the expression |
|
Destructor |
|
|
|
Complexity guarantees
Invariants
Models
Notes
[1]Although an expression has a
copy-operator, an expression has no assignment operator. The reason
is that the expression is by definition a read-only structure (e.g.
its members are const references) and thus can not be assigned to.
Thus the expression concept is not a refinement of the Assignable
concept.