[Rcpp-devel] Rcpp::ListOf.size() returns signed int?

Christian Gunning xian at unm.edu
Tue Sep 2 06:01:26 CEST 2014


Minor implementation question -
As a learning exercise, I'm working through g++ warnings.  After
reading SO posts r.e. int vs size_t, I've set all variables that hold
or compare object size information to type std::size_t.  This fixes
compiler warnings for Vector.size(), which doxygen shows have return
type
R_len_t.  ListOf.size() appears the odd man out, returning int.  Is
there a reason ListOf.size() returns a (signed) int?

Thanks,
Christian

Ref:
ListOf.size(): http://dirk.eddelbuettel.com/code/rcpp/html/classRcpp_1_1ListOf.html#a610d059eca87928f6b3ae80dec75f817

Vector.size(): http://dirk.eddelbuettel.com/code/rcpp/html/classRcpp_1_1Vector.html#a8d003a52136223a30c942a75cf629b0a


More information about the Rcpp-devel mailing list