From 68adde6b21109a53e982cf61ed7c856ffeacd837 Mon Sep 17 00:00:00 2001 From: "Daniel C. Dillon" Date: Tue, 8 Sep 2015 20:43:03 -0500 Subject: [PATCH] Added explicit (const_)string_proxy/SEXP comparisons to resolve ambiguity. --- inst/include/Rcpp/vector/const_string_proxy.h | 7 +++++++ inst/include/Rcpp/vector/string_proxy.h | 8 ++++++++ 2 files changed, 15 insertions(+) diff --git a/inst/include/Rcpp/vector/const_string_proxy.h b/inst/include/Rcpp/vector/const_string_proxy.h index 8a214fdd2..7853aec1c 100644 --- a/inst/include/Rcpp/vector/const_string_proxy.h +++ b/inst/include/Rcpp/vector/const_string_proxy.h @@ -110,6 +110,13 @@ namespace internal{ return strcmp( begin(), other.begin() ) != 0 ; } + bool operator==( SEXP other ) const { + return get() == other; + } + + bool operator!=( SEXP other ) const { + return get() != other; + } private: static std::string buffer ; diff --git a/inst/include/Rcpp/vector/string_proxy.h b/inst/include/Rcpp/vector/string_proxy.h index 5aa28ab4a..d788eb8b2 100644 --- a/inst/include/Rcpp/vector/string_proxy.h +++ b/inst/include/Rcpp/vector/string_proxy.h @@ -192,6 +192,14 @@ namespace internal{ return strcmp( begin(), other.begin() ) != 0 ; } + bool operator==( SEXP other ) const { + return get() == other; + } + + bool operator!=( SEXP other ) const { + return get() != other; + } + private: static std::string buffer ;