[ci skip] spelling errors

This commit is contained in:
ThePhD 2016-09-13 14:08:44 -04:00
parent 34d844a06f
commit 46b107712f

View File

@ -6,4 +6,8 @@ structures and classes from C++ made available to Lua code (simpler)
This type is no different from :doc:`regular usertype<usertype>`, but allows much of its work to be done at runtime instead of compile-time. The goal here was to avoid compiler complaints about too-large usertypes (some individuals needed to register 190+ functions, and the compiler choked from the templated implementation of ``usertype``). As of Sol 2.14, this implementation has been heavily refactored to allow for all the same syntax and uses of usertype to apply here, with no caveats. This type is no different from :doc:`regular usertype<usertype>`, but allows much of its work to be done at runtime instead of compile-time. The goal here was to avoid compiler complaints about too-large usertypes (some individuals needed to register 190+ functions, and the compiler choked from the templated implementation of ``usertype``). As of Sol 2.14, this implementation has been heavily refactored to allow for all the same syntax and uses of usertype to apply here, with no caveats.
Some developers used ``simple_usertype`` to have variables autoamtically be functions. To achieve this behavior, wrap the desired variable into :doc:`sol::as_function<as_function>`. Some developers used ``simple_usertype`` to have variables automatically be functions. To achieve this behavior, wrap the desired variable into :doc:`sol::as_function<as_function>`.
The performance `seems to be good enough`_ to not warn about any implications of having to serialize things at runtime. You do run the risk of using (slightly?) more memory, however, since variables and functions need to be stored differently and separately from the metatable data itself like with a regular ``usertype``.
.. _seems to be good enough: https://github.com/ThePhD/sol2/issues/202#issuecomment-246767629