Mundy: Multibody Nonlocal Dynamics Version of the Day
Loading...
Searching...
No Matches
mundy::ValidScalarType Concept Reference

Concept satisfied by any type that is a mathematical scalar. It is a single value closed under +, -, *, /, unary - and constructible from a numeric literal.

#include <NumTraits.hpp>

Concept definition

template<typename T>
concept ValidScalarType = requires(T a, T b) {
{ a + b } -> std::convertible_to<T>;
{ a - b } -> std::convertible_to<T>;
{ a * b } -> std::convertible_to<T>;
{ a / b } -> std::convertible_to<T>;
{ -a } -> std::convertible_to<T>;
{ T(static_cast<typename NumTraits<T>::Literal>(1.0)) } -> std::convertible_to<T>;
}
Concept satisfied by any type that is a mathematical scalar. It is a single value closed under +,...
Definition NumTraits.hpp:165
T Literal
The type of a numeric literal paired with a value of type T.
Definition NumTraits.hpp:58