-
Notifications
You must be signed in to change notification settings - Fork 2
greaterEqualValue
Igor Zarzycki edited this page Jan 22, 2022
·
3 revisions
Defined in "crap/functional.d/greaterequalvalue.h".
Defined in "crap/functional".
template <class Type, Type Value1, Type Value2> struct greaterEqualValue;
Compares if Value1
is greater than or equal to Value2
. Both values of type Type
.
-
Type
- type of values to be compared. -
Value1
- value to be compared greater or equal againstValue2
. -
Value2
- value with whichValue1
is compared.
value
- holds result of operation. True if Value1
is greater than or equal to Value2
. False otherwise.
value_type
- type of field value
. May not be bool
but should be castable to this type.
constexpr operator value_type () const noexcept
- casts whole object to its value_type
returning value
.
#include <crap/functional.d/greaterequalvalue.h>
int main()
{
static_assert(crap :: greaterEqualValue<unsigned int, 101u, 42u>{}, "101 should be greater than or equal to 42");
static_assert(crap :: greaterEqualValue<unsigned int, 42u, 42u>{}, "42 should be greater than or equal to 42");
return 0;
}