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/c_call.rst | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 lib/sol2/docs/source/api/c_call.rst (limited to 'lib/sol2/docs/source/api/c_call.rst') diff --git a/lib/sol2/docs/source/api/c_call.rst b/lib/sol2/docs/source/api/c_call.rst deleted file mode 100644 index 505a8c3..0000000 --- a/lib/sol2/docs/source/api/c_call.rst +++ /dev/null @@ -1,29 +0,0 @@ -c_call -====== -*templated type to transport functions through templates* - - -.. code-block:: cpp - - template - int c_call (lua_State* L); - - template - int c_call (lua_State* L); - -The goal of ``sol::c_call<...>`` is to provide a way to wrap a function and transport it through a compile-time context. This enables faster speed at the cost of a much harder to read / poorer interface, and can alleviate some template compilation speed issues. ``sol::c_call`` expects a type for its first template argument, and a value of the previously provided type for the second template argument. To make a compile-time transported overloaded function, specify multiple functions in the same ``type, value`` pairing, but put it inside of a ``sol::wrap``. - -.. note:: - - This can also be placed into the argument list for a :doc:`usertype` as well. - -This pushes a raw ``lua_CFunction`` into whatever you pass the resulting ``c_call`` function pointer into, whether it be a table or a userdata or whatever else using sol3's API. The resulting ``lua_CFunction`` can also be used directly with the lua API, just like many of sol3's types can be intermingled with Lua's API if you know what you're doing. - -It is advisable for the user to consider making a macro to do the necessary ``decltype( &function_name, ), function_name``. sol does not provide one because many codebases already have `one similar to this`_. - -Here's an example below of various ways to use ``sol::c_call``: - -.. literalinclude:: ../../../examples/source/c_call.cpp - :linenos: - -.. _one similar to this: http://stackoverflow.com/a/5628222/5280922 -- cgit v1.2.3