Rapptz / sol

A C++11 Lua wrapper
MIT License
208 stars 32 forks source link

Const value returns for lua functions: make values out of them #44

Closed ThePhD closed 10 years ago

ThePhD commented 10 years ago

Solves Issue #42's underlying problem (member-function defined operator overloads still work). Return values which are const should be converted to values so that they can be put into the lua system. Lua has no concept of const, and thusly anything returned const should be copied and made into a value.

Also, moved userdata<T> initialization for meta variable names and meta function names, as they were being instantiated multiple times for various T even though the values were exactly the same.

Also adds a header to make for easy solving of Issue #43, due to overloaded functions on userdata.

notlion commented 10 years ago

Just tested and works for me. Thanks for the fix!