From dc2493e7525bb7633f697ef10f72b72b46222249 Mon Sep 17 00:00:00 2001 From: Andy Belle-Isle Date: Fri, 30 Aug 2019 00:45:36 -0400 Subject: Forget what I said, I just need to change git attributes to mark for vendor --- deps/sol2/docs/source/api/as_table.rst | 33 --------------------------------- 1 file changed, 33 deletions(-) delete mode 100644 deps/sol2/docs/source/api/as_table.rst (limited to 'deps/sol2/docs/source/api/as_table.rst') diff --git a/deps/sol2/docs/source/api/as_table.rst b/deps/sol2/docs/source/api/as_table.rst deleted file mode 100644 index 28c0636..0000000 --- a/deps/sol2/docs/source/api/as_table.rst +++ /dev/null @@ -1,33 +0,0 @@ -as_table -=========== -*make sure an object is pushed as a table* - - -.. code-block:: cpp - - template - as_table_t { - T& value() &; - const T& value() & const; - T&& value() &&; - }; - - template - as_table_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`` as its ``value_type``, it will be pushed as a dictionary. Otherwise, it's pushed as a sequence. - -.. literalinclude:: ../../../examples/source/docs/as_table_ipairs.cpp - :linenos: - -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 C++ type. You can deserialize the Lua table into something explicitly using the ``sol::as_table_t`` marker for your get and conversion operations using sol. At that point, the returned type is deserialized **from** a table, meaning you cannot reference any kind of C++ data directly as you do with regular userdata/usertypes. *All C++ type information is lost upon serialization into Lua.* - -If you need this functionality with a member variable, use a :doc:`property on a getter function` that returns the result of ``sol::as_table``. - -This marker does NOT apply to :doc:`usertypes`. - -You can also use this to nest types and retrieve tables within tables as shown by this example. - -.. literalinclude:: ../../../examples/source/containers_as_table.cpp - :linenos: - :lines: 1-8,31-60,62-68,70- -- cgit v1.2.3