On a related note to the question on derived classes I sent yesterday, here is another interesting idea. Assume I have classes
class Foo { ... }; class Bar { ... //pass Foo pointer as parameter void myMethod(Foo* X) { ... } //or Foo reference void myMethod2(Foo& X) { ... } //or return Foo pointer Foo* getFoo() { ... } }; Now, when exposing both classes to R using modules, it would be great to be able to do something like FooVar <- new( Mod$Foo ) BarVar <- new( Mod$Bar ) //pass Bar as parameter BarVar$myMethod(FooVar) //get Bar back FooVar2 = BarVar$getFoo() Since the C++ part of Rcpp Modules has to have a pointer to the underlying object (i.e. of type Foo*) somewhere anyway, this seems possible. But since I am no expert in C++ meta programming, I don't know if e.g. Bar needs to know at compile time that Foo is exposed as well or what it looks like or if this can be handled dynamically at runtime. Best regards, Jonas
_______________________________________________ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel