Skip to content
Prev 2694 / 10988 Next

[Rcpp-devel] Overloaded constructors?

On 5 August 2011 at 12:06, Sebastian Weber wrote:
| Hi!
| 
| I recently learned how to deal with overlaoded functions when I wanna wrap
| a class function interface with overladed things. The solution is to use
| function pointers. 

Or 'factories' with a base class derived classes, and and and. I think there
are many ways.

| Now, what comes to the rescue in the case of overladed constructors? Any suggestion?

What exactly do you want?

I think the basic word is that at a basic level we just can't.  The R API is
after C-based and we have to play some tricks about generated names for
functions etc.  Romain put some tricks into Rcpp modules to allow something
close to multiple constructors for a Modules object but we can't give you
each and every feature of C++ in Rcpp as there are some restrictions imposed
by being in between R and C++ --- which is the space we chose to be in.

Cheers, Dirk