mirror of
https://github.com/BlackMATov/meta.hpp.git
synced 2025-12-16 14:09:02 +07:00
remove std::tie comparing
This commit is contained in:
@@ -601,11 +601,11 @@ namespace meta_hpp
|
||||
, name{std::move(name)} {}
|
||||
|
||||
[[nodiscard]] friend bool operator<(const evalue_index& l, const evalue_index& r) noexcept {
|
||||
return std::tie(l.type, l.name) < std::tie(r.type, r.name);
|
||||
return (l.type < r.type) || (l.type == r.type && l.name < r.name);
|
||||
}
|
||||
|
||||
[[nodiscard]] friend bool operator==(const evalue_index& l, const evalue_index& r) noexcept {
|
||||
return std::tie(l.type, l.name) == std::tie(r.type, r.name);
|
||||
return l.type == r.type && l.name == r.name;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -618,11 +618,11 @@ namespace meta_hpp
|
||||
, name{std::move(name)} {}
|
||||
|
||||
[[nodiscard]] friend bool operator<(const function_index& l, const function_index& r) noexcept {
|
||||
return std::tie(l.type, l.name) < std::tie(r.type, r.name);
|
||||
return (l.type < r.type) || (l.type == r.type && l.name < r.name);
|
||||
}
|
||||
|
||||
[[nodiscard]] friend bool operator==(const function_index& l, const function_index& r) noexcept {
|
||||
return std::tie(l.type, l.name) == std::tie(r.type, r.name);
|
||||
return l.type == r.type && l.name == r.name;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -635,11 +635,11 @@ namespace meta_hpp
|
||||
, name{std::move(name)} {}
|
||||
|
||||
[[nodiscard]] friend bool operator<(const member_index& l, const member_index& r) noexcept {
|
||||
return std::tie(l.type, l.name) < std::tie(r.type, r.name);
|
||||
return (l.type < r.type) || (l.type == r.type && l.name < r.name);
|
||||
}
|
||||
|
||||
[[nodiscard]] friend bool operator==(const member_index& l, const member_index& r) noexcept {
|
||||
return std::tie(l.type, l.name) == std::tie(r.type, r.name);
|
||||
return l.type == r.type && l.name == r.name;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -652,11 +652,11 @@ namespace meta_hpp
|
||||
, name{std::move(name)} {}
|
||||
|
||||
[[nodiscard]] friend bool operator<(const method_index& l, const method_index& r) noexcept {
|
||||
return std::tie(l.type, l.name) < std::tie(r.type, r.name);
|
||||
return (l.type < r.type) || (l.type == r.type && l.name < r.name);
|
||||
}
|
||||
|
||||
[[nodiscard]] friend bool operator==(const method_index& l, const method_index& r) noexcept {
|
||||
return std::tie(l.type, l.name) == std::tie(r.type, r.name);
|
||||
return l.type == r.type && l.name == r.name;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -684,11 +684,11 @@ namespace meta_hpp
|
||||
, name{std::move(name)} {}
|
||||
|
||||
[[nodiscard]] friend bool operator<(const variable_index& l, const variable_index& r) noexcept {
|
||||
return std::tie(l.type, l.name) < std::tie(r.type, r.name);
|
||||
return (l.type < r.type) || (l.type == r.type && l.name < r.name);
|
||||
}
|
||||
|
||||
[[nodiscard]] friend bool operator==(const variable_index& l, const variable_index& r) noexcept {
|
||||
return std::tie(l.type, l.name) == std::tie(r.type, r.name);
|
||||
return l.type == r.type && l.name == r.name;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -40,12 +40,12 @@ namespace
|
||||
int ivec2::move_ctor_counter{0};
|
||||
int ivec2::copy_ctor_counter{0};
|
||||
|
||||
bool operator<(const ivec2& l, const ivec2& r) noexcept {
|
||||
return std::tie(l.x, l.y) < std::tie(r.x, r.y);
|
||||
[[maybe_unused]] bool operator<(const ivec2& l, const ivec2& r) noexcept {
|
||||
return (l.x < r.x) || (l.x == r.x && l.y < r.y);
|
||||
}
|
||||
|
||||
bool operator==(const ivec2& l, const ivec2& r) noexcept {
|
||||
return std::tie(l.x, l.y) == std::tie(r.x, r.y);
|
||||
[[maybe_unused]] bool operator==(const ivec2& l, const ivec2& r) noexcept {
|
||||
return l.x == r.x && l.y == r.y;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -303,7 +303,7 @@ TEST_CASE("meta/meta_utilities/value") {
|
||||
class empty_class1 {};
|
||||
class empty_class2 {};
|
||||
|
||||
CHECK(operator<(meta::value{empty_class1{}}, meta::value{empty_class2{}}));
|
||||
CHECK((operator<(meta::value{empty_class1{}}, meta::value{empty_class2{}}) || operator<(meta::value{empty_class2{}}, meta::value{empty_class1{}})));
|
||||
CHECK_THROWS(std::ignore = operator<(meta::value{empty_class1{}}, meta::value{empty_class1{}}));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user