mirror of
https://github.com/ThePhD/sol2.git
synced 2024-03-22 13:10:44 +08:00
Indentation fixes
This commit is contained in:
parent
42f4455383
commit
30415845df
|
@ -43,6 +43,7 @@ the basics:
|
|||
.. note::
|
||||
More examples can be found in the `examples directory`_
|
||||
|
||||
|
||||
.. code-block:: c++
|
||||
:caption: functions
|
||||
:linenos:
|
||||
|
@ -64,6 +65,7 @@ the basics:
|
|||
return 0;
|
||||
}
|
||||
|
||||
|
||||
.. code-block:: c++
|
||||
:caption: linking C++ structures to Lua
|
||||
:linenos:
|
||||
|
|
|
@ -18,6 +18,6 @@ If you're already using lua and you just want to use ``sol`` in some places, you
|
|||
// start using it...
|
||||
}
|
||||
|
||||
Sol has no initialization components that need to deliberately remain alive for the duration of the program. It's entirely self-containing and uses lua's garbage collectors and various implementation techniques to require no state C++-side. After you do that, all of the power of `Sol` is available to you, and then some!
|
||||
:doc:`sol::state_view<../api/state` is exactly like ``sol::state``, but it doesn't manage the lifetime of a ``lua_State*``. Therefore, you get all the goodies that come with a ``sol::state`` without any of the ownership implications. Sol has no initialization components that need to deliberately remain alive for the duration of the program. It's entirely self-containing and uses lua's garbage collectors and various implementation techniques to require no state C++-side. After you do that, all of the power of `Sol` is available to you, and then some!
|
||||
|
||||
Remember that Sol can be as lightweight as you want it: almost all of Sol's types take the ``lua_State*`` argument and then a second ``int index`` stack index argument, meaning you can use :doc:`tables<../api/table>`, :doc:`lua functions<../api/function>`, :doc:`coroutines<../api/coroutine>`, and other reference-derived objects that expose the proper constructor for your use. You can also set :doc:`usertypes<../api/usertype>` and other things you need without changing your entire architecture!
|
|
@ -46,7 +46,7 @@ If this works, you're ready to start! The first line creates the ``lua_State`` a
|
|||
.. code-block:: cpp
|
||||
:linenos:
|
||||
:caption: test.cpp: the first snippet
|
||||
:name: the-first-snippet
|
||||
:name: the-second-snippet
|
||||
|
||||
#include <sol.hpp>
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user