#ifndef __JLANG__JCOMPARISON__ #define __JLANG__JCOMPARISON__ /** * \author mdejong */ namespace JLANG {} namespace JPP { using namespace JLANG; } namespace JLANG { /** * Functional implementations of comparison operators. */ struct JComparison { /** * Equal. * * \param first first object * \param second second object * \return true if first object equal to second object; else false */ struct eq { template bool operator()(const T& first, const T& second) const { return first == second; } }; /** * Not equal. * * \param first first object * \param second second object * \return true if first object not equal to second object; else false */ struct ne { template bool operator()(const T& first, const T& second) const { return first != second; } }; /** * Less than. * * \param first first object * \param second second object * \return true if first object less than second object; else false */ struct lt { template bool operator()(const T& first, const T& second) const { return first < second; } }; /** * Greater than. * * \param first first object * \param second second object * \return true if first object greater than second object; else false */ struct gt { template bool operator()(const T& first, const T& second) const { return first > second; } }; /** * Less equals. * * \param first first object * \param second second object * \return true if first object less than or equal to second object; else false */ struct le { template bool operator()(const T& first, const T& second) const { return first <= second; } }; /** * Greater equals. * * \param first first object * \param second second object * \return true if first object greater than or equal to second object; else false */ struct ge { template bool operator()(const T& first, const T& second) const { return first >= second; } }; }; } #endif