[Rcpp-devel] Preferred way to create an instance of a C++ class exported in a module?

Douglas Bates bates at stat.wisc.edu
Tue Nov 30 17:21:46 CET 2010


I have seen a couple of ways of creating an instance of a C++ class
exported in a module

mod <- Module("myMod", "myPackage")
cls <- mod$myClass
inst <- cls$new(constructorArgs)

and

inst <- new(mod$myClass, constructorArgs)

Is one of these the preferred way?


More information about the Rcpp-devel mailing list