Skip to content

notEqualToValue

Igor Zarzycki edited this page Jan 23, 2022 · 2 revisions

crap :: notEqualToValue

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


template <class Type, Type Value1, Type Value2> struct notEqualToValue;


Compares if Value1 is unequal to Value2. Both values of type Type.

Template parameters

  • Type - type of values to be compared.
  • Value1 - value to be compared unequal against Value2.
  • Value2 - value with which Value1 is compared.

Layout

Member constants

value - holds result of operation. True if Value1 is unequal to Value2. False otherwise.

Member types

value_type - type of field value. May not be bool but should be castable to this type.

Member functions

constexpr operator value_type () const noexcept - casts whole object to its value_type returning value.

Usage example

#include <crap/functional.d/notequaltovalue.h>

int main()
{
 static_assert(crap :: notEqualToValue<unsigned int, 42u, 101u>{}, "42 should be unequal to 101");
 static_assert(crap :: notEqualToValue<unsigned int, 101u, 42u>{}, "101 should be unequal to 42");
 return 0;
}

See also

Clone this wiki locally