[Rcpp-devel] Modules and default constructors

Douglas Bates bates at stat.wisc.edu
Fri Nov 19 16:06:56 CET 2010


I believe it is now recommended that a class to be exposed in a module
should expose a default constructor (i.e. a constructor called with no
arguments).  Is such a constructor actually called or is it just there
to establish the necessary linkage?  In a class where it would not
make sense to construct an object without arguments I was going to
have the default constructor throw an exception but that might not be
a good idea.  I seem to recall the discussion between John and Romain
indicating that it must be called during the initialization of the
reference class in R.


More information about the Rcpp-devel mailing list