Skip to content

Commit e0eaa4f

Browse files
committed
src: remove extraneous operator!= definitions
Since C++20, overload resolution for `a != b` considers rewritten candidate operator==.
1 parent be12b79 commit e0eaa4f

File tree

9 files changed

+0
-12
lines changed

9 files changed

+0
-12
lines changed

exch/http/http_parser.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,6 @@ class VCONN_REF {
147147
pvconnection(p), m_hold(p->lock), m_iter(std::move(i)) {}
148148
~VCONN_REF() { put(); }
149149
NOMOVE(VCONN_REF);
150-
bool operator!=(std::nullptr_t) const { return pvconnection != nullptr; }
151150
bool operator==(std::nullptr_t) const { return pvconnection == nullptr; }
152151
void put();
153152
VIRTUAL_CONNECTION *operator->() { return pvconnection; }

exch/mysql_adaptor/sql2.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ class sqlconn final {
2727
sqlconn &operator=(sqlconn &&o) noexcept;
2828
operator bool() const { return m_conn; }
2929
bool operator==(std::nullptr_t) const { return m_conn == nullptr; }
30-
bool operator!=(std::nullptr_t) const { return m_conn != nullptr; }
3130
MYSQL *get() const { return m_conn; }
3231
std::string quote(std::string_view);
3332
bool query(std::string_view);

include/gromox/common_types.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,12 @@ struct GX_EXPORT BOOL {
99
constexpr BOOL() noexcept = default;
1010
constexpr BOOL(int z) noexcept : m_bool_value{z} {}
1111
constexpr bool operator==(const BOOL &o) const noexcept { return m_bool_value == o.m_bool_value; }
12-
constexpr bool operator!=(const BOOL &o) const noexcept { return m_bool_value != o.m_bool_value; }
1312
constexpr bool operator!() const noexcept { return !m_bool_value; }
1413
constexpr operator bool() const noexcept { return m_bool_value; }
1514
constexpr operator int() const noexcept = delete;
1615
#endif
1716
};
1817
inline bool operator==(const BOOL &a, const BOOL &b) { return a.v == b.v; }
19-
inline bool operator!=(const BOOL &a, const BOOL &b) { return a.v != b.v; }
2018
inline bool operator!(const BOOL &a) { return !a.v; }
2119
static constexpr BOOL FALSE{0};
2220
static constexpr BOOL TRUE{-1};

include/gromox/database_mysql.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ class GX_EXPORT DB_RESULT {
3333
}
3434
operator bool() const noexcept { return m_res != nullptr; }
3535
bool operator==(std::nullptr_t) const noexcept { return m_res == nullptr; }
36-
bool operator!=(std::nullptr_t) const noexcept { return m_res != nullptr; }
3736
MYSQL_RES *get() const noexcept { return m_res; }
3837
void *release() noexcept
3938
{

include/gromox/defs.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,6 @@ template<typename T> struct deref_iterator {
196196
constexpr deref_iterator(T **p = nullptr) : ptr(p) {}
197197
constexpr T &operator*() { return **ptr; }
198198
constexpr bool operator==(const deref_iterator o) const { return ptr == o.ptr; }
199-
constexpr bool operator!=(const deref_iterator o) const { return ptr != o.ptr; }
200199
constexpr deref_iterator &operator--() { --ptr; return *this; }
201200
constexpr deref_iterator &operator++() { ++ptr; return *this; }
202201
};
@@ -206,7 +205,6 @@ template<typename T> struct const_deref_iterator {
206205
constexpr const_deref_iterator(T **p = nullptr) : ptr(p) {}
207206
constexpr const T &operator*() { return **ptr; }
208207
constexpr bool operator==(const const_deref_iterator &o) const { return ptr == o.ptr; }
209-
constexpr bool operator!=(const const_deref_iterator &o) const { return ptr != o.ptr; }
210208
constexpr const_deref_iterator &operator--() { --ptr; return *this; }
211209
constexpr const_deref_iterator &operator++() { ++ptr; return *this; }
212210
};

include/gromox/exmdb_client.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ struct GX_EXPORT remote_conn_ref {
7171
void operator=(remote_conn &&) = delete;
7272
remote_conn *operator->() { return tmplist.size() != 0 ? &tmplist.front() : nullptr; }
7373
bool operator==(std::nullptr_t) const { return tmplist.size() == 0; }
74-
bool operator!=(std::nullptr_t) const { return tmplist.size() != 0; }
7574
void reset(bool lost = false);
7675

7776
std::list<remote_conn> tmplist;

include/gromox/mapidefs.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -951,7 +951,6 @@ struct GX_EXPORT FLATUID {
951951
* `!=` needs to be explicit before C++20.
952952
*/
953953
inline bool operator==(const FLATUID &o) const { return memcmp(ab, o.ab, sizeof(ab)) == 0; }
954-
inline bool operator!=(const FLATUID &o) const { return !operator==(o); }
955954
};
956955

957956
struct GX_EXPORT FLATUID_ARRAY {
@@ -997,7 +996,6 @@ struct GX_EXPORT GUID {
997996
* call memcmp directly.
998997
*/
999998
inline bool operator==(const GUID &o) const { return memcmp(this, &o, sizeof(o)) == 0; }
1000-
inline bool operator!=(const GUID &o) const { return !operator==(o); }
1001999
/*
10021000
* EXC2019 evaluates GUID-GUID comparisons (in e.g. restrictions)
10031001
* member-wise and in host order.

include/gromox/mapierr.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,6 @@ struct GX_EXPORT ec_error_t {
442442
constexpr ec_error_t(ec_error_t_ll x) : m_value(x) {}
443443
constexpr ec_error_t(int) = delete;
444444
constexpr bool operator==(ec_error_t_ll x) const { return m_value == x; }
445-
constexpr bool operator!=(ec_error_t_ll x) const { return m_value != x; }
446445
constexpr operator bool() const = delete;
447446
constexpr void operator!() const = delete;
448447
constexpr operator uint32_t() const { return m_value; }

mra/midb_agent.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ struct BACK_CONN_floating {
6565
void operator=(BACK_CONN_floating &&) = delete;
6666
BACK_CONN *operator->() { return tmplist.size() != 0 ? &tmplist.front() : nullptr; }
6767
bool operator==(std::nullptr_t) const { return tmplist.size() == 0; }
68-
bool operator!=(std::nullptr_t) const { return tmplist.size() != 0; }
6968
void reset(bool lost = false);
7069

7170
std::list<BACK_CONN> tmplist;

0 commit comments

Comments
 (0)