mirror of
https://github.com/mpusz/mp-units.git
synced 2025-08-03 12:24:26 +02:00
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;
|
||||
}
|
||||
|
||||
[[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>
|
||||
[[nodiscard]] constexpr friend bool operator==(const basic_fixed_string&,
|
||||
const basic_fixed_string<CharT2, N2>&) noexcept
|
||||
@@ -110,6 +115,13 @@ struct basic_fixed_string {
|
||||
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>
|
||||
[[nodiscard]] constexpr friend bool operator<(const basic_fixed_string& lhs,
|
||||
const basic_fixed_string<CharT2, N2>& rhs) noexcept
|
||||
@@ -127,6 +139,27 @@ struct basic_fixed_string {
|
||||
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
|
||||
|
||||
template<class Traits>
|
||||
|
Reference in New Issue
Block a user