We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
// c++20 vs2019 (v142) ///////////////////////////// struct test { int a; void init ( const std::string& name, gravity_vm * vm) { gravity_class_t* class_t = gravity_class_new_pair(NULL, name.c_str(), NULL, 0, 0); gravity_class_t* class_t_meta = gravity_class_get_meta(class_t); // [&a] // [&] auto _fn = [this](gravity_vm* vm, gravity_value_t* args, uint16_t nargs, uint32_t rindex)->bool { int b = a + 10; return true; }; // NEW_CLOSURE_VALUE // static gravity_value_t a // { // .isa = gravity_class_closure, // .p = (gravity_object_t*)gravity_closure_new(NULL, gravity_function_new_internal(NULL,NULL, (_fn) , 0)) // }; gravity_class_bind(class_t_meta, "fn_example", NEW_CLOSURE_VALUE(_fn)); gravity_vm_setvalue(vm, name.c_str(), VALUE_FROM_OBJECT(class_t)); } }; // error ///////////////////////////// // error C2664: 'gravity_function_t *gravity_function_new_internal(gravity_vm *,const char *,gravity_c_internal,uint16_t)' : // cannot convert argument 3 from 'test::init::<lambda_1>' to 'gravity_c_internal' // No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
The text was updated successfully, but these errors were encountered:
@k1epic it is a C++ compiler-generated error and not a Gravity error. I am not sure I can help you with this issue.
Sorry, something went wrong.
No branches or pull requests
The text was updated successfully, but these errors were encountered: