sol2 icon indicating copy to clipboard operation
sol2 copied to clipboard

Usertype created with sol::no_constructor provides function behind "new" key

Open gotschmarcel-ni opened this issue 4 years ago • 2 comments
trafficstars

A usertype declared with sol::no_constructor still has a constructor function in Lua, see the godbolt example: https://godbolt.org/z/oaoeYo3Gn. Might be intentional, but prohibits users to use this key for something else.

gotschmarcel-ni avatar Nov 16 '21 15:11 gotschmarcel-ni

You can use it for whatever you like still:

https://godbolt.org/z/eqr68KP6q

ThePhD avatar Nov 16 '21 16:11 ThePhD

(But I agree: I should just avoid registering it altogether.)

ThePhD avatar Nov 16 '21 16:11 ThePhD