NTLib - Number Theory Library 0.9
Loading...
Searching...
No Matches
ntlib::HasAdditiveNeutral Concept Referenceexport
module base

Restricts to types with an additive neutral element. More...

Concept definition

template<typename T>
concept HasAdditiveNeutral = requires(T n) {
// Existence.
{ ntlib::zero<T>() } -> std::convertible_to<T>;
}
Restricts to types with an additive neutral element.
Definition concepts.cpp:110
constexpr T zero() noexcept
Returns the additive neutral element of a given type.
Definition concepts.cpp:79

Detailed Description

Restricts to types with an additive neutral element.

Note
The least restrictive (additive) concept in NTLib requiring an additive neutral element is AdditiveMonoid. Therefore, the following can be assumed to hold:
  • The addtive neutral element is unique.
  • The unique additive neutral element is left- and right-neutral.
Template Parameters
TA set with an inner addition operation.