diff options
Diffstat (limited to '3rdparty/sol2/docs/source/api/reference.rst')
-rw-r--r-- | 3rdparty/sol2/docs/source/api/reference.rst | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/3rdparty/sol2/docs/source/api/reference.rst b/3rdparty/sol2/docs/source/api/reference.rst index 37886dc2300..57869de7db0 100644 --- a/3rdparty/sol2/docs/source/api/reference.rst +++ b/3rdparty/sol2/docs/source/api/reference.rst @@ -20,8 +20,11 @@ members :caption: constructor: reference reference(lua_State* L, int index = -1); + reference(lua_State* L, ref_index index); + template <typename Object> + reference(Object&& o); -Creates a reference from the Lua stack at the specified index, saving it into the metatable registry. This constructor is exposed on all types that derive from ``sol::reference``. +The first constructor creates a reference from the Lua stack at the specified index, saving it into the metatable registry. The second attemtps to register something that already exists in the registry. The third attempts to reference a pre-existing object and create a reference to it. These constructors are exposed on all types that derive from ``sol::reference``, meaning that you can grab tables, functions, and coroutines from the registry, stack, or from other objects easily. .. code-block:: cpp :caption: function: push referred-to element from the stack |