Class Inheritance


Looking at It doesn’t mention inheritance at all. Am I correct to assume object inheritance is not supported? I am not asking about inheriting a class defined in c++, just plain script/script inheritance.

class Base  {  attr ID;  };
class Derive { ?? }

Is there a language construct allowing me to have ID attribute in objects of Derive class (apart from just adding attr ID ).

Thanks again!


No, that has not been implemented…

It might not actually be terribly difficult to implement. I’d have to think about it. Feel free to create a feature request on the github issue tracker with a proposed syntax:


I will do that, thanks!


Was looking to add an overriden function with an inherited class, and discovered I had to let ChaiScript know about the inheritance…

chai.add(chaiscript::base_class<Base, Derived>());