sol2 icon indicating copy to clipboard operation
sol2 copied to clipboard

Undesired default construction for arguments.

Open SU-Daigoro opened this issue 8 months ago • 0 comments

I have this snippet:

sol::usertype<my_type> my_usertype= Lua.new_usertype<my_type>("my_type");
my_usertype[sol::meta_method::to_string] = [](const int &SomeInt, const int &, const int &, const int &, const int &, const int &, const int &, const int & Hmm) {
    return "";
};

And even tho i do not pass any arguments when calling this in Lua, all its arguments become 0. Can i somehow prevent this behavior? I am not sure what causes it. I also tried strings which seems to initialize them as an empty string ("").

SU-Daigoro avatar Mar 18 '25 23:03 SU-Daigoro