Skip to content

Commit 7025d07

Browse files
committed
adding isSet() tester
1 parent 00851f5 commit 7025d07

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

inst/include/Rcpp/Nullable.h

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ namespace Rcpp {
6868
* @throw 'not initialized' if object has not been set
6969
*/
7070
inline operator SEXP() {
71-
checkIfSet();
71+
isSet();
7272
return m_sexp;
7373
}
7474

@@ -83,7 +83,7 @@ namespace Rcpp {
8383
}
8484

8585
/**
86-
* boolean test for NULL
86+
* Boolean test for NULL
8787
*
8888
* @throw 'not initialized' if object has not been set
8989
*/
@@ -93,14 +93,20 @@ namespace Rcpp {
9393
}
9494

9595
/**
96-
* boolean test for not NULL
96+
* Boolean test for not NULL
9797
*
9898
* @throw 'not initialized' if object has not been set
9999
*/
100100
inline bool isNotNull() {
101101
return ! isNull();
102102
}
103103

104+
/**
105+
* Test function to check if object has been initialized
106+
*
107+
*/
108+
inline bool isSet(void) { return m_set; }
109+
104110
private:
105111
SEXP m_sexp;
106112
bool m_set;

0 commit comments

Comments
 (0)