From 7137142351dfc246dff08e3e95c18d9168520c2a Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Wed, 12 Feb 2020 12:44:24 +0300 Subject: [PATCH] geometry.h: more cleanup Remove wrong constructors. --- Utilities/geometry.h | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/Utilities/geometry.h b/Utilities/geometry.h index eef1fe747e..31ddd26c1e 100644 --- a/Utilities/geometry.h +++ b/Utilities/geometry.h @@ -15,10 +15,6 @@ struct size2_base { } - constexpr size2_base(const size2_base& rhs) : width{ rhs.width }, height{ rhs.height } - { - } - constexpr size2_base operator -(const size2_base& rhs) const { return{ width - rhs.width, height - rhs.height }; @@ -215,6 +211,8 @@ struct position1_base return x == rhs; } +#if __cpp_impl_three_way_comparison >= 201711 +#else bool operator !=(const position1_base& rhs) const { return !(*this == rhs); @@ -224,6 +222,7 @@ struct position1_base { return !(*this == rhs); } +#endif template explicit operator position1_base() const @@ -250,10 +249,6 @@ struct position2_base { } - constexpr position2_base(const position2_base& rhs) : x{ rhs.x }, y{ rhs.y } - { - } - constexpr bool operator >(const position2_base& rhs) const { return x > rhs.x && y > rhs.y; @@ -388,6 +383,8 @@ struct position2_base return x == rhs && y == rhs; } +#if __cpp_impl_three_way_comparison >= 201711 +#else constexpr bool operator !=(const position2_base& rhs) const { return !(*this == rhs); @@ -397,6 +394,7 @@ struct position2_base { return !(*this == rhs); } +#endif template explicit constexpr operator position2_base() const @@ -480,6 +478,8 @@ struct position3_base return x == rhs && y == rhs && z == rhs; } +#if __cpp_impl_three_way_comparison >= 201711 +#else bool operator !=(const position3_base& rhs) const { return !(*this == rhs); @@ -489,6 +489,7 @@ struct position3_base { return !(*this == rhs); } +#endif template explicit operator position3_base() const @@ -570,6 +571,8 @@ struct position4_base return x == rhs && y == rhs && z == rhs && w == rhs; } +#if __cpp_impl_three_way_comparison >= 201711 +#else constexpr bool operator !=(const position4_base& rhs) const { return !(*this == rhs); @@ -579,6 +582,7 @@ struct position4_base { return !(*this == rhs); } +#endif template explicit constexpr operator position4_base() const @@ -621,11 +625,6 @@ struct coord_base { } - constexpr coord_base(const coord_base& other) - : position{ other.position }, size{ other.size } - { - } - constexpr coord_base(T x, T y, T width, T height) : x{ x }, y{ y }, width{ width }, height{ height } { @@ -726,10 +725,13 @@ struct area_base return x1 == rhs.x1 && x2 == rhs.x2 && y1 == rhs.y1 && y2 == rhs.y2; } +#if __cpp_impl_three_way_comparison >= 201711 +#else constexpr bool operator != (const area_base& rhs) const { return !(*this == rhs); } +#endif constexpr area_base operator - (const size2_base& size) const {