[Rcpp-devel] about the RcppSexp (Rcpp::RObject) constructors
Dirk Eddelbuettel
edd at debian.org
Thu Dec 31 19:06:35 CET 2009
On 31 December 2009 at 16:52, Romain François wrote:
| Hi,
|
| Now that I am on the road for class inheritance and all that, I am not
| sure anymore that the myriad of constructors for Rcpp::RObject are a
| good idea, i.e since we have for example :
|
| Rcpp::RObject( double& d ) ;
|
| it is then valid (as far as my -- still learning -- understanding of C++
| goes) to do this :
|
| Rcpp::Environment( 1.3 )
|
| which of course is a nuisance.
Oih. That is tricky. Not sure what do to there.
| I was thinking of replacing the constructors with a set of functions
| (and C++ polymorphism makes it easy I think), so we would have a
| function (let's decide about its name first) for example wrap and many
| overloaded with different parameters.
|
| Rcpp::wrap( const double& d)
| Rcpp::wrap( const std::vector<int>& d)
| ...
|
| then the wrap can dispatch to the appropriate class.
Hm. Not sure yet. That is tricky.
In general, I'd be in favour of slowing the rate of changes a tad and trying
to 0.7.1 out :)
Dirk
--
Three out of two people have difficulties with fractions.
More information about the Rcpp-devel
mailing list