...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
A valid scalar type S must have accessible destructor, default constructor, copy constructor and assignment operator, and must support the following operations:
S operator*( S, S ); S operator/( S, S ); S operator+( S, S ); S operator-( S, S ); S & operator*=( S &, S ); S & operator/=( S &, S ); S & operator+=( S &, S ); S & operator-=( S &, S ); bool operator==( S, S ); bool operator!=( S, S );
In addition, the expression S(0) should construct a scalar of value zero, and S(1) should construct a scalar of value one -or- the scalar_traits template must be specialized appropriately.