+template <typename RHS, RHS rhs, typename LHS>
+bool less_than_impl(
+ typename std::enable_if<
+ (rhs <= std::numeric_limits<LHS>::max()
+ && rhs > std::numeric_limits<LHS>::min()),
+ LHS
+ >::type const lhs
+) {
+ return lhs < rhs;
+}
+
+template <typename RHS, RHS rhs, typename LHS>
+bool less_than_impl(
+ typename std::enable_if<
+ (rhs > std::numeric_limits<LHS>::max()),
+ LHS
+ >::type const
+) {
+ return true;
+}
+
+template <typename RHS, RHS rhs, typename LHS>
+bool less_than_impl(
+ typename std::enable_if<
+ (rhs <= std::numeric_limits<LHS>::min()),
+ LHS
+ >::type const
+) {
+ return false;
+}
+
+template <typename RHS, RHS rhs, typename LHS>
+bool greater_than_impl(
+ typename std::enable_if<
+ (rhs <= std::numeric_limits<LHS>::max()
+ && rhs >= std::numeric_limits<LHS>::min()),
+ LHS
+ >::type const lhs
+) {
+ return lhs > rhs;
+}
+
+template <typename RHS, RHS rhs, typename LHS>
+bool greater_than_impl(
+ typename std::enable_if<
+ (rhs > std::numeric_limits<LHS>::max()),
+ LHS
+ >::type const
+) {
+ return false;
+}
+
+template <typename RHS, RHS rhs, typename LHS>
+bool greater_than_impl(
+ typename std::enable_if<
+ (rhs < std::numeric_limits<LHS>::min()),
+ LHS
+ >::type const
+) {
+ return true;
+}
+