Skip to content

Commit 988f17a

Browse files
committed
add operators == and != against SEXP to String class (rounds off #372)
1 parent 0d483c7 commit 988f17a

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: Rcpp
22
Title: Seamless R and C++ Integration
3-
Version: 0.12.0.5
4-
Date: 2015-08-31
3+
Version: 0.12.0.9
4+
Date: 2015-09-09
55
Author: Dirk Eddelbuettel, Romain Francois, JJ Allaire, Kevin Ushey,
66
Qiang Kou, Douglas Bates and John Chambers
77
Maintainer: Dirk Eddelbuettel <[email protected]>

inst/include/Rcpp/String.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,14 @@ namespace Rcpp {
438438
return strcmp( get_cstring(), other.get_cstring() ) > 0;
439439
}
440440

441+
bool operator==( SEXP other ) const {
442+
return get_sexp() == other;
443+
}
444+
445+
bool operator!=( SEXP other ) const {
446+
return get_sexp() != other;
447+
}
448+
441449
private:
442450

443451
/** the CHARSXP this String encapsulates */

0 commit comments

Comments
 (0)