Commit c5c3518a authored by Davis King's avatar Davis King

Made bigint use explicit relational operator functions rather than the overly

general templates in dlib::relational_operators.  I did this because the
templates in dlib::relational_operators sometimes cause clashes with other
code in irritating ways.
parent 61b6c1ff
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
namespace dlib namespace dlib
{ {
using namespace dlib::relational_operators; // defined in algs.h
class bigint_kernel_1 class bigint_kernel_1
{ {
...@@ -531,6 +530,10 @@ namespace dlib ...@@ -531,6 +530,10 @@ namespace dlib
} }
} }
inline bool operator> (const bigint_kernel_1& a, const bigint_kernel_1& b) { return b < a; }
inline bool operator!= (const bigint_kernel_1& a, const bigint_kernel_1& b) { return !(a == b); }
inline bool operator<= (const bigint_kernel_1& a, const bigint_kernel_1& b) { return !(b < a); }
inline bool operator>= (const bigint_kernel_1& a, const bigint_kernel_1& b) { return !(a < b); }
} }
#ifdef NO_MAKEFILE #ifdef NO_MAKEFILE
......
...@@ -15,8 +15,6 @@ ...@@ -15,8 +15,6 @@
namespace dlib namespace dlib
{ {
using namespace dlib::relational_operators; // defined in algs.h
class bigint_kernel_2 class bigint_kernel_2
{ {
/*! /*!
...@@ -557,6 +555,11 @@ namespace dlib ...@@ -557,6 +555,11 @@ namespace dlib
} }
} }
inline bool operator> (const bigint_kernel_2& a, const bigint_kernel_2& b) { return b < a; }
inline bool operator!= (const bigint_kernel_2& a, const bigint_kernel_2& b) { return !(a == b); }
inline bool operator<= (const bigint_kernel_2& a, const bigint_kernel_2& b) { return !(b < a); }
inline bool operator>= (const bigint_kernel_2& a, const bigint_kernel_2& b) { return !(a < b); }
} }
#ifdef NO_MAKEFILE #ifdef NO_MAKEFILE
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
namespace dlib namespace dlib
{ {
using namespace dlib::relational_operators; // defined in algs.h
class bigint class bigint
{ {
...@@ -661,6 +660,10 @@ namespace dlib ...@@ -661,6 +660,10 @@ namespace dlib
provides deserialization support provides deserialization support
!*/ !*/
inline bool operator> (const bigint& a, const bigint& b) { return b < a; }
inline bool operator!= (const bigint& a, const bigint& b) { return !(a == b); }
inline bool operator<= (const bigint& a, const bigint& b) { return !(b < a); }
inline bool operator>= (const bigint& a, const bigint& b) { return !(a < b); }
} }
#endif // DLIB_BIGINT_KERNEl_ABSTRACT_ #endif // DLIB_BIGINT_KERNEl_ABSTRACT_
......
...@@ -1122,6 +1122,17 @@ namespace dlib ...@@ -1122,6 +1122,17 @@ namespace dlib
return *this; return *this;
} }
// ----------------------------------------------------------------------------------------
template < typename bigint_base >
inline bool operator> (const bigint_kernel_c<bigint_base>& a, const bigint_kernel_c<bigint_base>& b) { return b < a; }
template < typename bigint_base >
inline bool operator!= (const bigint_kernel_c<bigint_base>& a, const bigint_kernel_c<bigint_base>& b) { return !(a == b); }
template < typename bigint_base >
inline bool operator<= (const bigint_kernel_c<bigint_base>& a, const bigint_kernel_c<bigint_base>& b) { return !(b < a); }
template < typename bigint_base >
inline bool operator>= (const bigint_kernel_c<bigint_base>& a, const bigint_kernel_c<bigint_base>& b) { return !(a < b); }
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment