@@ -1731,13 +1731,15 @@ namespace ctre {
17311731
17321732template <auto... Name> struct id {
17331733 static constexpr auto name = ctll::fixed_string<sizeof...(Name)>{{Name...}};
1734- };
17351734
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 {}; }
17371736
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 {}; }
17391738
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+ };
17411743
17421744}
17431745
@@ -4025,16 +4027,28 @@ namespace ctre {
40254027
40264028struct zero_terminated_string_end_iterator {
40274029 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 {
40294043 return *ptr == '\0';
40304044 }
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 {
40324046 return *ptr == 0;
40334047 }
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 {
40354049 return *ptr != '\0';
40364050 }
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 {
40384052 return *ptr != 0;
40394053 }
40404054};
0 commit comments