You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, tx for making this library!
I am making a C++ -> Lua bridge from a set of C++ classes I already wrote, and so I did some documentation reading, and found a typo
It's over here,
struct A {
int a = 10;
virtual int call() { return 0; }
virtual ~A(){}
};
struct B : A {
int b = 11;
virtual int call() override { return 20; }
};
int main (int, char*[]) {
sol::state lua;
______________ over there B should be A
/
lua.new_usertype<B>( "A",
"call", &A::call
);
lua.new_usertype<B>( "B",
"call", &B::call,
sol::base_classes, sol::bases<A>()
);
return 0;
}
The text was updated successfully, but these errors were encountered:
C3pa
added a commit
to C3pa/sol2
that referenced
this issue
Nov 6, 2023
Hi, tx for making this library!
I am making a C++ -> Lua bridge from a set of C++ classes I already wrote, and so I did some documentation reading, and found a typo
It's over here,
https://sol2.readthedocs.io/en/latest/api/usertype.html#usertype-inheritance
in the statement,
Ok, that was it.
Tx!
Ondrej
#define SOL_ALL_SAFETIES_ON 1
#include <sol/sol.hpp>
struct A {
int a = 10;
virtual int call() { return 0; }
virtual ~A(){}
};
struct B : A {
int b = 11;
virtual int call() override { return 20; }
};
int main (int, char*[]) {
}
The text was updated successfully, but these errors were encountered: