mirror of
https://github.com/BlackMATov/meta.hpp.git
synced 2025-12-14 19:41:29 +07:00
disable different states comparing
This commit is contained in:
@@ -398,13 +398,13 @@ namespace std
|
||||
|
||||
namespace meta_hpp
|
||||
{
|
||||
template < detail::state_family L, detail::state_family R >
|
||||
[[nodiscard]] bool operator==(const L& l, const R& r) noexcept {
|
||||
template < detail::state_family State >
|
||||
[[nodiscard]] bool operator==(const State& l, const State& r) noexcept {
|
||||
return l.is_valid() == r.is_valid() && (!l.is_valid() || l.get_index() == r.get_index());
|
||||
}
|
||||
|
||||
template < detail::state_family L, detail::state_family R >
|
||||
[[nodiscard]] std::strong_ordering operator<=>(const L& l, const R& r) noexcept {
|
||||
template < detail::state_family State >
|
||||
[[nodiscard]] std::strong_ordering operator<=>(const State& l, const State& r) noexcept {
|
||||
if ( const std::strong_ordering cmp{l.is_valid() <=> r.is_valid()}; cmp != std::strong_ordering::equal ) {
|
||||
return cmp;
|
||||
}
|
||||
@@ -414,13 +414,13 @@ namespace meta_hpp
|
||||
|
||||
namespace meta_hpp
|
||||
{
|
||||
template < detail::state_family L >
|
||||
[[nodiscard]] bool operator==(const L& l, const typename L::index_type& r) noexcept {
|
||||
template < detail::state_family State >
|
||||
[[nodiscard]] bool operator==(const State& l, const typename State::index_type& r) noexcept {
|
||||
return l.is_valid() && l.get_index() == r;
|
||||
}
|
||||
|
||||
template < detail::state_family L >
|
||||
[[nodiscard]] std::strong_ordering operator<=>(const L& l, const typename L::index_type& r) noexcept {
|
||||
template < detail::state_family State >
|
||||
[[nodiscard]] std::strong_ordering operator<=>(const State& l, const typename State::index_type& r) noexcept {
|
||||
return l.is_valid() ? l.get_index() <=> r : std::strong_ordering::less;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -410,13 +410,13 @@ namespace std
|
||||
|
||||
namespace meta_hpp
|
||||
{
|
||||
template < detail::type_family L, detail::type_family R >
|
||||
[[nodiscard]] bool operator==(const L& l, const R& r) noexcept {
|
||||
template < detail::type_family TypeL, detail::type_family TypeR >
|
||||
[[nodiscard]] bool operator==(const TypeL& l, const TypeR& r) noexcept {
|
||||
return l.is_valid() == r.is_valid() && (!l.is_valid() || l.get_id() == r.get_id());
|
||||
}
|
||||
|
||||
template < detail::type_family L, detail::type_family R >
|
||||
[[nodiscard]] std::strong_ordering operator<=>(const L& l, const R& r) noexcept {
|
||||
template < detail::type_family TypeL, detail::type_family TypeR >
|
||||
[[nodiscard]] std::strong_ordering operator<=>(const TypeL& l, const TypeR& r) noexcept {
|
||||
if ( const std::strong_ordering cmp{l.is_valid() <=> r.is_valid()}; cmp != std::strong_ordering::equal ) {
|
||||
return cmp;
|
||||
}
|
||||
@@ -426,13 +426,13 @@ namespace meta_hpp
|
||||
|
||||
namespace meta_hpp
|
||||
{
|
||||
template < detail::type_family L >
|
||||
[[nodiscard]] bool operator==(const L& l, const typename L::id_type& r) noexcept {
|
||||
template < detail::type_family Type >
|
||||
[[nodiscard]] bool operator==(const Type& l, const typename Type::id_type& r) noexcept {
|
||||
return l.is_valid() && l.get_id() == r;
|
||||
}
|
||||
|
||||
template < detail::type_family L >
|
||||
[[nodiscard]] std::strong_ordering operator<=>(const L& l, const typename L::id_type& r) noexcept {
|
||||
template < detail::type_family Type >
|
||||
[[nodiscard]] std::strong_ordering operator<=>(const Type& l, const typename Type::id_type& r) noexcept {
|
||||
return l.is_valid() ? l.get_id() <=> r : std::strong_ordering::less;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user