Simple-Utility v2.3.1
Loading...
Searching...
No Matches
arithmetic

Contains functional objects, implementing several arithmetically operations. More...

Collaboration diagram for arithmetic:

Variables

constexpr auto sl::functional::arithmetic::plus
 Functional object which forwards the params to binary operator + and returns the result.
 
constexpr auto sl::functional::arithmetic::minus
 Functional object which forwards the params to binary operator - and returns the result.
 
constexpr auto sl::functional::arithmetic::multiplies
 Functional object which forwards the params to binary operator * and returns the result.
 
constexpr auto sl::functional::arithmetic::divides
 Functional object which forwards the params to binary operator / and returns the result.
 
constexpr auto sl::functional::arithmetic::modulus
 Functional object which forwards the params to binary operator % and returns the result.
 
constexpr auto sl::functional::arithmetic::negate
 Functional object which forwards the param to unary operator - and returns the result.
 

Detailed Description

Contains functional objects, implementing several arithmetically operations.

Variable Documentation

◆ divides

constexpr auto sl::functional::arithmetic::divides
inlineconstexpr
Initial value:
= envelop<Transform>(
[]<class TLhs, class TRhs>(TLhs&& lhs, TRhs&& rhs) -> decltype(std::forward<TLhs>(lhs) / std::forward<TRhs>(rhs))
{
static_assert(concepts::divides_with<TLhs, TRhs>, "Arguments are not usable as operands of binary operator /.");
return std::forward<TLhs>(lhs) / std::forward<TRhs>(rhs);
})
Determines whether two types can be used in operator / expressions.
Definition: operators.hpp:1067

Functional object which forwards the params to binary operator / and returns the result.

◆ minus

constexpr auto sl::functional::arithmetic::minus
inlineconstexpr
Initial value:
= envelop<Transform>(
[]<class TLhs, class TRhs>(TLhs&& lhs, TRhs&& rhs) -> decltype(std::forward<TLhs>(lhs) - std::forward<TRhs>(rhs))
{
static_assert(concepts::minus_with<TLhs, TRhs>, "Arguments are not usable as operands of binary operator -.");
return std::forward<TLhs>(lhs) - std::forward<TRhs>(rhs);
})
Determines whether two types can be used in operator - expressions.
Definition: operators.hpp:907

Functional object which forwards the params to binary operator - and returns the result.

◆ modulus

constexpr auto sl::functional::arithmetic::modulus
inlineconstexpr
Initial value:
= envelop<Transform>(
[]<class TLhs, class TRhs>(TLhs&& lhs, TRhs&& rhs) -> decltype(std::forward<TLhs>(lhs) % std::forward<TRhs>(rhs))
{
static_assert(concepts::modulus_with<TLhs, TRhs>, "Arguments are not usable as operands of binary operator %.");
return std::forward<TLhs>(lhs) % std::forward<TRhs>(rhs);
})
Determines whether two types can be used in operator % expressions.
Definition: operators.hpp:1147

Functional object which forwards the params to binary operator % and returns the result.

◆ multiplies

constexpr auto sl::functional::arithmetic::multiplies
inlineconstexpr
Initial value:
= envelop<Transform>(
[]<class TLhs, class TRhs>(TLhs&& lhs, TRhs&& rhs) -> decltype(std::forward<TLhs>(lhs) * std::forward<TRhs>(rhs))
{
static_assert(concepts::multiplies_with<TLhs, TRhs>, "Arguments are not usable as operands of binary operator *.");
return std::forward<TLhs>(lhs) * std::forward<TRhs>(rhs);
})
Determines whether two types can be used in operator * expressions.
Definition: operators.hpp:987

Functional object which forwards the params to binary operator * and returns the result.

◆ negate

constexpr auto sl::functional::arithmetic::negate
inlineconstexpr
Initial value:
= envelop<Transform>(
[]<class T>(T&& value) -> decltype(-std::forward<T>(value))
{
static_assert(concepts::negate<T>, "Argument is not usable as operand of unary operator -.");
return -std::forward<T>(value);
})
Determines whether a type can be used in operator - expression.
Definition: operators.hpp:804
Checks whether the given template type is usable as value type for unique_handle types.
Definition: unique_handle.hpp:161

Functional object which forwards the param to unary operator - and returns the result.

◆ plus

constexpr auto sl::functional::arithmetic::plus
inlineconstexpr
Initial value:
= envelop<Transform>(
[]<class TLhs, class TRhs>(TLhs&& lhs, TRhs&& rhs) -> decltype(std::forward<TLhs>(lhs) + std::forward<TRhs>(rhs))
{
static_assert(concepts::plus_with<TLhs, TRhs>, "Arguments are not usable as operands of binary operator +.");
return std::forward<TLhs>(lhs) + std::forward<TRhs>(rhs);
})
Determines whether two types can be used in operator + expressions.
Definition: operators.hpp:827

Functional object which forwards the params to binary operator + and returns the result.