[ci skip] update info

This commit is contained in:
ThePhD 2016-08-24 09:17:26 -04:00
parent 1e62e3cde1
commit 0c5d73b67a
6 changed files with 32 additions and 7 deletions

View File

@ -1,4 +1,4 @@
## Sol 2.11 ## Sol 2.12
[![Build Status](https://travis-ci.org/ThePhD/sol2.svg?branch=develop)](https://travis-ci.org/ThePhD/sol2) [![Build Status](https://travis-ci.org/ThePhD/sol2.svg?branch=develop)](https://travis-ci.org/ThePhD/sol2)
[![Documentation Status](https://readthedocs.org/projects/sol2/badge/?version=latest)](http://sol2.readthedocs.io/en/latest/?badge=latest) [![Documentation Status](https://readthedocs.org/projects/sol2/badge/?version=latest)](http://sol2.readthedocs.io/en/latest/?badge=latest)

View File

@ -31,6 +31,7 @@ Browse the various function and classes :doc:`Sol<../index>` utilizes to make yo
optional optional
state state
table table
as_table
metatable_key metatable_key
this_state this_state
thread thread

View File

@ -1,7 +1,7 @@
as_function as_function
=========== ===========
make sure a parameter is pushed as a function make sure an object is pushed as a function
--------------------------------------------- -------------------------------------------
.. code-block:: cpp .. code-block:: cpp

View File

@ -0,0 +1,24 @@
as_table
===========
make sure an object is pushed as a table
----------------------------------------
.. code-block:: cpp
template <typename T>
as_table_t { ... };
template <typename T>
as_table_t<T> as_function ( T&& container );
This function serves the purpose of ensuring that an object is pushed -- if possible -- like a table into Lua. The container passed here can be a pointer, a reference, a ``std::reference_wrapper`` around a container, or just a plain container value. It must have a begin/end function, and if it has a ``std::pair<Key, Value>`` as its ``value_type``, it will be pushed as a dictionary. Otherwise, it's pushed as a sequence.
.. code-block:: cpp
sol::state lua;
lua.open_libraries();
lua.set("my_table", sol::as_table(std::vector<int>{ 1, 2, 3, 4, 5 }));
lua.script("for k, v in ipairs(my_table) do print(k, v) assert(k == v) end");
Note that any caveats with Lua tables apply the moment it is serialized, and the data cannot be gotten out back out in C++ as a vector without explicitly using the ``as_table_t`` marker for your get and conversion operations using Sol.

View File

@ -59,9 +59,9 @@ author = 'ThePhD'
# built documents. # built documents.
# #
# The short X.Y version. # The short X.Y version.
version = '2.11' version = '2.12'
# The full version, including alpha/beta/rc tags. # The full version, including alpha/beta/rc tags.
release = '2.11.7' release = '2.12.0'
# The language for content autogenerated by Sphinx. Refer to documentation # The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages. # for a list of supported languages.

View File

@ -20,8 +20,8 @@
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// This file was generated with a script. // This file was generated with a script.
// Generated 2016-08-24 12:40:13.351588 UTC // Generated 2016-08-24 13:16:37.429596 UTC
// This header was generated with sol v2.11.7 (revision 54cffb7) // This header was generated with sol 2.12.0 (revision 1e62e3c)
// https://github.com/ThePhD/sol2 // https://github.com/ThePhD/sol2
#ifndef SOL_SINGLE_INCLUDE_HPP #ifndef SOL_SINGLE_INCLUDE_HPP