From c467671ae8b6ec161c17e86f3383fd0625f755b8 Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Fri, 19 Aug 2022 19:48:10 -0400 Subject: remove sol2 (will re-add as submodule) --- lib/sol2/docs/source/api/as_container.rst | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 lib/sol2/docs/source/api/as_container.rst (limited to 'lib/sol2/docs/source/api/as_container.rst') diff --git a/lib/sol2/docs/source/api/as_container.rst b/lib/sol2/docs/source/api/as_container.rst deleted file mode 100644 index 917cebb..0000000 --- a/lib/sol2/docs/source/api/as_container.rst +++ /dev/null @@ -1,23 +0,0 @@ -as_container -============ -*force a type to be viewed as a container-type when serialized to Lua* - -.. code-block:: cpp - - template - struct as_returns_t { ... }; - - template - as_returns_t as_returns( T&& ); - - -Sometimes, you have a type whose metatable you claim with a usertype metatable via :doc:`usertype semantics`. But, it still has parts of it that make it behave like a container in C++: A ``value_type`` typedef, an ``iterator`` typedef, a ``begin``, an ``end``, and other things that satisfy the `Container requirements`_ or the `Sequence Container requirements`_ or behaves like a `forward_list`_. - -Whatever the case is, you need it to be returned to Lua and have many of the traits and functionality described in the :doc:`containers documentation<../containers>`. Wrap a return type or a setter in ``sol::as_container( value );`` to allow for a type to be treated like a container, regardless of whether ``sol::is_container`` triggers or not. - -See `this container example`_ to see how it works. - -.. _this container example: https://github.com/ThePhD/sol2/blob/develop/examples/source/container_usertype_as_container.cpp -.. _Container requirements: http://en.cppreference.com/w/cpp/concept/Container -.. _Sequence Container requirements: http://en.cppreference.com/w/cpp/concept/SequenceContainer -.. _forward_list: http://en.cppreference.com/w/cpp/container/forward_list -- cgit v1.2.3