|
@@ -8,7 +8,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- <title>Advanced - Luwra</title>
|
|
|
|
|
|
|
+ <title>Advanced Stack Interaction - Luwra</title>
|
|
|
|
|
|
|
|
|
|
|
|
|
<link rel="shortcut icon" href="../img/favicon.ico">
|
|
<link rel="shortcut icon" href="../img/favicon.ico">
|
|
@@ -23,7 +23,7 @@
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
// Current page data
|
|
// Current page data
|
|
|
- var mkdocs_page_name = "Advanced";
|
|
|
|
|
|
|
+ var mkdocs_page_name = "Advanced Stack Interaction";
|
|
|
var mkdocs_page_input_path = "advanced.md";
|
|
var mkdocs_page_input_path = "advanced.md";
|
|
|
var mkdocs_page_url = "/advanced/";
|
|
var mkdocs_page_url = "/advanced/";
|
|
|
</script>
|
|
</script>
|
|
@@ -63,14 +63,14 @@
|
|
|
|
|
|
|
|
<li>
|
|
<li>
|
|
|
<li class="toctree-l1 ">
|
|
<li class="toctree-l1 ">
|
|
|
- <a class="" href="../basics/">Basics</a>
|
|
|
|
|
|
|
+ <a class="" href="../basics/">Basic Stack Interaction</a>
|
|
|
|
|
|
|
|
</li>
|
|
</li>
|
|
|
<li>
|
|
<li>
|
|
|
|
|
|
|
|
<li>
|
|
<li>
|
|
|
<li class="toctree-l1 current">
|
|
<li class="toctree-l1 current">
|
|
|
- <a class="current" href="./">Advanced</a>
|
|
|
|
|
|
|
+ <a class="current" href="./">Advanced Stack Interaction</a>
|
|
|
|
|
|
|
|
<ul>
|
|
<ul>
|
|
|
|
|
|
|
@@ -83,13 +83,6 @@
|
|
|
|
|
|
|
|
</ul>
|
|
</ul>
|
|
|
|
|
|
|
|
- </li>
|
|
|
|
|
-<li>
|
|
|
|
|
-
|
|
|
|
|
- <li>
|
|
|
|
|
- <li class="toctree-l1 ">
|
|
|
|
|
- <a class="" href="../miscellaneous/">Miscellaneous</a>
|
|
|
|
|
-
|
|
|
|
|
</li>
|
|
</li>
|
|
|
<li>
|
|
<li>
|
|
|
|
|
|
|
@@ -115,7 +108,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- <li>Advanced</li>
|
|
|
|
|
|
|
+ <li>Advanced Stack Interaction</li>
|
|
|
<li class="wy-breadcrumbs-aside">
|
|
<li class="wy-breadcrumbs-aside">
|
|
|
|
|
|
|
|
|
|
|
|
@@ -133,7 +126,7 @@
|
|
|
<p>Instead of extracting every Lua value seperately and pushing the result of your C++ function back
|
|
<p>Instead of extracting every Lua value seperately and pushing the result of your C++ function back
|
|
|
onto the stack again, you can use one of the following functions to make this process easier for you.</p>
|
|
onto the stack again, you can use one of the following functions to make this process easier for you.</p>
|
|
|
<h2 id="invoke-a-callable-with-lua-values">Invoke a Callable with Lua values</h2>
|
|
<h2 id="invoke-a-callable-with-lua-values">Invoke a Callable with Lua values</h2>
|
|
|
-<p>The function <a href="../reference/namespaceluwra.html#aa20e363f38b3ae5a168cf40365f5646a">direct</a>
|
|
|
|
|
|
|
+<p>The function <a href="../reference/namespaceluwra.html#aa20e363f38b3ae5a168cf40365f5646a">direct<S></a>
|
|
|
lets you specify a <em>stack signature</em> in order to extract the values and invoke a <code>Callable</code> with
|
|
lets you specify a <em>stack signature</em> in order to extract the values and invoke a <code>Callable</code> with
|
|
|
them.</p>
|
|
them.</p>
|
|
|
<p>Consider the following:</p>
|
|
<p>Consider the following:</p>
|
|
@@ -144,7 +137,7 @@ them.</p>
|
|
|
<pre><code class="c++">string result = luwra::direct<string(string, int)>(lua, n, foo);
|
|
<pre><code class="c++">string result = luwra::direct<string(string, int)>(lua, n, foo);
|
|
|
</code></pre>
|
|
</code></pre>
|
|
|
|
|
|
|
|
-<p><strong>Note:</strong> The result of <code>foo</code> is not pushed onto the stack. Besides the extraction of Lua values
|
|
|
|
|
|
|
+<p><strong>Note:</strong> The result of <code>foo</code> is not pushed onto the stack. Except for the extraction of Lua values,
|
|
|
everything happens on the C++ side.</p>
|
|
everything happens on the C++ side.</p>
|
|
|
<h2 id="invoke-a-function-with-lua-values">Invoke a function with Lua values</h2>
|
|
<h2 id="invoke-a-function-with-lua-values">Invoke a function with Lua values</h2>
|
|
|
<p><a href="../reference/namespaceluwra.html#a839077ddd9c3d0565a40c574bc8e9555">apply</a> is similiar to
|
|
<p><a href="../reference/namespaceluwra.html#a839077ddd9c3d0565a40c574bc8e9555">apply</a> is similiar to
|
|
@@ -156,7 +149,7 @@ allows the compiler to infer the <em>stack signature</em> without providing a te
|
|
|
<pre><code class="c++">string foo(string bar, int baz);
|
|
<pre><code class="c++">string foo(string bar, int baz);
|
|
|
|
|
|
|
|
// ... or with a function object
|
|
// ... or with a function object
|
|
|
-std::function<string(string, int)> foo = /* magic */;
|
|
|
|
|
|
|
+function<string(string, int)> foo = /* magic */;
|
|
|
</code></pre>
|
|
</code></pre>
|
|
|
|
|
|
|
|
<p>One would use <code>foo</code> like this:</p>
|
|
<p>One would use <code>foo</code> like this:</p>
|
|
@@ -169,10 +162,8 @@ std::function<string(string, int)> foo = /* magic */;
|
|
|
|
|
|
|
|
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
|
|
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
|
|
|
|
|
|
|
|
- <a href="../miscellaneous/" class="btn btn-neutral float-right" title="Miscellaneous">Next <span class="icon icon-circle-arrow-right"></span></a>
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
- <a href="../basics/" class="btn btn-neutral" title="Basics"><span class="icon icon-circle-arrow-left"></span> Previous</a>
|
|
|
|
|
|
|
+ <a href="../basics/" class="btn btn-neutral" title="Basic Stack Interaction"><span class="icon icon-circle-arrow-left"></span> Previous</a>
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
@@ -203,8 +194,6 @@ std::function<string(string, int)> foo = /* magic */;
|
|
|
<span><a href="../basics/" style="color: #fcfcfc;">« Previous</a></span>
|
|
<span><a href="../basics/" style="color: #fcfcfc;">« Previous</a></span>
|
|
|
|
|
|
|
|
|
|
|
|
|
- <span style="margin-left: 15px"><a href="../miscellaneous/" style="color: #fcfcfc">Next »</a></span>
|
|
|
|
|
-
|
|
|
|
|
</span>
|
|
</span>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|