NTLib - Number Theory Library 0.9
Loading...
Searching...
No Matches
ntlib::algebra_traits< typename > Class Template Referenceexport
module base

Traits class for algebraic types. More...

Detailed Description

template<typename>
class ntlib::algebra_traits< typename >

Traits class for algebraic types.

This empty class is the primary template definition. Concepts defined by NTLib use this traits class to determine algebraic properties of types.

All algebraic types defined by NTLib specialize this class appropriately. To be able to use a user-defined type T with NTLib, you need to provide a specialization of ntlib::algebra_traits<T>.

A specialization must contain the following static member functions:

  • T get_zero(): Returns the additive neutral element.
  • T get_one(): Returns the multiplicative neutral element.

A specialization must contain the following static member constants:

  • bool is_additive_commutative: Whether the addition operation is commutative.
  • bool is_multiplicative_commutative: Whether the multiplication operation is commutative.

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