Why we can't pass nil to std::shared_ptr without registering a new overload. This behavior used to work previously according to my old tests, not anymore.
Consider this example:
[sol2] An error occurred and has been passed to an error handler: sol: runtime error: stack index 1, expected userdata, received nil: value is not a userdata (bad argument into 'void(std::shared_ptr<Test>)')
stack traceback:
[C]: in function 'base.f'
[string "f(nil)"]:1: in main chunk
terminate called after throwing an instance of 'sol::error'
what(): sol: runtime error: stack index 1, expected userdata, received nil: value is not a userdata (bad argument into 'void(std::shared_ptr<Test>)')
stack traceback:
[C]: in function 'base.f'
[string "f(nil)"]:1: in main chunk
Program terminated with signal: SIGSEGV
Why we can't pass
nil
tostd::shared_ptr
without registering a new overload. This behavior used to work previously according to my old tests, not anymore. Consider this example:Throws this error:
@ThePhD Any thoughts?