Regina 7.4 Calculation Engine
regina::RingTraits< T > Struct Template Reference

A helper class that instructs Regina how to do mathematical operations with objects from any ring type T. More...

Detailed Description

template<typename T>
struct regina::RingTraits< T >

A helper class that instructs Regina how to do mathematical operations with objects from any ring type T.

Before specialising RingTraits<T>, you should ensure that T satisfies the following requirements:

  • T has a default constructor (which is allowed to leave the object uninitialised);
  • T has a copy constructor, an assignment operator, and equality/inequality tests;
  • T supports the binary operators +, - and *, and unary operators +=, -= and *=.

The type RingTraits<T> should then provide:

  • class constants zero and one, which are objects of type T that hold the additive and multiplicative identities respectively.

Regina specialises RingTraits for its own ring-like classes where this makes sense (e.g., Regina's own integer, rational and polynomial classes), and also provides implementations for native C++ signed integer and floating point types.

Python
Not present.

The documentation for this struct was generated from the following file: