[Rcpp-devel] overloading = operator
Romain François
francoisromain at free.fr
Tue Dec 8 21:52:36 CET 2009
Hi,
On the subject of getting some convenience stuff into Rcpp, what about
overloading the = operator and do for example something like this :
std::string& operator= ( const SEXP& robject );
std::vector<std::string>& operator= ( const SEXP& robject );
and so on. so that we could have .
SEXP foobar( SEXP foo, SEXP bar){
std::string foo_string = foo ;
// ...
}
The implementations would have to take care of the TYPEOF's but it might
be a good way of doing it.
Romain
--
Romain Francois
Professional R Enthusiast
+33(0) 6 28 91 30 30
http://romainfrancois.blog.free.fr
|- http://tr.im/Gq7i : ohloh
|- http://tr.im/FtUu : new package : highlight
`- http://tr.im/EAD5 : LondonR slides
More information about the Rcpp-devel
mailing list