diff --git a/ChangeLog b/ChangeLog index d5ed15169..ba7ab6f3b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2026-11-29 Simon Urbanek + + * inst/include/Rcpp/vector/const_string_proxy.h: Declare operator== + and operator!= as const to fix ambiguities failing to compile with + Apple clang (#1537) + 2026-11-27 David Seifert * inst/include/Rcpp/internal/wrap.h: Comment out parameter to avoid diff --git a/inst/include/Rcpp/vector/const_string_proxy.h b/inst/include/Rcpp/vector/const_string_proxy.h index 10c0b1bcd..bec3867a5 100644 --- a/inst/include/Rcpp/vector/const_string_proxy.h +++ b/inst/include/Rcpp/vector/const_string_proxy.h @@ -97,17 +97,17 @@ namespace internal{ inline bool empty() const { return *begin() == '\0' ; } inline reference operator[]( R_xlen_t n ){ return *( begin() + n ) ; } - bool operator==( const char* other){ + bool operator==( const char* other) const { return strcmp( begin(), other ) == 0 ; } - bool operator!=( const char* other){ + bool operator!=( const char* other) const { return strcmp( begin(), other ) != 0 ; } - bool operator==( const const_string_proxy& other){ + bool operator==( const const_string_proxy& other) const { return strcmp( begin(), other.begin() ) == 0 ; } - bool operator!=( const const_string_proxy& other){ + bool operator!=( const const_string_proxy& other) const { return strcmp( begin(), other.begin() ) != 0 ; }