I am possibly not understanding how usertypes work. Here is my mental model:
When you register a usertype, you define the relationship between a C++ type and a Lua type such that instances of one can be translated to the other.
I have followed created a sol3 usertype for my C++ type and then passed a std::vector of this type to a Lua function. I can iterate over the collection using pairs but attempting to call any of the methods on the values panics with this message:
[sol3] An error occurred and panic has been invoked: stack index 1, expected string, received no value: bad get from protected_function_result (is not an error)
Do I need to do something extra to be able to use a usertype from within a C++ collection?
I am possibly not understanding how usertypes work. Here is my mental model:
When you register a usertype, you define the relationship between a C++ type and a Lua type such that instances of one can be translated to the other.
I have followed created a sol3 usertype for my C++ type and then passed a
std::vector
of this type to a Lua function. I can iterate over the collection usingpairs
but attempting to call any of the methods on the values panics with this message:Do I need to do something extra to be able to use a usertype from within a C++ collection?