arithmeticOperatorsForType::Negate(struct) - HaxyM/crap GitHub Wiki
Defined in "crap/functional.d/arithmeticoperatorsfortype.h".
Defined in "crap/functional".
template <class Type>
struct arithmeticOperatorsForType
{
/*...*/
template <Type Value>
using Negate = negateValue<Type, Value>;
/*...*/
};Creates negateValue (see negateValue) acting on type Type. Allows for negateValue to act as unary value operator.
-
Value- value to be negated.
-
value- holds result of negation ofValue.
-
value_type- type of fieldvalue. May not beTypebut should be castable to this type.
-
constexpr operator value_type () const noexcept- casts whole object to itsvalue_typereturningvalue.
#include <crap/functional.d/arithmeticoperatorsfortype.h>
int main()
{
static_assert(crap :: arithmeticOperatorsForType <signed int> :: template Negate<-42>{} == 42, "Minus -42 should be 42");
return 0;
}