From: Kefu Chai Date: Wed, 3 Aug 2022 03:07:17 +0000 (+0800) Subject: common: drop WRITE_{EQ,CMP}_OPERATORS_5() X-Git-Tag: v18.0.0~339^2~3 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=06c641b8c6aed33aa2b455bc14f30ec8c1dc8cba;p=ceph.git common: drop WRITE_{EQ,CMP}_OPERATORS_5() the default-generated comparison operators can fulfill our needs. Signed-off-by: Kefu Chai --- diff --git a/src/include/cmp.h b/src/include/cmp.h index 1efe8aa3e47ce..9b39aaab21970 100644 --- a/src/include/cmp.h +++ b/src/include/cmp.h @@ -4,44 +4,6 @@ /* * macros to define comparison operators for classes with small numbers of members. */ -#define WRITE_EQ_OPERATORS_5(type, a, b, c, d, e) \ - inline bool operator==(const type &l, const type &r) { \ - return l.a == r.a && l.b == r.b && l.c == r.c && l.d == r.d && l.e == r.e; \ - } \ - inline bool operator!=(const type &l, const type &r) { \ - return l.a != r.a || l.b != r.b || l.c != r.c || l.d != r.d || l.e != r.e; \ - } - -#define WRITE_CMP_OPERATORS_5(type, a, b, c, d, e) \ - inline bool operator>(const type &l, const type &r) { \ - return l.a > r.a || \ - (l.a == r.a && (l.b > r.b || \ - (l.b == r.b && (l.c > r.c || \ - (l.c == r.c && (l.d > r.d || \ - (l.d == r.d && l.e > r.e))))))); \ - } \ - inline bool operator<(const type &l, const type &r) { \ - return l.a < r.a || \ - (l.a == r.a && (l.b < r.b || \ - (l.b == r.b && (l.c < r.c || \ - (l.c == r.c && (l.d < r.d || \ - (l.d == r.d && (l.e < r.e)))))))); \ - } \ - inline bool operator>=(const type &l, const type &r) { \ - return l.a > r.a || \ - (l.a == r.a && (l.b > r.b || \ - (l.b == r.b && (l.c > r.c || \ - (l.c == r.c && (l.d > r.d || \ - (l.d == r.d && l.e >= r.e))))))); \ - } \ - inline bool operator<=(const type &l, const type &r) { \ - return l.a < r.a || \ - (l.a == r.a && (l.b < r.b || \ - (l.b == r.b && (l.c < r.c || \ - (l.c == r.c && (l.d < r.d || \ - (l.d == r.d && l.e <= r.e))))))); \ - } - #define WRITE_EQ_OPERATORS_7(type, a, b, c, d, e, f, g) \ inline bool operator==(const type &l, const type &r) { \ return l.a == r.a && l.b == r.b && l.c == r.c && l.d == r.d && l.e == r.e && l.f == r.f && l.g == r.g; \ diff --git a/src/include/fs_types.h b/src/include/fs_types.h index fc34e702a4341..72ae6d56f2378 100644 --- a/src/include/fs_types.h +++ b/src/include/fs_types.h @@ -144,6 +144,8 @@ struct file_layout_t { pool_id(-1) { } + bool operator==(const file_layout_t&) const = default; + static file_layout_t get_default() { return file_layout_t(1<<22, 1, 1<<22); } @@ -165,8 +167,6 @@ struct file_layout_t { }; WRITE_CLASS_ENCODER_FEATURES(file_layout_t) -WRITE_EQ_OPERATORS_5(file_layout_t, stripe_unit, stripe_count, object_size, pool_id, pool_ns); - std::ostream& operator<<(std::ostream& out, const file_layout_t &layout); #endif