diff --git a/docs/source/api/make_reference.rst b/docs/source/api/make_reference.rst index 2686a3ab..cd39b5a3 100644 --- a/docs/source/api/make_reference.rst +++ b/docs/source/api/make_reference.rst @@ -23,4 +23,4 @@ Makes an ``R`` out of the value. The first overload deduces the type from the pa template object make_object(lua_State* L, Args&&... args); -Makes an object out of the value. It pushes it onto the stack, then pops it into the returned ``sol::object``. The first overload deduces the type from the passed in argument, the second allows you to specify a template parameter and forward any relevant arguments to ``sol::stack::push``. The implementation essentially defers to :ref:`sol::make_reference` with the specified arguments, ``R == object`` and ``should_pop == true``. +Makes an object out of the value. It pushes it onto the stack, then pops it into the returned ``sol::object``. The first overload deduces the type from the passed in argument, the second allows you to specify a template parameter and forward any relevant arguments to ``sol::stack::push``. The implementation essentially defers to :ref:`sol::make_reference` with the specified arguments, ``R == object`` and ``should_pop == true``. It is preferred that one uses the :ref:`in_place object constructor instead`, since it's probably easier to deal with, but both versions will be supported for forever, since there's really no reason not to and people already have dependencies on ``sol::make_object``. diff --git a/docs/source/api/object.rst b/docs/source/api/object.rst index b168df2c..f38f089c 100644 --- a/docs/source/api/object.rst +++ b/docs/source/api/object.rst @@ -16,6 +16,7 @@ members .. code-block:: cpp :caption: overloaded constructor: object + :name: overloaded-object-constructor template object(T&&); @@ -25,7 +26,7 @@ members template object(lua_State* L, in_place_type_t, Args&&... args); -There are 4 kinds of constructors here. One allows construction of a object from other reference types such as :doc:`sol::table` and :doc:`sol::stack_reference`. The secon creates an object which references the specific element at the given index in the specified ``lua_State*``. The more advanced ``in_place...`` constructors create a single object by pushing the specified type ``T`` onto the stack and then setting it as the object. It gets popped from the stack afterwards (unless this is an instance of ``sol::stack_object``, in which case it is left on the stack). An example of using this and :doc:`sol::make_object` can be found in the `any_return example`_ +There are 4 kinds of constructors here. One allows construction of an object from other reference types such as :doc:`sol::table
` and :doc:`sol::stack_reference`. The second creates an object which references the specific element at the given index in the specified ``lua_State*``. The more advanced ``in_place...`` constructors create a single object by pushing the specified type ``T`` onto the stack and then setting it as the object. It gets popped from the stack afterwards (unless this is an instance of ``sol::stack_object``, in which case it is left on the stack). An example of using this and :doc:`sol::make_object` can be found in the `any_return example`_. .. code-block:: cpp :caption: function: type conversion