X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=boost%2Fboost%2Foperators.hpp;h=b524cee381a327c469a9d37cd7a20d559b69be50;hb=c48091f33a773732fa6c789927e5833e44108d9d;hp=b3b1bd72a4679a817ad911eb2b86e665ca910e2d;hpb=9a2bf73e316d8850e9b58812e09feb1a832a8608;p=lyx.git diff --git a/boost/boost/operators.hpp b/boost/boost/operators.hpp index b3b1bd72a4..b524cee381 100644 --- a/boost/boost/operators.hpp +++ b/boost/boost/operators.hpp @@ -8,6 +8,11 @@ // See http://www.boost.org/libs/utility/operators.htm for documentation. // Revision History +// 16 Dec 10 Limit warning suppression for 4284 to older versions of VC++ +// (Matthew Bradbury, fixes #4432) +// 07 Aug 08 Added "euclidean" spelling. (Daniel Frey) +// 03 Apr 08 Make sure "convertible to bool" is sufficient +// for T::operator<, etc. (Daniel Frey) // 24 May 07 Changed empty_base to depend on T, see // http://svn.boost.org/trac/boost/ticket/979 // 21 Oct 02 Modified implementation of operators to allow compilers with a @@ -85,7 +90,7 @@ # pragma set woff 1234 #endif -#if defined(BOOST_MSVC) +#if BOOST_WORKAROUND(BOOST_MSVC, < 1600) # pragma warning( disable : 4284 ) // complaint about return type of #endif // operator-> not begin a UDT @@ -124,34 +129,34 @@ namespace boost template > struct less_than_comparable2 : B { - friend bool operator<=(const T& x, const U& y) { return !(x > y); } - friend bool operator>=(const T& x, const U& y) { return !(x < y); } + friend bool operator<=(const T& x, const U& y) { return !static_cast(x > y); } + friend bool operator>=(const T& x, const U& y) { return !static_cast(x < y); } friend bool operator>(const U& x, const T& y) { return y < x; } friend bool operator<(const U& x, const T& y) { return y > x; } - friend bool operator<=(const U& x, const T& y) { return !(y < x); } - friend bool operator>=(const U& x, const T& y) { return !(y > x); } + friend bool operator<=(const U& x, const T& y) { return !static_cast(y < x); } + friend bool operator>=(const U& x, const T& y) { return !static_cast(y > x); } }; template > struct less_than_comparable1 : B { friend bool operator>(const T& x, const T& y) { return y < x; } - friend bool operator<=(const T& x, const T& y) { return !(y < x); } - friend bool operator>=(const T& x, const T& y) { return !(x < y); } + friend bool operator<=(const T& x, const T& y) { return !static_cast(y < x); } + friend bool operator>=(const T& x, const T& y) { return !static_cast(x < y); } }; template > struct equality_comparable2 : B { friend bool operator==(const U& y, const T& x) { return x == y; } - friend bool operator!=(const U& y, const T& x) { return !(x == y); } - friend bool operator!=(const T& y, const U& x) { return !(y == x); } + friend bool operator!=(const U& y, const T& x) { return !static_cast(x == y); } + friend bool operator!=(const T& y, const U& x) { return !static_cast(y == x); } }; template > struct equality_comparable1 : B { - friend bool operator!=(const T& x, const T& y) { return !(x == y); } + friend bool operator!=(const T& x, const T& y) { return !static_cast(x == y); } }; // A macro which produces "name_2left" from "name". @@ -356,7 +361,7 @@ struct equivalent2 : B { friend bool operator==(const T& x, const U& y) { - return !(x < y) && !(x > y); + return !static_cast(x < y) && !static_cast(x > y); } }; @@ -365,7 +370,7 @@ struct equivalent1 : B { friend bool operator==(const T&x, const T&y) { - return !(x < y) && !(y < x); + return !static_cast(x < y) && !static_cast(y < x); } }; @@ -373,17 +378,17 @@ template > struct partially_ordered2 : B { friend bool operator<=(const T& x, const U& y) - { return (x < y) || (x == y); } + { return static_cast(x < y) || static_cast(x == y); } friend bool operator>=(const T& x, const U& y) - { return (x > y) || (x == y); } + { return static_cast(x > y) || static_cast(x == y); } friend bool operator>(const U& x, const T& y) { return y < x; } friend bool operator<(const U& x, const T& y) { return y > x; } friend bool operator<=(const U& x, const T& y) - { return (y > x) || (y == x); } + { return static_cast(y > x) || static_cast(y == x); } friend bool operator>=(const U& x, const T& y) - { return (y < x) || (y == x); } + { return static_cast(y < x) || static_cast(y == x); } }; template > @@ -392,9 +397,9 @@ struct partially_ordered1 : B friend bool operator>(const T& x, const T& y) { return y < x; } friend bool operator<=(const T& x, const T& y) - { return (x < y) || (x == y); } + { return static_cast(x < y) || static_cast(x == y); } friend bool operator>=(const T& x, const T& y) - { return (y < x) || (x == y); } + { return static_cast(y < x) || static_cast(x == y); } }; // Combined operator classes (contributed by Daryle Walker) ----------------// @@ -580,7 +585,35 @@ struct ordered_euclidian_ring_operators1 : totally_ordered1 > {}; - + +template > +struct euclidean_ring_operators2 + : ring_operators2 > > > > {}; + +template > +struct euclidean_ring_operators1 + : ring_operators1 > > {}; + +template > +struct ordered_euclidean_ring_operators2 + : totally_ordered2 > {}; + +template > +struct ordered_euclidean_ring_operators1 + : totally_ordered1 > {}; + template > struct input_iteratable : equality_comparable1