2018-03-20 4:33 GMT+01:00 Tim Keitt <tke...@utexas.edu>: > Why not something like: > > Rcpp::sourceCpp(code=' > #include <Rcpp.h> > using Rcpp::Rcout; > > // [[Rcpp::export]] > void print_addr(SEXP x){ > Rcout << static_cast<void*>(x) << std::endl; > }') > > I'm not sure why one would expect Rcpp types to automatically yield a > pointer appropriate for printing.
I may have my own reasons for that, but that's not the point here. The point is that I expected a homogeneous behaviour across Rcpp classes when any object is passed to operator<< (i.e., print *something*). By grepping the source, I discovered that Matrix and Vector have an implementation of operator<<, but not the other classes. Of course, this is a minor issue, because anyone is able to define this operator if needed. I simply wanted to note it here, just in case Dirk considered that all classes should have a well-defined one. Iñaki > > THK > > _______________________________________________ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel