@@ -1731,13 +1731,15 @@ namespace ctre {
1731
1731
1732
1732
template <auto... Name> struct id {
1733
1733
static constexpr auto name = ctll::fixed_string<sizeof...(Name)>{{Name...}};
1734
- };
1735
1734
1736
- template <auto... Name> constexpr auto operator==(id<Name...>, id<Name...>) noexcept -> std::true_type { return {}; }
1735
+ friend constexpr auto operator==(id<Name...>, id<Name...>) noexcept -> std::true_type { return {}; }
1737
1736
1738
- template <auto... Name1, auto... Name2> constexpr auto operator==(id<Name1 ...>, id<Name2 ...>) noexcept -> std::false_type { return {}; }
1737
+ template <auto... Other> friend constexpr auto operator==(id<Name ...>, id<Other ...>) noexcept -> std::false_type { return {}; }
1739
1738
1740
- template <auto... Name, typename T> constexpr auto operator==(id<Name...>, T) noexcept -> std::false_type { return {}; }
1739
+ template <typename T> friend constexpr auto operator==(id<Name...>, T) noexcept -> std::false_type { return {}; }
1740
+
1741
+ template <typename T> friend constexpr auto operator==(T, id<Name...>) noexcept -> std::false_type { return {}; }
1742
+ };
1741
1743
1742
1744
}
1743
1745
@@ -4025,16 +4027,28 @@ namespace ctre {
4025
4027
4026
4028
struct zero_terminated_string_end_iterator {
4027
4029
constexpr inline zero_terminated_string_end_iterator() = default;
4028
- constexpr CTRE_FORCE_INLINE bool operator==(const char * ptr) const noexcept {
4030
+ constexpr CTRE_FORCE_INLINE friend bool operator==(const char * ptr, zero_terminated_string_end_iterator) noexcept {
4031
+ return *ptr == '\0';
4032
+ }
4033
+ constexpr CTRE_FORCE_INLINE friend bool operator==(const wchar_t * ptr, zero_terminated_string_end_iterator) noexcept {
4034
+ return *ptr == 0;
4035
+ }
4036
+ constexpr CTRE_FORCE_INLINE friend bool operator!=(const char * ptr, zero_terminated_string_end_iterator) noexcept {
4037
+ return *ptr != '\0';
4038
+ }
4039
+ constexpr CTRE_FORCE_INLINE friend bool operator!=(const wchar_t * ptr, zero_terminated_string_end_iterator) noexcept {
4040
+ return *ptr != 0;
4041
+ }
4042
+ constexpr CTRE_FORCE_INLINE friend bool operator==(zero_terminated_string_end_iterator, const char * ptr) noexcept {
4029
4043
return *ptr == '\0';
4030
4044
}
4031
- constexpr CTRE_FORCE_INLINE bool operator==(const wchar_t * ptr) const noexcept {
4045
+ constexpr CTRE_FORCE_INLINE friend bool operator==(zero_terminated_string_end_iterator, const wchar_t * ptr) noexcept {
4032
4046
return *ptr == 0;
4033
4047
}
4034
- constexpr CTRE_FORCE_INLINE bool operator!=(const char * ptr) const noexcept {
4048
+ constexpr CTRE_FORCE_INLINE friend bool operator!=(zero_terminated_string_end_iterator, const char * ptr) noexcept {
4035
4049
return *ptr != '\0';
4036
4050
}
4037
- constexpr CTRE_FORCE_INLINE bool operator!=(const wchar_t * ptr) const noexcept {
4051
+ constexpr CTRE_FORCE_INLINE friend bool operator!=(zero_terminated_string_end_iterator, const wchar_t * ptr) noexcept {
4038
4052
return *ptr != 0;
4039
4053
}
4040
4054
};
0 commit comments