These are chat archives for ChaiScript/ChaiScript

1st
Dec 2016
JFT90
@JFT90
Dec 01 2016 00:28

Hi,
is there support to use functions in chaiscript exposed from multilevel inheritance c++ classes ?
For example I have something like that in C++:

class A
{ 
A();
virtual ~A();
virtual void fun1();
};

class B: A
{
B();
virtual ~B();
virtual void fun2();
};

class C:B
{
C();
virtual ~C();
};

So I have added the functions to Chaiscript, set the base_class<base,derived> for B and C. And I pass a reference of an object of class C to Chaiscript. If I do
c.fun1(); in Chaiscript I get : Error with function dispatch for function 'fun1'.
But calling c.fun2(); just seems to work fine

Jason Turner
@lefticus
Dec 01 2016 00:30
@JFT90 you have to tell chaiscript about all the relationships. Example for what you have: base_class<A,B> base_class<A,C> base_class<B,C>
@JFT90 if C++ ever gets reflection we'll be able to solve this for real