How to use user defined ENUM


I am having issue assigning an enum value in chai on an object, I keep getting error when running script Error with function dispatch for function ‘Value1’ With parameters: (Function).(string). Example code below: I have added the test class user chaiscript::utility::add_class

    enum TestEnum

    class TestClass
        TestEnum testEnum;

   chai.add(chaiscript::fun([](const TestEnum lhs,const TestEnum rhs) {return (lhs==rhs); }),"==");
   chai.add(chaiscript::fun([](TestEnum& lhs,const TestEnum rhs) {return (lhs=rhs); }),"=");


  var testClass = TestClass;
  testClass.testEnum = Value1;


This was my mistake, I was not constructing the class object correctly: The fix was

 var testClass = TestClass();
 testClass.testEnum = Value1;