MPL11
 All Classes Namespaces Files Typedefs Macros Groups Pages
Classes
Monoid

The Monoid typeclass is used for datatypes with an associative binary operation that has an identity. More...

Classes

struct  boost::mpl11::plus< x1, x2, xn >
 Associative operation on a Monoid. More...
 
struct  boost::mpl11::zero< Datatype >
 Additive identity for the given Datatype. More...
 

Detailed Description

The Monoid typeclass is used for datatypes with an associative binary operation that has an identity.

Instances of Monoid must satisfy the following laws:

plus zero x == x
plus x zero == x
plus x (plus y z) == plus (plus x y) z

The method names refer to the monoid of numbers under addition, but there are many other instances such as sequences under concatenation. Some datatypes can be viewed as a monoid in more than one way, e.g. both addition and multiplication on numbers.

Methods

plus and zero

Minimal complete definition

All the methods.