NTLib - Number Theory Library 0.9
Loading...
Searching...
No Matches
concepts.cpp File Reference
module base

Module interface unit for module base, partition concepts. More...

#include <concepts>
Include dependency graph for concepts.cpp:

Classes

class  ntlib::algebra_traits< typename >
 Traits class for algebraic types. More...
class  ntlib::algebra_traits< T >
 Specialization of ntlib::algebra_traits for integral types. More...

Concepts

concept  ntlib::HasAdditiveNeutral
 Restricts to types with an additive neutral element.
concept  ntlib::HasMultiplicativeNeutral
 Restricts to types with a multiplicative neutral element.
concept  ntlib::AdditiveSemigroup
 Restricts to types modeling an additive semigroup.
concept  ntlib::MultiplicativeSemigroup
 Restricts to types modeling a multiplication semigroup.
concept  ntlib::AdditiveMonoid
 Restricts to types modeling an additive monoid.
concept  ntlib::MultiplicativeMonoid
 Restricts to types modeling a multiplicative monoid.
concept  ntlib::HasAdditiveInverses
concept  ntlib::HasMultiplicativeInverses
 Restricts to types with multiplicative inverse elements.
concept  ntlib::AdditiveGroup
 Restricts to types modeling an additive group.
concept  ntlib::MultiplicativeGroup
 Restricts to types modeling a multiplicative group.
concept  ntlib::IsAdditiveCommutative
 Restricts to types with a commutative addition operation.
concept  ntlib::IsMultiplicativeCommutative
 Restricts to types with a commutative multiplication operation.
concept  ntlib::AdditiveCommutativeGroup
 Restricts to types modeling an additive commutative group.
concept  ntlib::MultiplicativeCommutativeGroup
 Restricts to types modeling a multiplicative commutative group.
concept  ntlib::Ring
 Restricts to types modeling a ring.
concept  ntlib::CommutativeRing
 Restricts to types modeling a commutative ring.
concept  ntlib::Field
 Restricts to types modeling a field.
concept  ntlib::HasDivisionWithRemainder
 Restricts to types supporting division with remainder.
concept  ntlib::Integer
 Restricts to types modeling the integers.
concept  ntlib::HasAdditiveInverse
 Restricts to types with additive inverse elements.

Functions

template<typename T>
constexpr T ntlib::zero () noexcept
 Returns the additive neutral element of a given type.
template<typename T>
constexpr T ntlib::one () noexcept
 Returns the multiplicative neutral element of a given type.

Detailed Description

Module interface unit for module base, partition concepts.

Function Documentation

◆ one()

template<typename T>
T ntlib::one ( )
nodiscardconstexprexportnoexcept

Returns the multiplicative neutral element of a given type.

Template Parameters
TThe type. Must have a specialization of ntlib::algebra_traits with a static get_one method.
Returns
The multiplicative neutral element of type T.

◆ zero()

template<typename T>
T ntlib::zero ( )
nodiscardconstexprexportnoexcept

Returns the additive neutral element of a given type.

Template Parameters
TThe type. Must have a specialization of ntlib::algebra_traits with a static get_zero method.
Returns
The additive neutral element of type T.