Skip to content

Commit 68adde6

Browse files
committed
Added explicit (const_)string_proxy/SEXP comparisons to resolve ambiguity.
1 parent 2d342d1 commit 68adde6

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

inst/include/Rcpp/vector/const_string_proxy.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,13 @@ namespace internal{
110110
return strcmp( begin(), other.begin() ) != 0 ;
111111
}
112112

113+
bool operator==( SEXP other ) const {
114+
return get() == other;
115+
}
116+
117+
bool operator!=( SEXP other ) const {
118+
return get() != other;
119+
}
113120

114121
private:
115122
static std::string buffer ;

inst/include/Rcpp/vector/string_proxy.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,14 @@ namespace internal{
192192
return strcmp( begin(), other.begin() ) != 0 ;
193193
}
194194

195+
bool operator==( SEXP other ) const {
196+
return get() == other;
197+
}
198+
199+
bool operator!=( SEXP other ) const {
200+
return get() != other;
201+
}
202+
195203

196204
private:
197205
static std::string buffer ;

0 commit comments

Comments
 (0)