Сравнительные объекты-функции
Сравнительные объекты-функции поддерживают операции равенства, неравенства, больше, больше или равно, меньше, меньше или равно.
·
Равенство: equal_to<Type>
equal_to<string> stringEqual; sres = stringEqual( sval1, sval2 ); ires = count_if( svec.begin(), svec.end(), |
equal_to<string>(), sval1 );
· Неравенство: not_equal_to<Type>
not_equal_to<complex> complexNotEqual; cres = complexNotEqual( cval1, cval2 ); ires = count_if( svec.begin(), svec.end(), |
not_equal_to<string>(), sval1 );
· Больше: greater<Type>
greater<int> intGreater; ires = intGreater( ival1, ival2 ); ires = count_if( svec.begin(), svec.end(), |
greater<string>(), sval1 );
· Больше или равно: greater_equal<Type>
greater_equal<double> doubleGreaterEqual; dres = doubleGreaterEqual( dval1, dval2 ); ires = count_if( svec.begin(), svec.end(), |
greater_equal <string>(), sval1 );
· Меньше: less<Type>
less<Int> IntLess; Ires = IntLess( Ival1, Ival2 ); ires = count_if( svec.begin(), svec.end(), |
less<string>(), sval1 );
· Меньше или равно: less_equal<Type>
less_equal<int> intLessEqual; ires = intLessEqual( ival1, ival2 ); ires = count_if( svec.begin(), svec.end(), |
less_equal<string>(), sval1 );