diff --git a/docs/source/api/state.rst b/docs/source/api/state.rst index 25ae9a6e..451750a0 100644 --- a/docs/source/api/state.rst +++ b/docs/source/api/state.rst @@ -73,4 +73,25 @@ Get either the global table or the Lua registry as a :doc:`sol::table`, w Overrides the panic function Lua calls when something unrecoverable or unexpected happens in the Lua VM. Must be a function of the that matches the ``int(*)(lua_State*)`` function signature. +.. code-block:: cpp + :caption: function: make a thread + + thread create(); + static thread create (lua_State* L); + +Creates a thread. Forwards its arguments to :ref:`thread::create`. + +.. code-block:: cpp + :caption: function: make a table + + table create_table(int narr = 0, int nrec = 0); + template + table create_table(int narr, int nrec, Key&& key, Value&& value, Args&&... args); + + static table create_table(lua_State* L, int narr = 0, int nrec = 0); + template + static table create_table(lua_State* L, int narr, int nrec, Key&& key, Value&& value, Args&&... args); + +Creates a table. Forwards its arguments to :ref:`table::create`. + .. _standard lua libraries: http://www.lua.org/manual/5.2/manual.html#6 \ No newline at end of file diff --git a/docs/source/api/table.rst b/docs/source/api/table.rst index 181a237d..3d8cd598 100644 --- a/docs/source/api/table.rst +++ b/docs/source/api/table.rst @@ -109,7 +109,12 @@ Sets the desired function to the specified key value. Note that it also allows f .. code-block:: cpp :caption: function: create a table with defaults + :name: table-create + table create(int narr = 0, int nrec = 0); + template + table create(int narr, int nrec, Key&& key, Value&& value, Args&&... args); + static table create(lua_State* L, int narr = 0, int nrec = 0); template static table create(lua_State* L, int narr, int nrec, Key&& key, Value&& value, Args&&... args); diff --git a/docs/source/api/thread.rst b/docs/source/api/thread.rst index 3aba938d..40104472 100644 --- a/docs/source/api/thread.rst +++ b/docs/source/api/thread.rst @@ -36,8 +36,10 @@ This function retrieves the ``lua_State*`` that represents the thread. Retrieves the :doc:`thread status` that describes the current state of the thread. .. code-block:: cpp - :caption: thread creation + :caption: function: thread creation + :name: thread-create + thread create(); static thread create (lua_State* L); Creates a new thread from the given a ``lua_State*``. \ No newline at end of file diff --git a/sol/state_view.hpp b/sol/state_view.hpp index 7fa1d64c..fe373964 100644 --- a/sol/state_view.hpp +++ b/sol/state_view.hpp @@ -24,6 +24,7 @@ #include "error.hpp" #include "table.hpp" +#include "thread.hpp" #include namespace sol {