arithmeticOperatorsForType::negate - HaxyM/crap GitHub Wiki

crap :: arithmeticOperatorsForType :: negate

Defined in "crap/functional.d/arithmeticoperatorsfortype.h".
Defined in "crap/functional".


template <class Type>
struct arithmeticOperatorsForType
{
 /*...*/
 template <Type Value>
 constexpr const static auto negate = negateValue <Type, Value> :: value;
 /*...*/
};

Member constant of arithmeticOperatorsForType. Stores value of negateValue (see negateValue) acting on type Type. Requires C++14 or higher language version.

Template parameters

  • Value1 - value to be negated.

Usage example

#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;
}

See also

⚠️ **GitHub.com Fallback** ⚠️