I have two classes A, the parent and B, the child.
B overloads a method from A. The problem is that the method getval is not overloaded when exposing class B in an RCPP module, despite explicitly exposing it again a second time with a pointer to B::getval.
Is it due to a bug in Rcpp, a limitation or something I just don't know yet?
class A
{
public:
A(int val) : val(val) {}
int getval()
{
Rcout << "I am A" << endl;
return val;
}
private:
int val;
};
class B : public A
{
public:
using A::A;
int getval()
{
Rcout << "I am B" << endl;
return A::getval();
}
};
RCPP_MODULE(rg)
{
using namespace Rcpp;
class_<A>("A")
.constructor<int>()
.method("getval", &A::getval);
class_<B>("B")
.derives<A>("A")
.constructor<int>()
.method("getval", &B::getval);
}