An additive magma is a magma equipped with the addition operator.
| Corresponding functor | glas::add_functor |
| S | type of a set |
| A | type of a set convertible to S |
| B | type of a set convertible to S |
| a | Object of type A |
| b | Object of type B |
| s | Object of type S |
| Name | Expression | Return type |
|---|---|---|
| Addition | a+b | add_functor<A,B>::result_type, convertible to S |
| AdditionAssignment | s+=b | S |
| Name | Expression | Precondition | Semantics | Postcondition |
|---|---|---|---|---|
| Addition | a+b | can actually be anything as long as it fulfills the requirements of the addition | ||
| AdditionAssignment | s+=b | equivalent to s=s+b |
| Closure | a+b returns an object that is convertible to an element of the set S |