forked from mpusz/mp-units
Missing fixed_string comparison operators added
This commit is contained in:
33
src/include/units/bits/external/fixed_string.h
vendored
33
src/include/units/bits/external/fixed_string.h
vendored
@@ -103,6 +103,11 @@ struct basic_fixed_string {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[[nodiscard]] constexpr friend bool operator!=(const basic_fixed_string& lhs, const basic_fixed_string& rhs) noexcept
|
||||||
|
{
|
||||||
|
return !(lhs == rhs);
|
||||||
|
}
|
||||||
|
|
||||||
template<typename CharT2, std::size_t N2>
|
template<typename CharT2, std::size_t N2>
|
||||||
[[nodiscard]] constexpr friend bool operator==(const basic_fixed_string&,
|
[[nodiscard]] constexpr friend bool operator==(const basic_fixed_string&,
|
||||||
const basic_fixed_string<CharT2, N2>&) noexcept
|
const basic_fixed_string<CharT2, N2>&) noexcept
|
||||||
@@ -110,6 +115,13 @@ struct basic_fixed_string {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<typename CharT2, std::size_t N2>
|
||||||
|
[[nodiscard]] constexpr friend bool operator!=(const basic_fixed_string&,
|
||||||
|
const basic_fixed_string<CharT2, N2>&) noexcept
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
template<typename CharT2, std::size_t N2>
|
template<typename CharT2, std::size_t N2>
|
||||||
[[nodiscard]] constexpr friend bool operator<(const basic_fixed_string& lhs,
|
[[nodiscard]] constexpr friend bool operator<(const basic_fixed_string& lhs,
|
||||||
const basic_fixed_string<CharT2, N2>& rhs) noexcept
|
const basic_fixed_string<CharT2, N2>& rhs) noexcept
|
||||||
@@ -127,6 +139,27 @@ struct basic_fixed_string {
|
|||||||
return first1 == last1 && first2 != last2;
|
return first1 == last1 && first2 != last2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<typename CharT2, std::size_t N2>
|
||||||
|
[[nodiscard]] constexpr friend bool operator>(const basic_fixed_string& lhs,
|
||||||
|
const basic_fixed_string<CharT2, N2>& rhs) noexcept
|
||||||
|
{
|
||||||
|
return rhs < lhs;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename CharT2, std::size_t N2>
|
||||||
|
[[nodiscard]] constexpr friend bool operator<=(const basic_fixed_string& lhs,
|
||||||
|
const basic_fixed_string<CharT2, N2>& rhs) noexcept
|
||||||
|
{
|
||||||
|
return !(rhs < lhs);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename CharT2, std::size_t N2>
|
||||||
|
[[nodiscard]] constexpr friend bool operator>=(const basic_fixed_string& lhs,
|
||||||
|
const basic_fixed_string<CharT2, N2>& rhs) noexcept
|
||||||
|
{
|
||||||
|
return !(lhs < rhs);
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
template<class Traits>
|
template<class Traits>
|
||||||
|
Reference in New Issue
Block a user