Rapptz / sol

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

Proper std::ref semantics #50

Closed ThePhD closed 9 years ago

ThePhD commented 10 years ago

This pull request ensures proper std::ref semantics and makes get and set on table obey those semantics.

A sol::ref type was added to make the lua.get<sol::ref<T>> less painful than lua.get<std::reference_wrapper<T>> syntax, and sol::ref<T> is just a using alias for std::reference_wrapper.

Rapptz commented 10 years ago

This looks like an API breaking change. If it is, then it might be postponed to v2.0.0 of sol rather than v1.2.0.

ThePhD commented 10 years ago

It's a breaking change of behavior, so this should probably be made a v2.0.0 change.

ThePhD commented 9 years ago

This pull-request's semantics have been sucked into #51 's change log, since it was necessary in the API fixing.