From 5da340a2a41a2bf79dda27634b6a69dcc4dfa4c9 Mon Sep 17 00:00:00 2001 From: Glen Fernandes Date: Sun, 12 Apr 2020 12:55:21 -0400 Subject: [PATCH] Rename BOOST_OPS_CONSTEXPR to BOOST_OPERATORS_CONSTEXPR --- include/boost/operators.hpp | 56 +++++++++++++++---------------- test/operators_constexpr_test.cpp | 6 ++-- 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/include/boost/operators.hpp b/include/boost/operators.hpp index aca5ea8..6b3b028 100644 --- a/include/boost/operators.hpp +++ b/include/boost/operators.hpp @@ -109,15 +109,15 @@ # pragma warning( disable : 4284 ) // complaint about return type of #endif // operator-> not begin a UDT -// Define BOOST_OPS_CONSTEXPR to be like BOOST_CONSTEXPR but empty under MSVC < v19.22 +// Define BOOST_OPERATORS_CONSTEXPR to be like BOOST_CONSTEXPR but empty under MSVC < v19.22 #ifdef BOOST_MSVC #if BOOST_MSVC_FULL_VER >= 192200000 -#define BOOST_OPS_CONSTEXPR constexpr +#define BOOST_OPERATORS_CONSTEXPR constexpr #else -#define BOOST_OPS_CONSTEXPR +#define BOOST_OPERATORS_CONSTEXPR #endif #else -#define BOOST_OPS_CONSTEXPR BOOST_CONSTEXPR +#define BOOST_OPERATORS_CONSTEXPR BOOST_CONSTEXPR #endif // In this section we supply the xxxx1 and xxxx2 forms of the operator @@ -143,34 +143,34 @@ template class empty_base {}; template > struct less_than_comparable2 : B { - friend BOOST_OPS_CONSTEXPR bool operator<=(const T& x, const U& y) { return !static_cast(x > y); } - friend BOOST_OPS_CONSTEXPR bool operator>=(const T& x, const U& y) { return !static_cast(x < y); } - friend BOOST_OPS_CONSTEXPR bool operator>(const U& x, const T& y) { return y < x; } - friend BOOST_OPS_CONSTEXPR bool operator<(const U& x, const T& y) { return y > x; } - friend BOOST_OPS_CONSTEXPR bool operator<=(const U& x, const T& y) { return !static_cast(y < x); } - friend BOOST_OPS_CONSTEXPR bool operator>=(const U& x, const T& y) { return !static_cast(y > x); } + friend BOOST_OPERATORS_CONSTEXPR bool operator<=(const T& x, const U& y) { return !static_cast(x > y); } + friend BOOST_OPERATORS_CONSTEXPR bool operator>=(const T& x, const U& y) { return !static_cast(x < y); } + friend BOOST_OPERATORS_CONSTEXPR bool operator>(const U& x, const T& y) { return y < x; } + friend BOOST_OPERATORS_CONSTEXPR bool operator<(const U& x, const T& y) { return y > x; } + friend BOOST_OPERATORS_CONSTEXPR bool operator<=(const U& x, const T& y) { return !static_cast(y < x); } + friend BOOST_OPERATORS_CONSTEXPR bool operator>=(const U& x, const T& y) { return !static_cast(y > x); } }; template > struct less_than_comparable1 : B { - friend BOOST_OPS_CONSTEXPR bool operator>(const T& x, const T& y) { return y < x; } - friend BOOST_OPS_CONSTEXPR bool operator<=(const T& x, const T& y) { return !static_cast(y < x); } - friend BOOST_OPS_CONSTEXPR bool operator>=(const T& x, const T& y) { return !static_cast(x < y); } + friend BOOST_OPERATORS_CONSTEXPR bool operator>(const T& x, const T& y) { return y < x; } + friend BOOST_OPERATORS_CONSTEXPR bool operator<=(const T& x, const T& y) { return !static_cast(y < x); } + friend BOOST_OPERATORS_CONSTEXPR bool operator>=(const T& x, const T& y) { return !static_cast(x < y); } }; template > struct equality_comparable2 : B { - friend BOOST_OPS_CONSTEXPR bool operator==(const U& y, const T& x) { return x == y; } - friend BOOST_OPS_CONSTEXPR bool operator!=(const U& y, const T& x) { return !static_cast(x == y); } - friend BOOST_OPS_CONSTEXPR bool operator!=(const T& y, const U& x) { return !static_cast(y == x); } + friend BOOST_OPERATORS_CONSTEXPR bool operator==(const U& y, const T& x) { return x == y; } + friend BOOST_OPERATORS_CONSTEXPR bool operator!=(const U& y, const T& x) { return !static_cast(x == y); } + friend BOOST_OPERATORS_CONSTEXPR bool operator!=(const T& y, const U& x) { return !static_cast(y == x); } }; template > struct equality_comparable1 : B { - friend BOOST_OPS_CONSTEXPR bool operator!=(const T& x, const T& y) { return !static_cast(x == y); } + friend BOOST_OPERATORS_CONSTEXPR bool operator!=(const T& x, const T& y) { return !static_cast(x == y); } }; // A macro which produces "name_2left" from "name". @@ -373,7 +373,7 @@ BOOST_BINARY_OPERATOR( right_shiftable, >> ) template > struct equivalent2 : B { - friend BOOST_OPS_CONSTEXPR bool operator==(const T& x, const U& y) + friend BOOST_OPERATORS_CONSTEXPR bool operator==(const T& x, const U& y) { return !static_cast(x < y) && !static_cast(x > y); } @@ -382,7 +382,7 @@ struct equivalent2 : B template > struct equivalent1 : B { - friend BOOST_OPS_CONSTEXPR bool operator==(const T&x, const T&y) + friend BOOST_OPERATORS_CONSTEXPR bool operator==(const T&x, const T&y) { return !static_cast(x < y) && !static_cast(y < x); } @@ -391,28 +391,28 @@ struct equivalent1 : B template > struct partially_ordered2 : B { - friend BOOST_OPS_CONSTEXPR bool operator<=(const T& x, const U& y) + friend BOOST_OPERATORS_CONSTEXPR bool operator<=(const T& x, const U& y) { return static_cast(x < y) || static_cast(x == y); } - friend BOOST_OPS_CONSTEXPR bool operator>=(const T& x, const U& y) + friend BOOST_OPERATORS_CONSTEXPR bool operator>=(const T& x, const U& y) { return static_cast(x > y) || static_cast(x == y); } - friend BOOST_OPS_CONSTEXPR bool operator>(const U& x, const T& y) + friend BOOST_OPERATORS_CONSTEXPR bool operator>(const U& x, const T& y) { return y < x; } - friend BOOST_OPS_CONSTEXPR bool operator<(const U& x, const T& y) + friend BOOST_OPERATORS_CONSTEXPR bool operator<(const U& x, const T& y) { return y > x; } - friend BOOST_OPS_CONSTEXPR bool operator<=(const U& x, const T& y) + friend BOOST_OPERATORS_CONSTEXPR bool operator<=(const U& x, const T& y) { return static_cast(y > x) || static_cast(y == x); } - friend BOOST_OPS_CONSTEXPR bool operator>=(const U& x, const T& y) + friend BOOST_OPERATORS_CONSTEXPR bool operator>=(const U& x, const T& y) { return static_cast(y < x) || static_cast(y == x); } }; template > struct partially_ordered1 : B { - friend BOOST_OPS_CONSTEXPR bool operator>(const T& x, const T& y) + friend BOOST_OPERATORS_CONSTEXPR bool operator>(const T& x, const T& y) { return y < x; } - friend BOOST_OPS_CONSTEXPR bool operator<=(const T& x, const T& y) + friend BOOST_OPERATORS_CONSTEXPR bool operator<=(const T& x, const T& y) { return static_cast(x < y) || static_cast(x == y); } - friend BOOST_OPS_CONSTEXPR bool operator>=(const T& x, const T& y) + friend BOOST_OPERATORS_CONSTEXPR bool operator>=(const T& x, const T& y) { return static_cast(y < x) || static_cast(x == y); } }; diff --git a/test/operators_constexpr_test.cpp b/test/operators_constexpr_test.cpp index 8ea3aff..02d3186 100644 --- a/test/operators_constexpr_test.cpp +++ b/test/operators_constexpr_test.cpp @@ -17,15 +17,15 @@ namespace { class Value : boost::operators { public: - BOOST_OPS_CONSTEXPR explicit Value(int v) + BOOST_OPERATORS_CONSTEXPR explicit Value(int v) : v_(v) { } - BOOST_OPS_CONSTEXPR bool + BOOST_OPERATORS_CONSTEXPR bool operator<(const Value& x) const { return v_ < x.v_; } - BOOST_OPS_CONSTEXPR bool + BOOST_OPERATORS_CONSTEXPR bool operator==(const Value& x) const { return v_ == x.v_; }