Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updated luabind to 0.9.1

  • Loading branch information...
commit f90c3b93521a6f7c7f3f82b5430c18e3d228df62 1 parent 0b388fc
Yohann Ferreira authored
Showing with 277 additions and 471 deletions.
  1. 0  src/luabind/INSTALL
  2. 0  src/luabind/LICENSE
  3. 0  src/luabind/doc/building.rst
  4. 0  src/luabind/doc/changes.txt
  5. +205 −205 src/luabind/doc/docs.html
  6. 0  src/luabind/doc/index.html
  7. 0  src/luabind/doc/luabind-logo-label.ps
  8. 0  src/luabind/doc/style.css
  9. +1 −1  src/luabind/doc/version.rst
  10. 0  src/luabind/examples/cln/README
  11. 0  src/luabind/examples/cln/cln_test.lua
  12. 0  src/luabind/examples/filesystem/directory_iterator.hpp
  13. 0  src/luabind/examples/filesystem/filesystem.cpp
  14. 0  src/luabind/examples/glut/glut_bindings.lua
  15. 0  src/luabind/examples/hello_world/README
  16. 0  src/luabind/examples/hello_world/hello_world.cpp
  17. 0  src/luabind/examples/hello_world/project-root.jam
  18. 0  src/luabind/examples/regexp/regex.lua
  19. 0  src/luabind/luabind/back_reference.hpp
  20. 0  src/luabind/luabind/back_reference_fwd.hpp
  21. +0 −1  src/luabind/luabind/class.hpp
  22. 0  src/luabind/luabind/class_info.hpp
  23. 0  src/luabind/luabind/detail/call_operator_iterate.hpp
  24. 0  src/luabind/luabind/detail/class_cache.hpp
  25. +3 −1 src/luabind/luabind/detail/constructor.hpp
  26. 0  src/luabind/luabind/detail/debug.hpp
  27. +2 −9 src/luabind/luabind/detail/format_signature.hpp
  28. +0 −218 src/luabind/luabind/detail/get_signature.hpp
  29. 0  src/luabind/luabind/detail/has_get_pointer.hpp
  30. +1 −1  src/luabind/luabind/detail/instance_holder.hpp
  31. 0  src/luabind/luabind/detail/is_indirect_const.hpp
  32. 0  src/luabind/luabind/detail/link_compatibility.hpp
  33. 0  src/luabind/luabind/detail/most_derived.hpp
  34. 0  src/luabind/luabind/detail/object_call.hpp
  35. +1 −1  src/luabind/luabind/detail/object_rep.hpp
  36. 0  src/luabind/luabind/detail/pcall.hpp
  37. 0  src/luabind/luabind/detail/pointee_sizeof.hpp
  38. 0  src/luabind/luabind/detail/pointee_typeid.hpp
  39. 0  src/luabind/luabind/detail/stack_utils.hpp
  40. 0  src/luabind/luabind/detail/yes_no.hpp
  41. 0  src/luabind/luabind/error.hpp
  42. 0  src/luabind/luabind/from_stack.hpp
  43. 0  src/luabind/luabind/get_pointer.hpp
  44. +9 −0 src/luabind/luabind/handle.hpp
  45. 0  src/luabind/luabind/iterator_policy.hpp
  46. +6 −0 src/luabind/luabind/lua_include.hpp
  47. +6 −1 src/luabind/luabind/make_function.hpp
  48. +2 −2 src/luabind/luabind/object.hpp
  49. 0  src/luabind/luabind/open.hpp
  50. +1 −1  src/luabind/luabind/operator.hpp
  51. 0  src/luabind/luabind/prefix.hpp
  52. 0  src/luabind/luabind/raw_policy.hpp
  53. +2 −0  src/luabind/luabind/scope.hpp
  54. +1 −1  src/luabind/luabind/shared_ptr_converter.hpp
  55. 0  src/luabind/luabind/value_wrapper.hpp
  56. +1 −1  src/luabind/luabind/weak_ref.hpp
  57. 0  src/luabind/luabind/wrapper_base.hpp
  58. 0  src/luabind/luabind/yield_policy.hpp
  59. +1 −1  src/luabind/src/class.cpp
  60. 0  src/luabind/src/class_info.cpp
  61. 0  src/luabind/src/class_registry.cpp
  62. +1 −7 src/luabind/src/class_rep.cpp
  63. 0  src/luabind/src/create_class.cpp
  64. 0  src/luabind/src/error.cpp
  65. +7 −7 src/luabind/src/inheritance.cpp
  66. 0  src/luabind/src/link_compatibility.cpp
  67. 0  src/luabind/src/object_rep.cpp
  68. +3 −3 src/luabind/src/open.cpp
  69. 0  src/luabind/src/pcall.cpp
  70. +8 −0 src/luabind/src/scope.cpp
  71. 0  src/luabind/src/stack_content_by_name.cpp
  72. +9 −9 src/luabind/src/weak_ref.cpp
  73. 0  src/luabind/src/wrapper_base.cpp
  74. 0  src/luabind/test/test.hpp
  75. 0  src/luabind/test/test_abstract_base.cpp
  76. 0  src/luabind/test/test_back_reference.cpp
  77. 0  src/luabind/test/test_def_from_base.cpp
  78. +7 −1 src/luabind/test/test_exceptions.cpp
  79. 0  src/luabind/test/test_has_get_pointer.cpp
  80. 0  src/luabind/test/test_iterator.cpp
  81. 0  src/luabind/test/test_scope.cpp
  82. 0  src/luabind/test/test_separation.cpp
  83. 0  src/luabind/test/test_simple_class.cpp
  84. 0  src/luabind/test/test_value_wrapper.cpp
  85. 0  src/luabind/test/test_vector_of_object.cpp
  86. 0  src/luabind/test/test_yield.cpp
View
0  src/luabind/INSTALL 100755 → 100644
File mode changed
View
0  src/luabind/LICENSE 100755 → 100644
File mode changed
View
0  src/luabind/doc/building.rst 100755 → 100644
File mode changed
View
0  src/luabind/doc/changes.txt 100755 → 100644
File mode changed
View
410 src/luabind/doc/docs.html 100755 → 100644
@@ -3,8 +3,8 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<meta name="generator" content="Docutils 0.5: http://docutils.sourceforge.net/" />
-<title>luabind 0.9</title>
+<meta name="generator" content="Docutils 0.8: http://docutils.sourceforge.net/" />
+<title>luabind 0.9.1</title>
<meta name="author" content="Daniel Wallin, Arvid Norberg" />
<meta name="copyright" content="Copyright Daniel Wallin, Arvid Norberg 2003." />
<style type="text/css">
@@ -306,7 +306,7 @@
</head>
<body>
<div class="document" id="luabind-version">
-<h1 class="title">luabind 0.9</h1>
+<h1 class="title">luabind 0.9.1</h1>
<table class="docinfo" frame="void" rules="none">
<col class="docinfo-name" />
<col class="docinfo-content" />
@@ -437,7 +437,7 @@ <h1 class="title">luabind 0.9</h1>
<p>We are very interested in hearing about projects that use luabind, please let
us know about your project.</p>
<p>The main channel for help and feedback is the <a class="reference external" href="https://lists.sourceforge.net/lists/listinfo/luabind-user">luabind mailing list</a>.
-There's also an IRC channel <tt class="docutils literal"><span class="pre">#luabind</span></tt> on irc.freenode.net.</p>
+There's also an IRC channel <tt class="docutils literal">#luabind</tt> on irc.freenode.net.</p>
</div>
<div class="section" id="features">
<h1>2&nbsp;&nbsp;&nbsp;Features</h1>
@@ -501,11 +501,11 @@ <h1 class="title">luabind 0.9</h1>
</div>
<div class="section" id="windows">
<h2>4.2&nbsp;&nbsp;&nbsp;Windows</h2>
-<p>The environment varaible <tt class="docutils literal"><span class="pre">LUA_PATH</span></tt> needs to be set to point to a
+<p>The environment varaible <tt class="docutils literal">LUA_PATH</tt> needs to be set to point to a
directory containing the Lua include directory and built libraries. At
least for the purpose of running the test suite, the recommended way to
get these is the <a class="reference external" href="http://luabinaries.luaforge.net">Lua Binaries</a> <em>Windows x86 DLL and Includes</em> package.</p>
-<p>Furthermore, the environment variable <tt class="docutils literal"><span class="pre">BOOST_ROOT</span></tt> must point to
+<p>Furthermore, the environment variable <tt class="docutils literal">BOOST_ROOT</tt> must point to
a Boost installation directory.</p>
</div>
<div class="section" id="linux-and-other-nix-flavors">
@@ -513,8 +513,8 @@ <h1 class="title">luabind 0.9</h1>
<p>If your system already has Lua installed, it is very likely that the
build system will automatically find it and just work. If you have
Lua installed in a non-standard location, you may need to set
-<tt class="docutils literal"><span class="pre">LUA_PATH</span></tt> to point to the installation prefix.</p>
-<p><tt class="docutils literal"><span class="pre">BOOST_ROOT</span></tt> can be set to a Boost installation directory. If left
+<tt class="docutils literal">LUA_PATH</tt> to point to the installation prefix.</p>
+<p><tt class="docutils literal">BOOST_ROOT</tt> can be set to a Boost installation directory. If left
unset, the build system will try to use boost headers from the standard
include path.</p>
<div class="section" id="macosx">
@@ -531,7 +531,7 @@ <h1 class="title">luabind 0.9</h1>
<div class="section" id="building-and-testing">
<h2>4.4&nbsp;&nbsp;&nbsp;Building and testing</h2>
<p>Building the default variant of the library, which is a shared debug
-library, is simply done by invoking <tt class="docutils literal"><span class="pre">bjam</span></tt> in the luabind root
+library, is simply done by invoking <tt class="docutils literal">bjam</tt> in the luabind root
directory:</p>
<pre class="literal-block">
$ bjam
@@ -544,7 +544,7 @@ <h1 class="title">luabind 0.9</h1>
bin/gcc-4.2.3/debug/libluabind.so
</pre>
<p>On Windows a dll and matching import library would be produced.</p>
-<p>To run the unit tests, invoke <tt class="docutils literal"><span class="pre">bjam</span></tt> with the <tt class="docutils literal"><span class="pre">test</span></tt> target:</p>
+<p>To run the unit tests, invoke <tt class="docutils literal">bjam</tt> with the <tt class="docutils literal">test</tt> target:</p>
<pre class="literal-block">
$ bjam test
</pre>
@@ -560,13 +560,13 @@ <h1 class="title">luabind 0.9</h1>
...skipped <em>xxx</em> targets...
</pre>
<p>If you are not using Boost Build to build your application, and want to
-use the shared library variant, <tt class="docutils literal"><span class="pre">LUABIND_DYNAMIC_LINK</span></tt> needs to be
+use the shared library variant, <tt class="docutils literal">LUABIND_DYNAMIC_LINK</tt> needs to be
defined to properly import symbols.</p>
</div>
</div>
<div class="section" id="basic-usage">
<h1>5&nbsp;&nbsp;&nbsp;Basic usage</h1>
-<p>To use luabind, you must include <tt class="docutils literal"><span class="pre">lua.h</span></tt> and luabind's main header file:</p>
+<p>To use luabind, you must include <tt class="docutils literal">lua.h</tt> and luabind's main header file:</p>
<pre class="literal-block">
extern &quot;C&quot;
{
@@ -577,7 +577,7 @@ <h1 class="title">luabind 0.9</h1>
</pre>
<p>This includes support for both registering classes and functions. If you just
want to have support for functions or classes you can include
-<tt class="docutils literal"><span class="pre">luabind/function.hpp</span></tt> and <tt class="docutils literal"><span class="pre">luabind/class.hpp</span></tt> separately:</p>
+<tt class="docutils literal">luabind/function.hpp</tt> and <tt class="docutils literal">luabind/class.hpp</tt> separately:</p>
<pre class="literal-block">
#include &lt;luabind/function.hpp&gt;
#include &lt;luabind/class.hpp&gt;
@@ -591,8 +591,8 @@ <h1 class="title">luabind 0.9</h1>
on the class being there. Everything will be cleaned up when the state is
closed though.</p>
<!-- Isn't this wrong? Don't we include lua.h using lua_include.hpp ? -->
-<p>Luabind's headers will never include <tt class="docutils literal"><span class="pre">lua.h</span></tt> directly, but through
-<tt class="docutils literal"><span class="pre">&lt;luabind/lua_include.hpp&gt;</span></tt>. If you for some reason need to include another
+<p>Luabind's headers will never include <tt class="docutils literal">lua.h</tt> directly, but through
+<tt class="docutils literal">&lt;luabind/lua_include.hpp&gt;</tt>. If you for some reason need to include another
Lua header, you can modify this file.</p>
<div class="section" id="hello-world">
<h2>5.1&nbsp;&nbsp;&nbsp;Hello world</h2>
@@ -712,7 +712,7 @@ <h1 class="title">luabind 0.9</h1>
are treated by the function, this is an optional parameter. More on this in
the <a class="reference internal" href="#policies">policies</a> section.</li>
</ul>
-<p>An example usage could be if you want to register the function <tt class="docutils literal"><span class="pre">float</span>
+<p>An example usage could be if you want to register the function <tt class="docutils literal">float
<span class="pre">std::sin(float)</span></tt>:</p>
<pre class="literal-block">
module(L)
@@ -724,8 +724,8 @@ <h1 class="title">luabind 0.9</h1>
<h2>7.1&nbsp;&nbsp;&nbsp;Overloaded functions</h2>
<p>If you have more than one function with the same name, and want to register
them in Lua, you have to explicitly give the signature. This is to let C++ know
-which function you refer to. For example, if you have two functions, <tt class="docutils literal"><span class="pre">int</span>
-<span class="pre">f(const</span> <span class="pre">char*)</span></tt> and <tt class="docutils literal"><span class="pre">void</span> <span class="pre">f(int)</span></tt>.</p>
+which function you refer to. For example, if you have two functions, <tt class="docutils literal">int
+f(const char*)</tt> and <tt class="docutils literal">void f(int)</tt>.</p>
<pre class="literal-block">
module(L)
[
@@ -789,15 +789,15 @@ <h1 class="title">luabind 0.9</h1>
</div>
<div class="section" id="calling-lua-functions">
<h2>7.3&nbsp;&nbsp;&nbsp;Calling Lua functions</h2>
-<p>To call a Lua function, you can either use <tt class="docutils literal"><span class="pre">call_function()</span></tt> or
-an <tt class="docutils literal"><span class="pre">object</span></tt>.</p>
+<p>To call a Lua function, you can either use <tt class="docutils literal">call_function()</tt> or
+an <tt class="docutils literal">object</tt>.</p>
<pre class="literal-block">
template&lt;class Ret&gt;
Ret call_function(lua_State* L, const char* name, ...)
template&lt;class Ret&gt;
Ret call_function(object const&amp; obj, ...)
</pre>
-<p>There are two overloads of the <tt class="docutils literal"><span class="pre">call_function</span></tt> function, one that calls
+<p>There are two overloads of the <tt class="docutils literal">call_function</tt> function, one that calls
a function given its name, and one that takes an object that should be a Lua
value that can be called as a function.</p>
<p>The overload that takes a name can only call global Lua functions. The ...
@@ -822,12 +822,12 @@ <h1 class="title">luabind 0.9</h1>
int ret = call_function(L, &quot;fun&quot;, boost::ref(val));
</pre>
<p>If you want to use a custom error handler for the function call, see
-<tt class="docutils literal"><span class="pre">set_pcall_callback</span></tt> under <a class="reference internal" href="#pcall-errorfunc">pcall errorfunc</a>.</p>
+<tt class="docutils literal">set_pcall_callback</tt> under <a class="reference internal" href="#pcall-errorfunc">pcall errorfunc</a>.</p>
</div>
<div class="section" id="using-lua-threads">
<h2>7.4&nbsp;&nbsp;&nbsp;Using Lua threads</h2>
-<p>To start a Lua thread, you have to call <tt class="docutils literal"><span class="pre">lua_resume()</span></tt>, this means that you
-cannot use the previous function <tt class="docutils literal"><span class="pre">call_function()</span></tt> to start a thread. You have
+<p>To start a Lua thread, you have to call <tt class="docutils literal">lua_resume()</tt>, this means that you
+cannot use the previous function <tt class="docutils literal">call_function()</tt> to start a thread. You have
to use</p>
<pre class="literal-block">
template&lt;class Ret&gt;
@@ -841,14 +841,14 @@ <h1 class="title">luabind 0.9</h1>
Ret resume(lua_State* L, ...)
</pre>
<p>The first time you start the thread, you have to give it a function to execute. i.e. you
-have to use <tt class="docutils literal"><span class="pre">resume_function</span></tt>, when the Lua function yields, it will return the first
-value passed in to <tt class="docutils literal"><span class="pre">lua_yield()</span></tt>. When you want to continue the execution, you just call
-<tt class="docutils literal"><span class="pre">resume()</span></tt> on your <tt class="docutils literal"><span class="pre">lua_State</span></tt>, since it's already executing a function, you don't pass
-it one. The parameters to <tt class="docutils literal"><span class="pre">resume()</span></tt> will be returned by <tt class="docutils literal"><span class="pre">yield()</span></tt> on the Lua side.</p>
+have to use <tt class="docutils literal">resume_function</tt>, when the Lua function yields, it will return the first
+value passed in to <tt class="docutils literal">lua_yield()</tt>. When you want to continue the execution, you just call
+<tt class="docutils literal">resume()</tt> on your <tt class="docutils literal">lua_State</tt>, since it's already executing a function, you don't pass
+it one. The parameters to <tt class="docutils literal">resume()</tt> will be returned by <tt class="docutils literal">yield()</tt> on the Lua side.</p>
<p>For yielding C++-functions (without the support of passing data back and forth between the
Lua side and the c++ side), you can use the <a class="reference internal" href="#yield">yield</a> policy.</p>
-<p>With the overload of <tt class="docutils literal"><span class="pre">resume_function</span></tt> that takes an <a class="reference internal" href="#object">object</a>, it is important that the
-object was constructed with the thread as its <tt class="docutils literal"><span class="pre">lua_State*</span></tt>. Like this:</p>
+<p>With the overload of <tt class="docutils literal">resume_function</tt> that takes an <a class="reference internal" href="#object">object</a>, it is important that the
+object was constructed with the thread as its <tt class="docutils literal">lua_State*</tt>. Like this:</p>
<pre class="literal-block">
lua_State* thread = lua_newthread(L);
object fun = get_global(<strong>thread</strong>)[&quot;my_thread_fun&quot;];
@@ -858,9 +858,9 @@ <h1 class="title">luabind 0.9</h1>
</div>
<div class="section" id="binding-classes-to-lua">
<h1>8&nbsp;&nbsp;&nbsp;Binding classes to Lua</h1>
-<p>To register classes you use a class called <tt class="docutils literal"><span class="pre">class_</span></tt>. Its name is supposed to
+<p>To register classes you use a class called <tt class="docutils literal">class_</tt>. Its name is supposed to
resemble the C++ keyword, to make it look more intuitive. It has an overloaded
-member function <tt class="docutils literal"><span class="pre">def()</span></tt> that is used to register member functions, operators,
+member function <tt class="docutils literal">def()</tt> that is used to register member functions, operators,
constructors, enums and properties on the class. It will return its
this-pointer, to let you register more members directly.</p>
<p>Let's start with a simple example. Consider the following C++ class:</p>
@@ -886,7 +886,7 @@ <h1 class="title">luabind 0.9</h1>
];
</pre>
<p>This will register the class with the name testclass and constructor that takes
-a string as argument and one member function with the name <tt class="docutils literal"><span class="pre">print_string</span></tt>.</p>
+a string as argument and one member function with the name <tt class="docutils literal">print_string</tt>.</p>
<pre class="literal-block">
Lua 5.0 Copyright (C) 1994-2003 Tecgraf, PUC-Rio
&gt; a = testclass('a string')
@@ -906,19 +906,19 @@ <h1 class="title">luabind 0.9</h1>
int plus(A* o, int v) { return o-&gt;a + v; }
</pre>
-<p>You can register <tt class="docutils literal"><span class="pre">plus()</span></tt> as if it was a member function of A like this:</p>
+<p>You can register <tt class="docutils literal">plus()</tt> as if it was a member function of A like this:</p>
<pre class="literal-block">
class_&lt;A&gt;(&quot;A&quot;)
.def(&quot;plus&quot;, &amp;plus)
</pre>
-<p><tt class="docutils literal"><span class="pre">plus()</span></tt> can now be called as a member function on A with one parameter, int.
+<p><tt class="docutils literal">plus()</tt> can now be called as a member function on A with one parameter, int.
If the object pointer parameter is const, the function will act as if it was a
const member function (it can be called on const objects).</p>
<div class="section" id="overloaded-member-functions">
<h2>8.1&nbsp;&nbsp;&nbsp;Overloaded member functions</h2>
<p>When binding more than one overloads of a member function, or just binding
one overload of an overloaded member function, you have to disambiguate
-the member function pointer you pass to <tt class="docutils literal"><span class="pre">def</span></tt>. To do this, you can use an
+the member function pointer you pass to <tt class="docutils literal">def</tt>. To do this, you can use an
ordinary C-style cast, to cast it to the right overload. To do this, you have
to know how to express member function types in C++, here's a short tutorial
(for more info, refer to your favorite book on C++).</p>
@@ -938,7 +938,7 @@ <h1 class="title">luabind 0.9</h1>
class_&lt;A&gt;()
.def(&quot;f&quot;, (void(A::*)(int))&amp;A::f)
</pre>
-<p>This selects the first overload of the function <tt class="docutils literal"><span class="pre">f</span></tt> to bind. The second
+<p>This selects the first overload of the function <tt class="docutils literal">f</tt> to bind. The second
overload is not bound.</p>
</div>
<div class="section" id="properties">
@@ -975,13 +975,13 @@ <h1 class="title">luabind 0.9</h1>
struct A { int m; };
struct B { A a; };
</pre>
-<p>When binding <tt class="docutils literal"><span class="pre">B</span></tt> to lua, the following expression code should work:</p>
+<p>When binding <tt class="docutils literal">B</tt> to lua, the following expression code should work:</p>
<pre class="literal-block">
b = B()
b.a.m = 1
assert(b.a.m == 1)
</pre>
-<p>This requires the first lookup (on <tt class="docutils literal"><span class="pre">a</span></tt>) to return a reference to <tt class="docutils literal"><span class="pre">A</span></tt>, and
+<p>This requires the first lookup (on <tt class="docutils literal">a</tt>) to return a reference to <tt class="docutils literal">A</tt>, and
not a copy. In that case, luabind will automatically use the dependency policy
to make the return value dependent on the object in which it is stored. So, if
the returned reference lives longer than all references to the object (b in
@@ -1004,7 +1004,7 @@ <h1 class="title">luabind 0.9</h1>
class_&lt;A&gt;(&quot;A&quot;)
.property(&quot;a&quot;, &amp;A::get_a, &amp;A::set_a)
</pre>
-<p>This way the <tt class="docutils literal"><span class="pre">get_a()</span></tt> and <tt class="docutils literal"><span class="pre">set_a()</span></tt> functions will be called instead of
+<p>This way the <tt class="docutils literal">get_a()</tt> and <tt class="docutils literal">set_a()</tt> functions will be called instead of
just writing to the data member. If you want to make it read only you can just
omit the last parameter. Please note that the get function <strong>has to be
const</strong>, otherwise it won't compile. This seems to be a common source of errors.</p>
@@ -1039,10 +1039,10 @@ <h1 class="title">luabind 0.9</h1>
</div>
<div class="section" id="operators">
<h2>8.4&nbsp;&nbsp;&nbsp;Operators</h2>
-<p>To bind operators you have to include <tt class="docutils literal"><span class="pre">&lt;luabind/operator.hpp&gt;</span></tt>.</p>
+<p>To bind operators you have to include <tt class="docutils literal">&lt;luabind/operator.hpp&gt;</tt>.</p>
<p>The mechanism for registering operators on your class is pretty simple. You use
a global name <tt class="docutils literal"><span class="pre">luabind::self</span></tt> to refer to the class itself and then you just
-write the operator expression inside the <tt class="docutils literal"><span class="pre">def()</span></tt> call. This class:</p>
+write the operator expression inside the <tt class="docutils literal">def()</tt> call. This class:</p>
<pre class="literal-block">
struct vec
{
@@ -1060,8 +1060,8 @@ <h1 class="title">luabind 0.9</h1>
<p>This will work regardless if your plus operator is defined inside your class or
as a free function.</p>
<p>If your operator is const (or, when defined as a free function, takes a const
-reference to the class itself) you have to use <tt class="docutils literal"><span class="pre">const_self</span></tt> instead of
-<tt class="docutils literal"><span class="pre">self</span></tt>. Like this:</p>
+reference to the class itself) you have to use <tt class="docutils literal">const_self</tt> instead of
+<tt class="docutils literal">self</tt>. Like this:</p>
<pre class="literal-block">
module(L)
[
@@ -1073,16 +1073,16 @@ <h1 class="title">luabind 0.9</h1>
<pre class="literal-block">
+ - * / == &lt; &lt;=
</pre>
-<p>This means, no in-place operators. The equality operator (<tt class="docutils literal"><span class="pre">==</span></tt>) has a little
+<p>This means, no in-place operators. The equality operator (<tt class="docutils literal">==</tt>) has a little
hitch; it will not be called if the references are equal. This means that the
-<tt class="docutils literal"><span class="pre">==</span></tt> operator has to do pretty much what's it's expected to do.</p>
-<p>Lua does not support operators such as <tt class="docutils literal"><span class="pre">!=</span></tt>, <tt class="docutils literal"><span class="pre">&gt;</span></tt> or <tt class="docutils literal"><span class="pre">&gt;=</span></tt>. That's why you
+<tt class="docutils literal">==</tt> operator has to do pretty much what's it's expected to do.</p>
+<p>Lua does not support operators such as <tt class="docutils literal">!=</tt>, <tt class="docutils literal">&gt;</tt> or <tt class="docutils literal">&gt;=</tt>. That's why you
can only register the operators listed above. When you invoke one of the
mentioned operators, lua will define it in terms of one of the available
operators.</p>
<p>In the above example the other operand type is instantiated by writing
-<tt class="docutils literal"><span class="pre">int()</span></tt>. If the operand type is a complex type that cannot easily be
-instantiated you can wrap the type in a class called <tt class="docutils literal"><span class="pre">other&lt;&gt;</span></tt>. For example:</p>
+<tt class="docutils literal">int()</tt>. If the operand type is a complex type that cannot easily be
+instantiated you can wrap the type in a class called <tt class="docutils literal">other&lt;&gt;</tt>. For example:</p>
<p>To register this class, we don't want to instantiate a string just to register
the operator.</p>
<pre class="literal-block">
@@ -1091,7 +1091,7 @@ <h1 class="title">luabind 0.9</h1>
vec operator+(std::string);
};
</pre>
-<p>Instead we use the <tt class="docutils literal"><span class="pre">other&lt;&gt;</span></tt> wrapper like this:</p>
+<p>Instead we use the <tt class="docutils literal">other&lt;&gt;</tt> wrapper like this:</p>
<pre class="literal-block">
module(L)
[
@@ -1107,11 +1107,11 @@ <h1 class="title">luabind 0.9</h1>
.def( <strong>self(int())</strong> )
];
</pre>
-<p>There's one special operator. In Lua it's called <tt class="docutils literal"><span class="pre">__tostring</span></tt>, it's not
+<p>There's one special operator. In Lua it's called <tt class="docutils literal">__tostring</tt>, it's not
really an operator. It is used for converting objects to strings in a standard
way in Lua. If you register this functionality, you will be able to use the lua
-standard function <tt class="docutils literal"><span class="pre">tostring()</span></tt> for converting your object to a string.</p>
-<p>To implement this operator in C++ you should supply an <tt class="docutils literal"><span class="pre">operator&lt;&lt;</span></tt> for
+standard function <tt class="docutils literal">tostring()</tt> for converting your object to a string.</p>
+<p>To implement this operator in C++ you should supply an <tt class="docutils literal">operator&lt;&lt;</tt> for
std::ostream. Like this example:</p>
<pre class="literal-block">
class number {};
@@ -1139,14 +1139,14 @@ <h1 class="title">luabind 0.9</h1>
def(&quot;f&quot;, &amp;f)
]</strong>;
</pre>
-<p>In this example, <tt class="docutils literal"><span class="pre">f</span></tt> will behave like a static member function of the class
-<tt class="docutils literal"><span class="pre">foo</span></tt>, and the class <tt class="docutils literal"><span class="pre">nested</span></tt> will behave like a nested class of <tt class="docutils literal"><span class="pre">foo</span></tt>.</p>
+<p>In this example, <tt class="docutils literal">f</tt> will behave like a static member function of the class
+<tt class="docutils literal">foo</tt>, and the class <tt class="docutils literal">nested</tt> will behave like a nested class of <tt class="docutils literal">foo</tt>.</p>
<p>It's also possible to add namespaces to classes using the same syntax.</p>
</div>
<div class="section" id="derived-classes">
<h2>8.6&nbsp;&nbsp;&nbsp;Derived classes</h2>
<p>If you want to register classes that derives from other classes, you can
-specify a template parameter <tt class="docutils literal"><span class="pre">bases&lt;&gt;</span></tt> to the <tt class="docutils literal"><span class="pre">class_</span></tt> instantiation. The
+specify a template parameter <tt class="docutils literal">bases&lt;&gt;</tt> to the <tt class="docutils literal">class_</tt> instantiation. The
following hierarchy:</p>
<pre class="literal-block">
struct A {};
@@ -1168,7 +1168,7 @@ <h1 class="title">luabind 0.9</h1>
class_&lt;B, bases&lt;A, C&gt; &gt;(&quot;B&quot;)
];
</pre>
-<p>Note that you can omit <tt class="docutils literal"><span class="pre">bases&lt;&gt;</span></tt> when using single inheritance.</p>
+<p>Note that you can omit <tt class="docutils literal">bases&lt;&gt;</tt> when using single inheritance.</p>
<div class="note">
<p class="first admonition-title">Note</p>
<p class="last">If you don't specify that classes derive from each other, luabind will not
@@ -1180,11 +1180,11 @@ <h1 class="title">luabind 0.9</h1>
<p>When registering a class you can tell luabind to hold all instances
explicitly created in Lua in a specific smart pointer type, rather than
the default raw pointer. This is done by passing an additional template
-parameter to <tt class="docutils literal"><span class="pre">class_</span></tt>:</p>
+parameter to <tt class="docutils literal">class_</tt>:</p>
<pre class="literal-block">
class_&lt;X, <strong>P</strong>&gt;(…)
</pre>
-<p>Where the requirements of <tt class="docutils literal"><span class="pre">P</span></tt> are:</p>
+<p>Where the requirements of <tt class="docutils literal">P</tt> are:</p>
<table border="1" class="docutils">
<colgroup>
<col width="38%" />
@@ -1196,20 +1196,20 @@ <h1 class="title">luabind 0.9</h1>
</tr>
</thead>
<tbody valign="top">
-<tr><td><tt class="docutils literal"><span class="pre">P(raw)</span></tt></td>
+<tr><td><tt class="docutils literal">P(raw)</tt></td>
<td>&nbsp;</td>
</tr>
-<tr><td><tt class="docutils literal"><span class="pre">get_pointer(p)</span></tt></td>
-<td>Convertible to <tt class="docutils literal"><span class="pre">X*</span></tt></td>
+<tr><td><tt class="docutils literal">get_pointer(p)</tt></td>
+<td>Convertible to <tt class="docutils literal">X*</tt></td>
</tr>
</tbody>
</table>
<p>where:</p>
<ul class="simple">
-<li><tt class="docutils literal"><span class="pre">raw</span></tt> is of type <tt class="docutils literal"><span class="pre">X*</span></tt></li>
-<li><tt class="docutils literal"><span class="pre">p</span></tt> is an instance of <tt class="docutils literal"><span class="pre">P</span></tt></li>
+<li><tt class="docutils literal">raw</tt> is of type <tt class="docutils literal">X*</tt></li>
+<li><tt class="docutils literal">p</tt> is an instance of <tt class="docutils literal">P</tt></li>
</ul>
-<p><tt class="docutils literal"><span class="pre">get_pointer()</span></tt> overloads are provided for the smart pointers in
+<p><tt class="docutils literal">get_pointer()</tt> overloads are provided for the smart pointers in
Boost, and <tt class="docutils literal"><span class="pre">std::auto_ptr&lt;&gt;</span></tt>. Should you need to provide your own
overload, note that it is called unqualified and is expected to be found
by <em>argument dependent lookup</em>. Thus it should be defined in the same
@@ -1228,15 +1228,15 @@ <h1 class="title">luabind 0.9</h1>
</pre>
<p>the instance returned by that will be held in <tt class="docutils literal"><span class="pre">std::auto_ptr&lt;X&gt;</span></tt>. This
is handled automatically for all smart pointers that implement a
-<tt class="docutils literal"><span class="pre">get_pointer()</span></tt> overload.</p>
+<tt class="docutils literal">get_pointer()</tt> overload.</p>
<div class="important">
<p class="first admonition-title">Important</p>
-<p class="last"><tt class="docutils literal"><span class="pre">get_const_holder()</span></tt> has been removed. Automatic conversions
-between <tt class="docutils literal"><span class="pre">smart_ptr&lt;X&gt;</span></tt> and <tt class="docutils literal"><span class="pre">smart_ptr&lt;X</span> <span class="pre">const&gt;</span></tt> no longer work.</p>
+<p class="last"><tt class="docutils literal">get_const_holder()</tt> has been removed. Automatic conversions
+between <tt class="docutils literal">smart_ptr&lt;X&gt;</tt> and <tt class="docutils literal">smart_ptr&lt;X const&gt;</tt> no longer work.</p>
</div>
<div class="important">
<p class="first admonition-title">Important</p>
-<p><tt class="docutils literal"><span class="pre">__ok</span></tt> has been removed. Similar functionality can be implemented
+<p><tt class="docutils literal">__ok</tt> has been removed. Similar functionality can be implemented
for specific pointer types by doing something along the lines of:</p>
<pre class="last literal-block">
bool is_non_null(std::auto_ptr&lt;X&gt; const&amp; p)
@@ -1291,8 +1291,8 @@ <h1 class="title">luabind 0.9</h1>
module(L) [ x ];
}
</pre>
-<p>Here, the class <tt class="docutils literal"><span class="pre">X</span></tt> is registered in two steps. The two functions
-<tt class="docutils literal"><span class="pre">register_part1</span></tt> and <tt class="docutils literal"><span class="pre">register_part2</span></tt> may be put in separate compilation
+<p>Here, the class <tt class="docutils literal">X</tt> is registered in two steps. The two functions
+<tt class="docutils literal">register_part1</tt> and <tt class="docutils literal">register_part2</tt> may be put in separate compilation
units.</p>
<p>To separate the module registration and the classes to be registered, see
<a class="reference internal" href="#splitting-up-the-registration">Splitting up the registration</a>.</p>
@@ -1340,11 +1340,11 @@ <h1 class="title">luabind 0.9</h1>
{};
}
</pre>
-<p>Note that <tt class="docutils literal"><span class="pre">default_converter&lt;&gt;</span></tt> is instantiated for the actual argument and
+<p>Note that <tt class="docutils literal">default_converter&lt;&gt;</tt> is instantiated for the actual argument and
return types of the bound functions. In the above example, we add a
-specialization for <tt class="docutils literal"><span class="pre">X</span> <span class="pre">const&amp;</span></tt> that simply forwards to the <tt class="docutils literal"><span class="pre">X</span></tt> converter.
-This lets us export functions which accept <tt class="docutils literal"><span class="pre">X</span></tt> by const reference.</p>
-<p><tt class="docutils literal"><span class="pre">native_converter_base&lt;&gt;</span></tt> should be used as the base class for the
+specialization for <tt class="docutils literal">X const&amp;</tt> that simply forwards to the <tt class="docutils literal">X</tt> converter.
+This lets us export functions which accept <tt class="docutils literal">X</tt> by const reference.</p>
+<p><tt class="docutils literal">native_converter_base&lt;&gt;</tt> should be used as the base class for the
specialized converters. It simplifies the converter interface, and
provides a mean for backward compatibility since the underlying
interface is in flux.</p>
@@ -1360,7 +1360,7 @@ <h1 class="title">luabind 0.9</h1>
template &lt;class Signature, class F&gt;
<em>implementation-defined</em> tag_function(F f);
</pre>
-<p>Where <tt class="docutils literal"><span class="pre">Signature</span></tt> is a function type describing the signature of <tt class="docutils literal"><span class="pre">F</span></tt>.
+<p>Where <tt class="docutils literal">Signature</tt> is a function type describing the signature of <tt class="docutils literal">F</tt>.
It can be used like this:</p>
<pre class="literal-block">
int f(int x);
@@ -1389,7 +1389,7 @@ <h1 class="title">luabind 0.9</h1>
<p>Since functions have to be able to take Lua values (of variable type) we need a
wrapper around them. This wrapper is called <tt class="docutils literal"><span class="pre">luabind::object</span></tt>. If the
function you register takes an object, it will match any Lua value. To use it,
-you need to include <tt class="docutils literal"><span class="pre">&lt;luabind/object.hpp&gt;</span></tt>.</p>
+you need to include <tt class="docutils literal">&lt;luabind/object.hpp&gt;</tt>.</p>
<div class="topic">
<p class="topic-title first">Synopsis</p>
<pre class="literal-block">
@@ -1441,19 +1441,19 @@ <h1 class="title">luabind 0.9</h1>
</pre>
</div>
<p>When you have a Lua object, you can assign it a new value with the assignment
-operator (=). When you do this, the <tt class="docutils literal"><span class="pre">default_policy</span></tt> will be used to make the
+operator (=). When you do this, the <tt class="docutils literal">default_policy</tt> will be used to make the
conversion from C++ value to Lua. If your <tt class="docutils literal"><span class="pre">luabind::object</span></tt> is a table you
can access its members through the operator[] or the <a class="reference internal" href="#iterators">Iterators</a>. The value
returned from the operator[] is a proxy object that can be used both for
reading and writing values into the table (using operator=).</p>
<p>Note that it is impossible to know if a Lua value is indexable or not
-(<tt class="docutils literal"><span class="pre">lua_gettable</span></tt> doesn't fail, it succeeds or crashes). This means that if
+(<tt class="docutils literal">lua_gettable</tt> doesn't fail, it succeeds or crashes). This means that if
you're trying to index something that cannot be indexed, you're on your own.
-Lua will call its <tt class="docutils literal"><span class="pre">panic()</span></tt> function. See <a class="reference internal" href="#lua-panic">lua panic</a>.</p>
+Lua will call its <tt class="docutils literal">panic()</tt> function. See <a class="reference internal" href="#lua-panic">lua panic</a>.</p>
<p>There are also free functions that can be used for indexing the table, see
<a class="reference internal" href="#related-functions">Related functions</a>.</p>
-<p>The constructor that takes a <tt class="docutils literal"><span class="pre">from_stack</span></tt> object is used when you want to
-initialize the object with a value from the lua stack. The <tt class="docutils literal"><span class="pre">from_stack</span></tt>
+<p>The constructor that takes a <tt class="docutils literal">from_stack</tt> object is used when you want to
+initialize the object with a value from the lua stack. The <tt class="docutils literal">from_stack</tt>
type has the following constructor:</p>
<pre class="literal-block">
from_stack(lua_State* L, int index);
@@ -1463,16 +1463,16 @@ <h1 class="title">luabind 0.9</h1>
<pre class="literal-block">
object o(from_stack(L, -1));
</pre>
-<p>This will create the object <tt class="docutils literal"><span class="pre">o</span></tt> and copy the value from the top of the lua stack.</p>
-<p>The <tt class="docutils literal"><span class="pre">interpreter()</span></tt> function returns the Lua state where this object is stored.
+<p>This will create the object <tt class="docutils literal">o</tt> and copy the value from the top of the lua stack.</p>
+<p>The <tt class="docutils literal">interpreter()</tt> function returns the Lua state where this object is stored.
If you want to manipulate the object with Lua functions directly you can push
-it onto the Lua stack by calling <tt class="docutils literal"><span class="pre">push()</span></tt>.</p>
+it onto the Lua stack by calling <tt class="docutils literal">push()</tt>.</p>
<p>The operator== will call lua_equal() on the operands and return its result.</p>
-<p>The <tt class="docutils literal"><span class="pre">is_valid()</span></tt> function tells you whether the object has been initialized
+<p>The <tt class="docutils literal">is_valid()</tt> function tells you whether the object has been initialized
or not. When created with its default constructor, objects are invalid. To make
an object valid, you can assign it a value. If you want to invalidate an object
you can simply assign it an invalid object.</p>
-<p>The <tt class="docutils literal"><span class="pre">operator</span> <span class="pre">safe_bool_type()</span></tt> is equivalent to <tt class="docutils literal"><span class="pre">is_valid()</span></tt>. This means
+<p>The <tt class="docutils literal">operator safe_bool_type()</tt> is equivalent to <tt class="docutils literal">is_valid()</tt>. This means
that these snippets are equivalent:</p>
<pre class="literal-block">
object o;
@@ -1492,7 +1492,7 @@ <h1 class="title">luabind 0.9</h1>
}
</pre>
<p>The application operator will call the value as if it was a function. You can
-give it any number of parameters (currently the <tt class="docutils literal"><span class="pre">default_policy</span></tt> will be used
+give it any number of parameters (currently the <tt class="docutils literal">default_policy</tt> will be used
for the conversion). The returned object refers to the return value (currently
only one return value is supported). This operator may throw <tt class="docutils literal"><span class="pre">luabind::error</span></tt>
if the function call fails. If you want to specify policies to your function
@@ -1531,7 +1531,7 @@ <h1 class="title">luabind 0.9</h1>
</pre>
<p>There's a stream operator that makes it possible to print objects or use
<tt class="docutils literal"><span class="pre">boost::lexical_cast</span></tt> to convert it to a string. This will use lua's string
-conversion function. So if you convert a C++ object with a <tt class="docutils literal"><span class="pre">tostring</span></tt>
+conversion function. So if you convert a C++ object with a <tt class="docutils literal">tostring</tt>
operator, the stream operator for that type will be used.</p>
<div class="section" id="iterators">
<h2>11.1&nbsp;&nbsp;&nbsp;Iterators</h2>
@@ -1562,7 +1562,7 @@ <h1 class="title">luabind 0.9</h1>
cases you can just treat it as an ordinary object. The difference is that any
assignments to this proxy will result in the value being inserted at the
iterators position, in the table.</p>
-<p>The <tt class="docutils literal"><span class="pre">key()</span></tt> member returns the key used by the iterator when indexing the
+<p>The <tt class="docutils literal">key()</tt> member returns the key used by the iterator when indexing the
associated Lua table.</p>
<p>An example using iterators:</p>
<pre class="literal-block">
@@ -1571,9 +1571,9 @@ <h1 class="title">luabind 0.9</h1>
*i = 1;
}
</pre>
-<p>The iterator named <tt class="docutils literal"><span class="pre">end</span></tt> will be constructed using the default constructor
+<p>The iterator named <tt class="docutils literal">end</tt> will be constructed using the default constructor
and hence refer to the end of the sequence. This example will simply iterate
-over the entries in the global table <tt class="docutils literal"><span class="pre">a</span></tt> and set all its values to 1.</p>
+over the entries in the global table <tt class="docutils literal">a</tt> and set all its values to 1.</p>
</div>
<div class="section" id="related-functions">
<h2>11.2&nbsp;&nbsp;&nbsp;Related functions</h2>
@@ -1582,7 +1582,7 @@ <h1 class="title">luabind 0.9</h1>
int type(object const&amp;);
</pre>
<p>This function will return the lua type index of the given object.
-i.e. <tt class="docutils literal"><span class="pre">LUA_TNIL</span></tt>, <tt class="docutils literal"><span class="pre">LUA_TNUMBER</span></tt> etc.</p>
+i.e. <tt class="docutils literal">LUA_TNIL</tt>, <tt class="docutils literal">LUA_TNUMBER</tt> etc.</p>
<pre class="literal-block">
template&lt;class T, class K&gt;
void settable(object const&amp; o, K const&amp; key, T const&amp; value);
@@ -1593,11 +1593,11 @@ <h1 class="title">luabind 0.9</h1>
template&lt;class K&gt;
object rawget(object const&amp; o, K const&amp; key);
</pre>
-<p>These functions are used for indexing into tables. <tt class="docutils literal"><span class="pre">settable</span></tt> and <tt class="docutils literal"><span class="pre">gettable</span></tt>
-translates into calls to <tt class="docutils literal"><span class="pre">lua_settable</span></tt> and <tt class="docutils literal"><span class="pre">lua_gettable</span></tt> respectively. Which
+<p>These functions are used for indexing into tables. <tt class="docutils literal">settable</tt> and <tt class="docutils literal">gettable</tt>
+translates into calls to <tt class="docutils literal">lua_settable</tt> and <tt class="docutils literal">lua_gettable</tt> respectively. Which
means that you could just as well use the index operator of the object.</p>
-<p><tt class="docutils literal"><span class="pre">rawset</span></tt> and <tt class="docutils literal"><span class="pre">rawget</span></tt> will translate into calls to <tt class="docutils literal"><span class="pre">lua_rawset</span></tt> and
-<tt class="docutils literal"><span class="pre">lua_rawget</span></tt> respectively. So they will bypass any metamethod and give you the
+<p><tt class="docutils literal">rawset</tt> and <tt class="docutils literal">rawget</tt> will translate into calls to <tt class="docutils literal">lua_rawset</tt> and
+<tt class="docutils literal">lua_rawget</tt> respectively. So they will bypass any metamethod and give you the
true value of the table entry.</p>
<pre class="literal-block">
template&lt;class T&gt;
@@ -1610,9 +1610,9 @@ <h1 class="title">luabind 0.9</h1>
template&lt;class T, class Policies&gt;
boost::optional&lt;T&gt; object_cast_nothrow&lt;T&gt;(object const&amp;, Policies);
</pre>
-<p>The <tt class="docutils literal"><span class="pre">object_cast</span></tt> function casts the value of an object to a C++ value.
+<p>The <tt class="docutils literal">object_cast</tt> function casts the value of an object to a C++ value.
You can supply a policy to handle the conversion from lua to C++. If the cast
-cannot be made a <tt class="docutils literal"><span class="pre">cast_failed</span></tt> exception will be thrown. If you have
+cannot be made a <tt class="docutils literal">cast_failed</tt> exception will be thrown. If you have
defined LUABIND_NO_ERROR_CHECKING (see <a class="reference internal" href="#build-options">Build options</a>) no checking will occur,
and if the cast is invalid the application may very well crash. The nothrow
versions will return an uninitialized <tt class="docutils literal"><span class="pre">boost::optional&lt;T&gt;</span></tt> object, to
@@ -1638,18 +1638,18 @@ <h1 class="title">luabind 0.9</h1>
lua_CFunction tocfunction(object const&amp; value);
template &lt;class T&gt; T* touserdata(object const&amp; value)
</pre>
-<p>These extract values from the object at a lower level than <tt class="docutils literal"><span class="pre">object_cast()</span></tt>.</p>
+<p>These extract values from the object at a lower level than <tt class="docutils literal">object_cast()</tt>.</p>
<pre class="literal-block">
object getupvalue(object const&amp; function, int index);
void setupvalue(object const&amp; function, int index, object const&amp; value);
</pre>
-<p>These get and set the upvalues of <tt class="docutils literal"><span class="pre">function</span></tt>.</p>
+<p>These get and set the upvalues of <tt class="docutils literal">function</tt>.</p>
</div>
<div class="section" id="assigning-nil">
<h2>11.3&nbsp;&nbsp;&nbsp;Assigning nil</h2>
-<p>To set a table entry to <tt class="docutils literal"><span class="pre">nil</span></tt>, you can use <tt class="docutils literal"><span class="pre">luabind::nil</span></tt>. It will avoid
-having to take the detour by first assigning <tt class="docutils literal"><span class="pre">nil</span></tt> to an object and then
-assign that to the table entry. It will simply result in a <tt class="docutils literal"><span class="pre">lua_pushnil()</span></tt>
+<p>To set a table entry to <tt class="docutils literal">nil</tt>, you can use <tt class="docutils literal"><span class="pre">luabind::nil</span></tt>. It will avoid
+having to take the detour by first assigning <tt class="docutils literal">nil</tt> to an object and then
+assign that to the table entry. It will simply result in a <tt class="docutils literal">lua_pushnil()</tt>
call, instead of copying an object.</p>
<p>Example:</p>
<pre class="literal-block">
@@ -1693,11 +1693,11 @@ <h1 class="title">luabind 0.9</h1>
lua_testclass.print(self)
end
</pre>
-<p>The base class is initialized explicitly by calling its <tt class="docutils literal"><span class="pre">__init()</span></tt>
+<p>The base class is initialized explicitly by calling its <tt class="docutils literal">__init()</tt>
function.</p>
<p>As you can see in this example, you can call the base class member functions.
You can find all member functions in the base class, but you will have to give
-the this-pointer (<tt class="docutils literal"><span class="pre">self</span></tt>) as first argument.</p>
+the this-pointer (<tt class="docutils literal">self</tt>) as first argument.</p>
<div class="section" id="deriving-in-lua">
<h2>12.1&nbsp;&nbsp;&nbsp;Deriving in lua</h2>
<p>It is also possible to derive Lua classes from C++ classes, and override
@@ -1744,13 +1744,13 @@ <h1 class="title">luabind 0.9</h1>
<div class="important">
<p class="first admonition-title">Important</p>
<p class="last">Since MSVC6.5 doesn't support explicit template parameters
-to member functions, instead of using the member function <tt class="docutils literal"><span class="pre">call()</span></tt>
-you call a free function <tt class="docutils literal"><span class="pre">call_member()</span></tt> and pass the this-pointer
+to member functions, instead of using the member function <tt class="docutils literal">call()</tt>
+you call a free function <tt class="docutils literal">call_member()</tt> and pass the this-pointer
as first parameter.</p>
</div>
<p>Note that if you have both base classes and a base class wrapper, you must give
both bases and the base class wrapper type as template parameter to
-<tt class="docutils literal"><span class="pre">class_</span></tt> (as done in the example above). The order in which you specify
+<tt class="docutils literal">class_</tt> (as done in the example above). The order in which you specify
them is not important. You must also register both the static version and the
virtual version of the function from the wrapper, this is necessary in order
to allow luabind to use both dynamic and static dispatch when calling the function.</p>
@@ -1760,8 +1760,8 @@ <h1 class="title">luabind 0.9</h1>
is identical to the virtual function. The fact that one of them is a free
function and the other a member function doesn't matter, but the parameters
as seen from lua must match. It would not have worked if the static function
-took a <tt class="docutils literal"><span class="pre">base_wrapper*</span></tt> as its first argument, since the virtual function
-takes a <tt class="docutils literal"><span class="pre">base*</span></tt> as its first argument (its this pointer). There's currently
+took a <tt class="docutils literal">base_wrapper*</tt> as its first argument, since the virtual function
+takes a <tt class="docutils literal">base*</tt> as its first argument (its this pointer). There's currently
no check in luabind to make sure the signatures match.</p>
</div>
<p>If we didn't have a class wrapper, it would not be possible to pass a Lua class
@@ -1785,20 +1785,20 @@ <h1 class="title">luabind 0.9</h1>
template&lt;class Ret&gt;
Ret call(char const* name, ...)
</pre>
-<p>Its used in a similar way as <tt class="docutils literal"><span class="pre">call_function</span></tt>, with the exception that it doesn't
-take a <tt class="docutils literal"><span class="pre">lua_State</span></tt> pointer, and the name is a member function in the Lua class.</p>
+<p>Its used in a similar way as <tt class="docutils literal">call_function</tt>, with the exception that it doesn't
+take a <tt class="docutils literal">lua_State</tt> pointer, and the name is a member function in the Lua class.</p>
<div class="warning">
<p class="first admonition-title">Warning</p>
-<p class="last">The current implementation of <tt class="docutils literal"><span class="pre">call_member</span></tt> is not able to distinguish const
+<p class="last">The current implementation of <tt class="docutils literal">call_member</tt> is not able to distinguish const
member functions from non-const. If you have a situation where you have an overloaded
virtual function where the only difference in their signatures is their constness, the
-wrong overload will be called by <tt class="docutils literal"><span class="pre">call_member</span></tt>. This is rarely the case though.</p>
+wrong overload will be called by <tt class="docutils literal">call_member</tt>. This is rarely the case though.</p>
</div>
<div class="section" id="object-identity">
<h3>12.1.1&nbsp;&nbsp;&nbsp;Object identity</h3>
<p>When a pointer or reference to a registered class with a wrapper is passed
to Lua, luabind will query for it's dynamic type. If the dynamic type
-inherits from <tt class="docutils literal"><span class="pre">wrap_base</span></tt>, object identity is preserved.</p>
+inherits from <tt class="docutils literal">wrap_base</tt>, object identity is preserved.</p>
<pre class="literal-block">
struct A { .. };
struct A_wrap : A, wrap_base { .. };
@@ -1817,7 +1817,7 @@ <h1 class="title">luabind 0.9</h1>
&gt; assert(x == f(x)) -- object identity is preserved when object is
-- passed through C++
</pre>
-<p>This functionality relies on RTTI being enabled (that <tt class="docutils literal"><span class="pre">LUABIND_NO_RTTI</span></tt> is
+<p>This functionality relies on RTTI being enabled (that <tt class="docutils literal">LUABIND_NO_RTTI</tt> is
not defined).</p>
</div>
</div>
@@ -1828,22 +1828,22 @@ <h1 class="title">luabind 0.9</h1>
metamethods in Lua). The operators you can overload are:</p>
<blockquote>
<ul class="simple">
-<li><tt class="docutils literal"><span class="pre">__add</span></tt></li>
-<li><tt class="docutils literal"><span class="pre">__sub</span></tt></li>
-<li><tt class="docutils literal"><span class="pre">__mul</span></tt></li>
-<li><tt class="docutils literal"><span class="pre">__div</span></tt></li>
-<li><tt class="docutils literal"><span class="pre">__pow</span></tt></li>
-<li><tt class="docutils literal"><span class="pre">__lt</span></tt></li>
-<li><tt class="docutils literal"><span class="pre">__le</span></tt></li>
-<li><tt class="docutils literal"><span class="pre">__eq</span></tt></li>
-<li><tt class="docutils literal"><span class="pre">__call</span></tt></li>
-<li><tt class="docutils literal"><span class="pre">__unm</span></tt></li>
-<li><tt class="docutils literal"><span class="pre">__tostring</span></tt></li>
-<li><tt class="docutils literal"><span class="pre">__len</span></tt></li>
+<li><tt class="docutils literal">__add</tt></li>
+<li><tt class="docutils literal">__sub</tt></li>
+<li><tt class="docutils literal">__mul</tt></li>
+<li><tt class="docutils literal">__div</tt></li>
+<li><tt class="docutils literal">__pow</tt></li>
+<li><tt class="docutils literal">__lt</tt></li>
+<li><tt class="docutils literal">__le</tt></li>
+<li><tt class="docutils literal">__eq</tt></li>
+<li><tt class="docutils literal">__call</tt></li>
+<li><tt class="docutils literal">__unm</tt></li>
+<li><tt class="docutils literal">__tostring</tt></li>
+<li><tt class="docutils literal">__len</tt></li>
</ul>
</blockquote>
-<p><tt class="docutils literal"><span class="pre">__tostring</span></tt> isn't really an operator, but it's the metamethod that is called
-by the standard library's <tt class="docutils literal"><span class="pre">tostring()</span></tt> function. There's one strange behavior
+<p><tt class="docutils literal">__tostring</tt> isn't really an operator, but it's the metamethod that is called
+by the standard library's <tt class="docutils literal">tostring()</tt> function. There's one strange behavior
regarding binary operators. You are not guaranteed that the self pointer you
get actually refers to an instance of your class. This is because Lua doesn't
distinguish the two cases where you get the other operand as left hand value or
@@ -1882,7 +1882,7 @@ <h1 class="title">luabind 0.9</h1>
end
end
</pre>
-<p>The reason why <tt class="docutils literal"><span class="pre">__sub</span></tt> is used as an example is because subtraction is not
+<p>The reason why <tt class="docutils literal">__sub</tt> is used as an example is because subtraction is not
commutative (the order of the operands matters). That's why luabind cannot
change order of the operands to make the self reference always refer to the
actual class instance.</p>
@@ -1895,8 +1895,8 @@ <h1 class="title">luabind 0.9</h1>
<div class="section" id="finalizers">
<h2>12.3&nbsp;&nbsp;&nbsp;Finalizers</h2>
<p>If an object needs to perform actions when it's collected we provide a
-<tt class="docutils literal"><span class="pre">__finalize</span></tt> function that can be overridden in lua-classes. The
-<tt class="docutils literal"><span class="pre">__finalize</span></tt> functions will be called on all classes in the inheritance
+<tt class="docutils literal">__finalize</tt> function that can be overridden in lua-classes. The
+<tt class="docutils literal">__finalize</tt> functions will be called on all classes in the inheritance
chain, starting with the most derived type.</p>
<pre class="literal-block">
...
@@ -1947,9 +1947,9 @@ <h1 class="title">luabind 0.9</h1>
b = filter_a(a)
adopt_a(b)
</pre>
-<p>In this example, lua cannot know that <tt class="docutils literal"><span class="pre">b</span></tt> actually is the same object as
-<tt class="docutils literal"><span class="pre">a</span></tt>, and it will therefore consider the object to be owned by the C++ side.
-When the <tt class="docutils literal"><span class="pre">b</span></tt> pointer then is adopted, a runtime error will be raised because
+<p>In this example, lua cannot know that <tt class="docutils literal">b</tt> actually is the same object as
+<tt class="docutils literal">a</tt>, and it will therefore consider the object to be owned by the C++ side.
+When the <tt class="docutils literal">b</tt> pointer then is adopted, a runtime error will be raised because
an object not owned by lua is being adopted to C++.</p>
<p>If you have a wrapper for your class, none of this will happen, see
<a class="reference internal" href="#object-identity">Object identity</a>.</p>
@@ -1959,14 +1959,14 @@ <h1 class="title">luabind 0.9</h1>
<h1>13&nbsp;&nbsp;&nbsp;Exceptions</h1>
<p>If any of the functions you register throws an exception when called, that
exception will be caught by luabind and converted to an error string and
-<tt class="docutils literal"><span class="pre">lua_error()</span></tt> will be invoked. If the exception is a <tt class="docutils literal"><span class="pre">std::exception</span></tt> or a
-<tt class="docutils literal"><span class="pre">const</span> <span class="pre">char*</span></tt> the string that is pushed on the Lua stack, as error message,
+<tt class="docutils literal">lua_error()</tt> will be invoked. If the exception is a <tt class="docutils literal"><span class="pre">std::exception</span></tt> or a
+<tt class="docutils literal">const char*</tt> the string that is pushed on the Lua stack, as error message,
will be the string returned by <tt class="docutils literal"><span class="pre">std::exception::what()</span></tt> or the string itself
respectively. If the exception is unknown, a generic string saying that the
function threw an exception will be pushed.</p>
<p>If you have an exception type that isn't derived from
<tt class="docutils literal"><span class="pre">std::exception</span></tt>, or you wish to change the error message from the
-default result of <tt class="docutils literal"><span class="pre">what()</span></tt>, it is possible to register custom
+default result of <tt class="docutils literal">what()</tt>, it is possible to register custom
exception handlers:</p>
<pre class="literal-block">
struct my_exception
@@ -1981,8 +1981,8 @@ <h1 class="title">luabind 0.9</h1>
luabind::register_exception_handler&lt;my_exception&gt;(&amp;translate_my_exception);
</pre>
-<p><tt class="docutils literal"><span class="pre">translate_my_exception()</span></tt> will be called by luabind whenever a
-<tt class="docutils literal"><span class="pre">my_exception</span></tt> is caught. <tt class="docutils literal"><span class="pre">lua_error()</span></tt> will be called after the
+<p><tt class="docutils literal">translate_my_exception()</tt> will be called by luabind whenever a
+<tt class="docutils literal">my_exception</tt> is caught. <tt class="docutils literal">lua_error()</tt> will be called after the
handler function returns, so it is expected that the function will push
an error string on the stack.</p>
<p>Any function that invokes Lua code may throw <tt class="docutils literal"><span class="pre">luabind::error</span></tt>. This exception
@@ -2033,9 +2033,9 @@ <h1 class="title">luabind 0.9</h1>
}
</pre>
<p>There's another exception that luabind may throw: <tt class="docutils literal"><span class="pre">luabind::cast_failed</span></tt>,
-this exception is thrown from <tt class="docutils literal"><span class="pre">call_function&lt;&gt;</span></tt> or <tt class="docutils literal"><span class="pre">call_member&lt;&gt;</span></tt>. It
+this exception is thrown from <tt class="docutils literal">call_function&lt;&gt;</tt> or <tt class="docutils literal">call_member&lt;&gt;</tt>. It
means that the return value from the Lua function couldn't be converted to
-a C++ value. It is also thrown from <tt class="docutils literal"><span class="pre">object_cast&lt;&gt;</span></tt> if the cast cannot
+a C++ value. It is also thrown from <tt class="docutils literal">object_cast&lt;&gt;</tt> if the cast cannot
be made.</p>
<p>The synopsis for <tt class="docutils literal"><span class="pre">luabind::cast_failed</span></tt> is:</p>
<pre class="literal-block">
@@ -2050,12 +2050,12 @@ <h1 class="title">luabind 0.9</h1>
</pre>
<p>Again, the state member function returns a pointer to the Lua state where the
error occurred. See the example above to see where this pointer may be invalid.</p>
-<p>The info member function returns the user defined <tt class="docutils literal"><span class="pre">LUABIND_TYPE_INFO</span></tt>, which
-defaults to a <tt class="docutils literal"><span class="pre">const</span> <span class="pre">std::type_info*</span></tt>. This type info describes the type that
+<p>The info member function returns the user defined <tt class="docutils literal">LUABIND_TYPE_INFO</tt>, which
+defaults to a <tt class="docutils literal">const <span class="pre">std::type_info*</span></tt>. This type info describes the type that
we tried to cast a Lua value to.</p>
-<p>If you have defined <tt class="docutils literal"><span class="pre">LUABIND_NO_EXCEPTIONS</span></tt> none of these exceptions will be
+<p>If you have defined <tt class="docutils literal">LUABIND_NO_EXCEPTIONS</tt> none of these exceptions will be
thrown, instead you can set two callback functions that are called instead.
-These two functions are only defined if <tt class="docutils literal"><span class="pre">LUABIND_NO_EXCEPTIONS</span></tt> are defined.</p>
+These two functions are only defined if <tt class="docutils literal">LUABIND_NO_EXCEPTIONS</tt> are defined.</p>
<pre class="literal-block">
luabind::set_error_callback(void(*)(lua_State*))
</pre>
@@ -2065,16 +2065,16 @@ <h1 class="title">luabind 0.9</h1>
<pre class="literal-block">
luabind::set_cast_failed_callback(void(*)(lua_State*, LUABIND_TYPE_INFO))
</pre>
-<p>The function you set is called instead of throwing <tt class="docutils literal"><span class="pre">cast_failed</span></tt>. This function
+<p>The function you set is called instead of throwing <tt class="docutils literal">cast_failed</tt>. This function
is not expected to return, if it does luabind will call <tt class="docutils literal"><span class="pre">std::terminate()</span></tt>.</p>
</div>
<div class="section" id="policies">
<h1>14&nbsp;&nbsp;&nbsp;Policies</h1>
<p>Sometimes it is necessary to control how luabind passes arguments and return
value, to do this we have policies. All policies use an index to associate
-them with an argument in the function signature. These indices are <tt class="docutils literal"><span class="pre">result</span></tt>
-and <tt class="docutils literal"><span class="pre">_N</span></tt> (where <tt class="docutils literal"><span class="pre">N</span> <span class="pre">&gt;=</span> <span class="pre">1</span></tt>). When dealing with member functions <tt class="docutils literal"><span class="pre">_1</span></tt> refers
-to the <tt class="docutils literal"><span class="pre">this</span></tt> pointer.</p>
+them with an argument in the function signature. These indices are <tt class="docutils literal">result</tt>
+and <tt class="docutils literal">_N</tt> (where <tt class="docutils literal">N &gt;= 1</tt>). When dealing with member functions <tt class="docutils literal">_1</tt> refers
+to the <tt class="docutils literal">this</tt> pointer.</p>
<div class="contents local topic" id="policies-currently-implemented">
<p class="topic-title first">Policies currently implemented</p>
<ul class="auto-toc simple">
@@ -2121,8 +2121,8 @@ <h1 class="title">luabind 0.9</h1>
</tr>
</thead>
<tbody valign="top">
-<tr><td><tt class="docutils literal"><span class="pre">index</span></tt></td>
-<td>The index which should transfer ownership, <tt class="docutils literal"><span class="pre">_N</span></tt> or <tt class="docutils literal"><span class="pre">result</span></tt></td>
+<tr><td><tt class="docutils literal">index</tt></td>
+<td>The index which should transfer ownership, <tt class="docutils literal">_N</tt> or <tt class="docutils literal">result</tt></td>
</tr>
</tbody>
</table>
@@ -2176,10 +2176,10 @@ <h1 class="title">luabind 0.9</h1>
</tr>
</thead>
<tbody valign="top">
-<tr><td><tt class="docutils literal"><span class="pre">nurse_index</span></tt></td>
+<tr><td><tt class="docutils literal">nurse_index</tt></td>
<td>The index which will keep the patient alive.</td>
</tr>
-<tr><td><tt class="docutils literal"><span class="pre">patient_index</span></tt></td>
+<tr><td><tt class="docutils literal">patient_index</tt></td>
<td>The index which will be kept alive.</td>
</tr>
</tbody>
@@ -2239,12 +2239,12 @@ <h1 class="title">luabind 0.9</h1>
</tr>
</thead>
<tbody valign="top">
-<tr><td><tt class="docutils literal"><span class="pre">index</span></tt></td>
+<tr><td><tt class="docutils literal">index</tt></td>
<td>The index of the parameter to be used as an out parameter.</td>
</tr>
-<tr><td><tt class="docutils literal"><span class="pre">policies</span></tt></td>
+<tr><td><tt class="docutils literal">policies</tt></td>
<td>The policies used internally to convert the out parameter
-to/from Lua. <tt class="docutils literal"><span class="pre">_1</span></tt> means <strong>to</strong> C++, <tt class="docutils literal"><span class="pre">_2</span></tt> means <strong>from</strong>
+to/from Lua. <tt class="docutils literal">_1</tt> means <strong>to</strong> C++, <tt class="docutils literal">_2</tt> means <strong>from</strong>
C++.</td>
</tr>
</tbody>
@@ -2273,7 +2273,7 @@ <h1 class="title">luabind 0.9</h1>
<h2><a class="toc-backref" href="#id109">14.4&nbsp;&nbsp;&nbsp;pure_out_value</a></h2>
<div class="section" id="id14">
<h3>14.4.1&nbsp;&nbsp;&nbsp;Motivation</h3>
-<p>This works exactly like <tt class="docutils literal"><span class="pre">out_value</span></tt>, except that it will pass a
+<p>This works exactly like <tt class="docutils literal">out_value</tt>, except that it will pass a
default constructed object instead of converting an argument from
Lua. This means that the parameter will be removed from the lua
signature.</p>
@@ -2303,19 +2303,19 @@ <h1 class="title">luabind 0.9</h1>
</tr>
</thead>
<tbody valign="top">
-<tr><td><tt class="docutils literal"><span class="pre">index</span></tt></td>
+<tr><td><tt class="docutils literal">index</tt></td>
<td>The index of the parameter to be used as an out parameter.</td>
</tr>
-<tr><td><tt class="docutils literal"><span class="pre">policies</span></tt></td>
+<tr><td><tt class="docutils literal">policies</tt></td>
<td>The policies used internally to convert the out parameter
-to Lua. <tt class="docutils literal"><span class="pre">_1</span></tt> is used as the internal index.</td>
+to Lua. <tt class="docutils literal">_1</tt> is used as the internal index.</td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="id18">
<h3>14.4.5&nbsp;&nbsp;&nbsp;Example</h3>
-<p>Note that no values are passed to the calls to <tt class="docutils literal"><span class="pre">f1</span></tt> and <tt class="docutils literal"><span class="pre">f2</span></tt>.</p>
+<p>Note that no values are passed to the calls to <tt class="docutils literal">f1</tt> and <tt class="docutils literal">f2</tt>.</p>
<pre class="literal-block">
void f1(float&amp; val) { val = 10.f; }
void f2(float* val) { *val = 10.f; }
@@ -2381,9 +2381,9 @@ <h1 class="title">luabind 0.9</h1>
</tr>
</thead>
<tbody valign="top">
-<tr><td><tt class="docutils literal"><span class="pre">index</span></tt></td>
+<tr><td><tt class="docutils literal">index</tt></td>
<td>The argument index to return a reference to, any argument but
-not <tt class="docutils literal"><span class="pre">result</span></tt>.</td>
+not <tt class="docutils literal">result</tt>.</td>
</tr>
</tbody>
</table>
@@ -2451,9 +2451,9 @@ <h1 class="title">luabind 0.9</h1>
</tr>
</thead>
<tbody valign="top">
-<tr><td><tt class="docutils literal"><span class="pre">index</span></tt></td>
-<td>The index to copy. <tt class="docutils literal"><span class="pre">result</span></tt> when used while wrapping C++
-functions. <tt class="docutils literal"><span class="pre">_N</span></tt> when passing arguments to Lua.</td>
+<tr><td><tt class="docutils literal">index</tt></td>
+<td>The index to copy. <tt class="docutils literal">result</tt> when used while wrapping C++
+functions. <tt class="docutils literal">_N</tt> when passing arguments to Lua.</td>
</tr>
</tbody>
</table>
@@ -2524,7 +2524,7 @@ <h1 class="title">luabind 0.9</h1>
<h3>14.8.1&nbsp;&nbsp;&nbsp;Motivation</h3>
<p>This policy converts an STL container to a generator function that can be used
in lua to iterate over the container. It works on any container that defines
-<tt class="docutils literal"><span class="pre">begin()</span></tt> and <tt class="docutils literal"><span class="pre">end()</span></tt> member functions (they have to return iterators).</p>
+<tt class="docutils literal">begin()</tt> and <tt class="docutils literal">end()</tt> member functions (they have to return iterators).</p>
</div>
<div class="section" id="id34">
<h3>14.8.2&nbsp;&nbsp;&nbsp;Defined in</h3>
@@ -2567,12 +2567,12 @@ <h1 class="title">luabind 0.9</h1>
<h2><a class="toc-backref" href="#id114">14.9&nbsp;&nbsp;&nbsp;raw</a></h2>
<div class="note">
<p class="first admonition-title">Note</p>
-<p class="last"><tt class="docutils literal"><span class="pre">raw()</span></tt> has been deprecated. <tt class="docutils literal"><span class="pre">lua_State*</span></tt> parameters are
+<p class="last"><tt class="docutils literal">raw()</tt> has been deprecated. <tt class="docutils literal">lua_State*</tt> parameters are
automatically handled by luabind.</p>
</div>
<div class="section" id="id37">
<h3>14.9.1&nbsp;&nbsp;&nbsp;Motivation</h3>
-<p>This converter policy will pass through the <tt class="docutils literal"><span class="pre">lua_State*</span></tt> unmodified.
+<p>This converter policy will pass through the <tt class="docutils literal">lua_State*</tt> unmodified.
This can be useful for example when binding functions that need to
return a <tt class="docutils literal"><span class="pre">luabind::object</span></tt>. The parameter will be removed from the
function signature, decreasing the function arity by one.</p>
@@ -2602,7 +2602,7 @@ <h1 class="title">luabind 0.9</h1>
</tr>
</thead>
<tbody valign="top">
-<tr><td><tt class="docutils literal"><span class="pre">index</span></tt></td>
+<tr><td><tt class="docutils literal">index</tt></td>
<td>The index of the lua_State* parameter.</td>
</tr>
</tbody>
@@ -3016,7 +3016,7 @@ <h1 class="title">luabind 0.9</h1>
<p>It is possible to split up a module registration into several
translation units without making each registration dependent
on the module it's being registered in.</p>
-<p><tt class="docutils literal"><span class="pre">a.cpp</span></tt>:</p>
+<p><tt class="docutils literal">a.cpp</tt>:</p>
<pre class="literal-block">
luabind::scope register_a()
{
@@ -3026,7 +3026,7 @@ <h1 class="title">luabind 0.9</h1>
;
}
</pre>
-<p><tt class="docutils literal"><span class="pre">b.cpp</span></tt>:</p>
+<p><tt class="docutils literal">b.cpp</tt>:</p>
<pre class="literal-block">
luabind::scope register_b()
{
@@ -3036,7 +3036,7 @@ <h1 class="title">luabind 0.9</h1>
;
}
</pre>
-<p><tt class="docutils literal"><span class="pre">module_ab.cpp</span></tt>:</p>
+<p><tt class="docutils literal">module_ab.cpp</tt>:</p>
<pre class="literal-block">
luabind::scope register_a();
luabind::scope register_b();
@@ -3056,8 +3056,8 @@ <h1 class="title">luabind 0.9</h1>
<div class="section" id="pcall-errorfunc">
<h2>16.1&nbsp;&nbsp;&nbsp;pcall errorfunc</h2>
<p>As mentioned in the <a class="reference external" href="http://www.lua.org/manual/5.0/manual.html">Lua documentation</a>, it is possible to pass an
-error handler function to <tt class="docutils literal"><span class="pre">lua_pcall()</span></tt>. Luabind makes use of
-<tt class="docutils literal"><span class="pre">lua_pcall()</span></tt> internally when calling member functions and free functions.
+error handler function to <tt class="docutils literal">lua_pcall()</tt>. Luabind makes use of
+<tt class="docutils literal">lua_pcall()</tt> internally when calling member functions and free functions.
It is possible to set the error handler function that Luabind will use
globally:</p>
<pre class="literal-block">
@@ -3066,11 +3066,11 @@ <h1 class="title">luabind 0.9</h1>
</pre>
<p>This is primarily useful for adding more information to the error message
returned by a failed protected call. For more information on how to use the
-pcall_callback function, see <tt class="docutils literal"><span class="pre">errfunc</span></tt> under the
+pcall_callback function, see <tt class="docutils literal">errfunc</tt> under the
<a class="reference external" href="http://www.lua.org/manual/5.0/manual.html#3.15">pcall section of the lua manual</a>.</p>
<p>For more information on how to retrieve debugging information from lua, see
<a class="reference external" href="http://www.lua.org/manual/5.0/manual.html#4">the debug section of the lua manual</a>.</p>
-<p>The message returned by the <tt class="docutils literal"><span class="pre">pcall_callback</span></tt> is accessable as the top lua
+<p>The message returned by the <tt class="docutils literal">pcall_callback</tt> is accessable as the top lua
value on the stack. For example, if you would like to access it as a luabind
object, you could do like this:</p>
<pre class="literal-block">
@@ -3109,22 +3109,22 @@ <h1 class="title">luabind 0.9</h1>
</pre>
<p>For more information about what kind of information you can add to the error
message, see <a class="reference external" href="http://www.lua.org/manual/5.0/manual.html#4">the debug section of the lua manual</a>.</p>
-<p>Note that the callback set by <tt class="docutils literal"><span class="pre">set_pcall_callback()</span></tt> will only be used when
-luabind executes lua code. Anytime when you call <tt class="docutils literal"><span class="pre">lua_pcall</span></tt> yourself, you
+<p>Note that the callback set by <tt class="docutils literal">set_pcall_callback()</tt> will only be used when
+luabind executes lua code. Anytime when you call <tt class="docutils literal">lua_pcall</tt> yourself, you
have to supply your function if you want error messages translated.</p>
</div>
<div class="section" id="lua-panic">
<h2>16.3&nbsp;&nbsp;&nbsp;lua panic</h2>
<p>When lua encounters a fatal error caused by a bug from the C/C++ side, it will
call its internal panic function. This can happen, for example, when you call
-<tt class="docutils literal"><span class="pre">lua_gettable</span></tt> on a value that isn't a table. If you do the same thing from
+<tt class="docutils literal">lua_gettable</tt> on a value that isn't a table. If you do the same thing from
within lua, it will of course just fail with an error message.</p>
-<p>The default panic function will <tt class="docutils literal"><span class="pre">exit()</span></tt> the application. If you want to
+<p>The default panic function will <tt class="docutils literal">exit()</tt> the application. If you want to
handle this case without terminating your application, you can define your own
-panic function using <tt class="docutils literal"><span class="pre">lua_atpanic</span></tt>. The best way to continue from the panic
+panic function using <tt class="docutils literal">lua_atpanic</tt>. The best way to continue from the panic
function is to make sure lua is compiled as C++ and throw an exception from
-the panic function. Throwing an exception instead of using <tt class="docutils literal"><span class="pre">setjmp</span></tt> and
-<tt class="docutils literal"><span class="pre">longjmp</span></tt> will make sure the stack is correctly unwound.</p>
+the panic function. Throwing an exception instead of using <tt class="docutils literal">setjmp</tt> and
+<tt class="docutils literal">longjmp</tt> will make sure the stack is correctly unwound.</p>
<p>When the panic function is called, the lua state is invalid, and the only
allowed operation on it is to close it.</p>
<p>For more information, see the <a class="reference external" href="http://www.lua.org/manual/5.0/manual.html#3.19">lua manual section 3.19</a>.</p>
@@ -3134,8 +3134,8 @@ <h1 class="title">luabind 0.9</h1>
<p>Since lua is generally built as a C library, any callbacks called from lua
cannot under any circumstance throw an exception. Because of that, luabind has
to catch all exceptions and translate them into proper lua errors (by calling
-<tt class="docutils literal"><span class="pre">lua_error()</span></tt>). This means we have a <tt class="docutils literal"><span class="pre">catch(...)</span> <span class="pre">{}</span></tt> in there.</p>
-<p>In Visual Studio, <tt class="docutils literal"><span class="pre">catch</span> <span class="pre">(...)</span></tt> will not only catch C++ exceptions, it will
+<tt class="docutils literal">lua_error()</tt>). This means we have a <tt class="docutils literal"><span class="pre">catch(...)</span> {}</tt> in there.</p>
+<p>In Visual Studio, <tt class="docutils literal">catch <span class="pre">(...)</span></tt> will not only catch C++ exceptions, it will
also catch structured exceptions, such as segmentation fault. This means that if
your function, that gets called from luabind, makes an invalid memory
adressing, you won't notice it. All that will happen is that lua will return
@@ -3212,11 +3212,11 @@ <h1 class="title">luabind 0.9</h1>
<p>There are a number of configuration options available when building luabind.
It is very important that your project has the exact same configuration
options as the ones given when the library was build! The exceptions are the
-<tt class="docutils literal"><span class="pre">LUABIND_MAX_ARITY</span></tt> and <tt class="docutils literal"><span class="pre">LUABIND_MAX_BASES</span></tt> which are template-based
+<tt class="docutils literal">LUABIND_MAX_ARITY</tt> and <tt class="docutils literal">LUABIND_MAX_BASES</tt> which are template-based
options and only matters when you use the library (which means they can
differ from the settings of the library).</p>
<p>The default settings which will be used if no other settings are given
-can be found in <tt class="docutils literal"><span class="pre">luabind/config.hpp</span></tt>.</p>
+can be found in <tt class="docutils literal">luabind/config.hpp</tt>.</p>
<p>If you want to change the settings of the library, you can modify the
config file. It is included and used by all makefiles. You can change paths
to Lua and boost in there as well.</p>
@@ -3228,8 +3228,8 @@ <h1 class="title">luabind 0.9</h1>
arity you have to redefine it. A high limit will increase compilation time.</dd>
<dt>LUABIND_MAX_BASES</dt>
<dd>Controls the maximum number of classes one class can derive from in
-luabind (the number of classes specified within <tt class="docutils literal"><span class="pre">bases&lt;&gt;</span></tt>).
-<tt class="docutils literal"><span class="pre">LUABIND_MAX_BASES</span></tt> defaults to 4. A high limit will increase
+luabind (the number of classes specified within <tt class="docutils literal">bases&lt;&gt;</tt>).
+<tt class="docutils literal">LUABIND_MAX_BASES</tt> defaults to 4. A high limit will increase
compilation time.</dd>
<dt>LUABIND_NO_ERROR_CHECKING</dt>
<dd><p class="first">If this macro is defined, all the Lua code is expected only to make legal
@@ -3242,7 +3242,7 @@ <h1 class="title">luabind 0.9</h1>
was called. Functions will still be able to throw exceptions when error
checking is disabled.</p>
<p class="last">If a function throws an exception it will be caught by luabind and
-propagated with <tt class="docutils literal"><span class="pre">lua_error()</span></tt>.</p>
+propagated with <tt class="docutils literal">lua_error()</tt>.</p>
</dd>
<dt>LUABIND_NO_EXCEPTIONS</dt>
<dd><p class="first">This define will disable all usage of try, catch and throw in luabind.
@@ -3253,18 +3253,18 @@ <h1 class="title">luabind 0.9</h1>
through Lua has undefined behavior).</p>
<p class="last">Where exceptions are the only way to get an error report from luabind,
they will be replaced with calls to the callback functions set with
-<tt class="docutils literal"><span class="pre">set_error_callback()</span></tt> and <tt class="docutils literal"><span class="pre">set_cast_failed_callback()</span></tt>.</p>
+<tt class="docutils literal">set_error_callback()</tt> and <tt class="docutils literal">set_cast_failed_callback()</tt>.</p>
</dd>
<dt>LUA_API</dt>
<dd>If you want to link dynamically against Lua, you can set this define to
the import-keyword on your compiler and platform. On Windows in Visual Studio
-this should be <tt class="docutils literal"><span class="pre">__declspec(dllimport)</span></tt> if you want to link against Lua
+this should be <tt class="docutils literal">__declspec(dllimport)</tt> if you want to link against Lua
as a dll.</dd>
<dt>LUABIND_DYNAMIC_LINK</dt>
<dd>Must be defined if you intend to link against the luabind shared
library.</dd>
<dt>LUABIND_NO_RTTI</dt>
-<dd>You can define this if you don't want luabind to use <tt class="docutils literal"><span class="pre">dynamic_cast&lt;&gt;</span></tt>.
+<dd>You can define this if you don't want luabind to use <tt class="docutils literal">dynamic_cast&lt;&gt;</tt>.
It will disable <a class="reference internal" href="#object-identity">Object identity</a>.</dd>
<dt>NDEBUG</dt>
<dd>This define will disable all asserts and should be defined in a release
@@ -3276,14 +3276,14 @@ <h1 class="title">luabind 0.9</h1>
<p>The classes and objects are implemented as user data in Lua. To make sure that
the user data really is the internal structure it is supposed to be, we tag
their metatables. A user data who's metatable contains a boolean member named
-<tt class="docutils literal"><span class="pre">__luabind_classrep</span></tt> is expected to be a class exported by luabind. A user
-data who's metatable contains a boolean member named <tt class="docutils literal"><span class="pre">__luabind_class</span></tt> is
+<tt class="docutils literal">__luabind_classrep</tt> is expected to be a class exported by luabind. A user
+data who's metatable contains a boolean member named <tt class="docutils literal">__luabind_class</tt> is
expected to be an instantiation of a luabind class.</p>
<p>This means that if you make your own user data and tags its metatable with the
exact same names, you can very easily fool luabind and crash the application.</p>
-<p>In the Lua registry, luabind keeps an entry called <tt class="docutils literal"><span class="pre">__luabind_classes</span></tt>. It
+<p>In the Lua registry, luabind keeps an entry called <tt class="docutils literal">__luabind_classes</tt>. It
should not be removed or overwritten.</p>
-<p>In the global table, a variable called <tt class="docutils literal"><span class="pre">super</span></tt> is used every time a
+<p>In the global table, a variable called <tt class="docutils literal">super</tt> is used every time a
constructor in a lua-class is called. This is to make it easy for that
constructor to call its base class' constructor. So, if you have a global
variable named super it may be overwritten. This is probably not the best
@@ -3291,8 +3291,8 @@ <h1 class="title">luabind 0.9</h1>
<div class="note">
<p class="first admonition-title">Note</p>
<p>Deprecated</p>
-<p><tt class="docutils literal"><span class="pre">super()</span></tt> has been deprecated since version 0.8 in favor of directly
-invoking the base class' <tt class="docutils literal"><span class="pre">__init()</span></tt> function:</p>
+<p><tt class="docutils literal">super()</tt> has been deprecated since version 0.8 in favor of directly
+invoking the base class' <tt class="docutils literal">__init()</tt> function:</p>
<pre class="last literal-block">
function Derived:__init()
Base.__init(self)
@@ -3316,8 +3316,8 @@ <h1 class="title">luabind 0.9</h1>
<dl class="docutils">
<dt>What's up with __cdecl and __stdcall?</dt>
<dd>If you're having problem with functions
-that cannot be converted from <tt class="docutils literal"><span class="pre">void</span> <span class="pre">(__stdcall</span> <span class="pre">*)(int,int)</span></tt> to
-<tt class="docutils literal"><span class="pre">void</span> <span class="pre">(__cdecl*)(int,int)</span></tt>. You can change the project settings to make the
+that cannot be converted from <tt class="docutils literal">void (__stdcall <span class="pre">*)(int,int)</span></tt> to
+<tt class="docutils literal">void <span class="pre">(__cdecl*)(int,int)</span></tt>. You can change the project settings to make the
compiler generate functions with __cdecl calling conventions. This is
a problem in developer studio.</dd>
<dt>What's wrong with functions taking variable number of arguments?</dt>
View
0  src/luabind/doc/index.html 100755 → 100644
File mode changed
View
0  src/luabind/doc/luabind-logo-label.ps 100755 → 100644
File mode changed
View
0  src/luabind/doc/style.css 100755 → 100644
File mode changed
View
2  src/luabind/doc/version.rst 100755 → 100644
@@ -1 +1 @@
-.. |version| replace:: 0.9
+.. |version| replace:: 0.9.1
View
0  src/luabind/examples/cln/README 100755 → 100644
File mode changed
View
0  src/luabind/examples/cln/cln_test.lua 100755 → 100644
File mode changed
View
0  src/luabind/examples/filesystem/directory_iterator.hpp 100644 → 100755
File mode changed
View
0  src/luabind/examples/filesystem/filesystem.cpp 100644 → 100755
File mode changed
View
0  src/luabind/examples/glut/glut_bindings.lua 100755 → 100644
File mode changed
View
0  src/luabind/examples/hello_world/README 100755 → 100644
File mode changed
View
0  src/luabind/examples/hello_world/hello_world.cpp 100644 → 100755
File mode changed
View
0  src/luabind/examples/hello_world/project-root.jam 100755 → 100644
File mode changed
View
0  src/luabind/examples/regexp/regex.lua 100755 → 100644
File mode changed
View
0  src/luabind/luabind/back_reference.hpp 100644 → 100755
File mode changed
View
0  src/luabind/luabind/back_reference_fwd.hpp 100644 → 100755
File mode changed
View
1  src/luabind/luabind/class.hpp
@@ -106,7 +106,6 @@
#include <luabind/detail/calc_arity.hpp>
#include <luabind/detail/call_member.hpp>
#include <luabind/detail/enum_maker.hpp>
-#include <luabind/detail/get_signature.hpp>
#include <luabind/detail/operator_id.hpp>
#include <luabind/detail/pointee_typeid.hpp>
#include <luabind/detail/link_compatibility.hpp>
View
0  src/luabind/luabind/class_info.hpp 100644 → 100755
File mode changed
View
0  src/luabind/luabind/detail/call_operator_iterate.hpp 100644 → 100755
File mode changed
View
0  src/luabind/luabind/detail/class_cache.hpp 100644 → 100755
File mode changed
View
4 src/luabind/luabind/detail/constructor.hpp
@@ -25,7 +25,7 @@ inline void inject_backref(lua_State*, void*, void*)
template <class T>
void inject_backref(lua_State* L, T* p, wrap_base*)
{
- weak_ref(get_main_thread(L), 1).swap(wrap_access::ref(*p));
+ weak_ref(get_main_thread(L), L, 1).swap(wrap_access::ref(*p));
}
template <std::size_t Arity, class T, class Pointer, class Signature>
@@ -105,5 +105,7 @@ struct construct_aux<N, T, Pointer, Signature>
}
};
+# undef N
+
#endif
View
0  src/luabind/luabind/detail/debug.hpp 100644 → 100755
File mode changed
View
11 src/luabind/luabind/detail/format_signature.hpp
@@ -13,20 +13,13 @@
# include <boost/mpl/next.hpp>
# include <boost/mpl/size.hpp>
-namespace luabind { namespace adl
-{
+namespace luabind {
class object;
class argument;
template <class Base>
struct table;
-} // namespace adl
-
-using adl::object;
-using adl::argument;
-using adl::table;
-
} // namespace luabind
namespace luabind { namespace detail {
@@ -146,7 +139,7 @@ void format_signature(lua_State* L, char const* function, Signature)
);
lua_pushstring(L, ")");
- lua_concat(L, mpl::size<Signature>() * 2 + 2);
+ lua_concat(L, static_cast<int>(mpl::size<Signature>()) * 2 + 2);
}
}} // namespace luabind::detail
View
218 src/luabind/luabind/detail/get_signature.hpp
@@ -1,218 +0,0 @@
-// Copyright (c) 2003 Daniel Wallin and Arvid Norberg
-
-// Permission is hereby granted, free of charge, to any person obtaining a
-// copy of this software and associated documentation files (the "Software"),
-// to deal in the Software without restriction, including without limitation
-// the rights to use, copy, modify, merge, publish, distribute, sublicense,
-// and/or sell copies of the Software, and to permit persons to whom the
-// Software is furnished to do so, subject to the following conditions:
-
-// The above copyright notice and this permission notice shall be included
-// in all copies or substantial portions of the Software.
-
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
-// ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
-// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
-// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
-// SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
-// ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
-// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
-// OR OTHER DEALINGS IN THE SOFTWARE.
-
-#ifndef LUABIND_NO_ERROR_CHECKING
-
-#if !BOOST_PP_IS_ITERATING
-
-#ifndef LUABIND_GET_SIGNATURE_HPP_INCLUDED
-#define LUABIND_GET_SIGNATURE_HPP_INCLUDED
-
-#include <boost/config.hpp>
-#include <boost/preprocessor/repeat.hpp>
-#include <boost/preprocessor/iteration/iterate.hpp>
-#include <boost/preprocessor/repetition/enum.hpp>
-#include <boost/preprocessor/repetition/enum_params.hpp>
-#include <boost/preprocessor/punctuation/comma_if.hpp>
-#include <boost/preprocessor/cat.hpp>
-
-#include <luabind/config.hpp>
-#include <luabind/detail/signature_match.hpp>
-#include <luabind/typeid.hpp>
-
-
-namespace luabind { namespace detail
-{
-
- std::string LUABIND_API get_class_name(lua_State* L, type_id const& i);
-
- template<class T>
- std::string name_of_type(by_value<T>, lua_State* L, int) { return luabind::detail::get_class_name(L, typeid(T)); };
- template<class T>
- std::string name_of_type(by_reference<T>, lua_State* L, int) { return name_of_type(LUABIND_DECORATE_TYPE(T), L, 0L) + "&"; };
- template<class T>
- std::string name_of_type(by_pointer<T>, lua_State* L, int) { return name_of_type(LUABIND_DECORATE_TYPE(T), L, 0L) + "*"; };
- template<class T>
- std::string name_of_type(by_const_reference<T>, lua_State* L, int) { return "const " + name_of_type(LUABIND_DECORATE_TYPE(T), L, 0L) + "&"; };
- template<class T>
- std::string name_of_type(by_const_pointer<T>, lua_State* L, int) { return "const " + name_of_type(LUABIND_DECORATE_TYPE(T), L, 0L) + "*"; };
-
- inline std::string name_of_type(by_value<luabind::object>, lua_State*, int) { return "object"; };
- inline std::string name_of_type(by_const_reference<luabind::object>, lua_State*, int) { return "object"; };
- inline std::string name_of_type(by_value<bool>, lua_State*, int) { return "boolean"; }
- inline std::string name_of_type(by_value<char>, lua_State*, int) { return "number"; }
- inline std::string name_of_type(by_value<short>, lua_State*, int) { return "number"; }
- inline std::string name_of_type(by_value<int>, lua_State*, int) { return "number"; }
- inline std::string name_of_type(by_value<long>, lua_State*, int) { return "number"; }
- inline std::string name_of_type(by_value<unsigned char>, lua_State*, int) { return "number"; }
- inline std::string name_of_type(by_value<unsigned short>, lua_State*, int) { return "number"; }
- inline std::string name_of_type(by_value<unsigned int>, lua_State*, int) { return "number"; }
- inline std::string name_of_type(by_value<unsigned long>, lua_State*, int) { return "number"; }
-
- inline std::string name_of_type(by_value<const bool>, lua_State*, int) { return "boolean"; }
- inline std::string name_of_type(by_value<const char>, lua_State*, int) { return "number"; }
- inline std::string name_of_type(by_value<const short>, lua_State*, int) { return "number"; }
- inline std::string name_of_type(by_value<const int>, lua_State*, int) { return "number"; }
- inline std::string name_of_type(by_value<const long>, lua_State*, int) { return "number"; }
- inline std::string name_of_type(by_value<const unsigned char>, lua_State*, int) { return "number"; }
- inline std::string name_of_type(by_value<const unsigned short>, lua_State*, int) { return "number"; }
- inline std::string name_of_type(by_value<const unsigned int>, lua_State*, int) { return "number"; }
- inline std::string name_of_type(by_value<const unsigned long>, lua_State*, int) { return "number"; }
-
-// template<class T>
-// inline std::string name_of_type(by_value<luabind::functor<T> >, lua_State* L, long) { return "function<" + name_of_type(LUABIND_DECORATE_TYPE(T), L, 0L) + ">"; }
-
- inline std::string name_of_type(by_value<std::string>, lua_State*, int) { return "string"; }
- inline std::string name_of_type(by_const_pointer<char>, lua_State*, int) { return "string"; }
- inline std::string name_of_type(by_pointer<lua_State>, lua_State*, int) { return "lua_State*"; }
-
- template<class T>
- struct type_name_unless_void
- {
- inline static void apply(std::string& s, lua_State* L, bool first)
- {
- if (!first) s += ", ";
- s += name_of_type(LUABIND_DECORATE_TYPE(T), L, 0L);
- }
- };
-
- template<>
- struct type_name_unless_void<null_type>
- {
- inline static void apply(std::string&, lua_State*, bool) {}
- };
-
-#define LUABIND_ADD_LUA_TYPE_NAME(z, n, _) type_name_unless_void<BOOST_PP_CAT(A, BOOST_PP_INC(n))>::apply(s, L, false);
-
- #define BOOST_PP_ITERATION_PARAMS_1 (4, (0, LUABIND_MAX_ARITY, <luabind/detail/get_signature.hpp>, 1))
- #include BOOST_PP_ITERATE()
-
- template<class F>
- struct get_member_signature
- {
- static inline void apply(lua_State* L, std::string& s)
- {
- get_member_signature_impl(static_cast<F>(0), L, s);
- }
- };
-
- template<class F>
- struct get_free_function_signature
- {
- static inline void apply(lua_State* L, std::string& s)
- {
- get_free_function_signature_impl(static_cast<F>(0), L, s);
- }
- };
-
-
- template<class Sig>
- struct get_signature
- {
- static inline void apply(lua_State* L, std::string& s)
- {
- get_signature_impl(static_cast<const Sig*>(0), L, s);
- }
- };
-
- template<BOOST_PP_ENUM_PARAMS(LUABIND_MAX_ARITY, class A)>
- inline void get_signature_impl(const constructor<BOOST_PP_ENUM_PARAMS(LUABIND_MAX_ARITY, A)>*, lua_State* L, std::string& s)
- {
- s += "(";
- type_name_unless_void<A0>::apply(s, L, true);
- BOOST_PP_REPEAT(BOOST_PP_DEC(LUABIND_MAX_ARITY), LUABIND_ADD_LUA_TYPE_NAME, _)
- s += ")";
- }
-
-#undef LUABIND_ADD_LUA_TYPE_NAME
-
- template<class T>
- struct get_setter_signature
- {
- static void apply(lua_State* L, std::string& s)
- {
- s += "(";
- s += name_of_type(LUABIND_DECORATE_TYPE(T), L, 0L);
- s += ")";
- }
- };
-
-}}
-
-#endif // LUABIND_GET_SIGNATURE_HPP_INCLUDED
-
-#else
-#if BOOST_PP_ITERATION_FLAGS() == 1
-
- // member functions
- template<class T, class C BOOST_PP_COMMA_IF(BOOST_PP_ITERATION()) BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(), class A)>
- inline void get_member_signature_impl(T(C::*)(BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(), A)), lua_State* L, std::string& s)
- {
- s += "(";
-#if BOOST_PP_ITERATION() > 0
- s += name_of_type(LUABIND_DECORATE_TYPE(A0), L, 0L);
- BOOST_PP_REPEAT(BOOST_PP_DEC(BOOST_PP_ITERATION()), LUABIND_ADD_LUA_TYPE_NAME, _)
-#endif
- s += ")";
- }
-
- template<class T, class C BOOST_PP_COMMA_IF(BOOST_PP_ITERATION()) BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(), class A)>
- inline void get_member_signature_impl(T(C::*)(BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(), A)) const, lua_State* L, std::string& s)
- {
- (void)L;
- s += "(";
-#if BOOST_PP_ITERATION() > 0
- s += name_of_type(LUABIND_DECORATE_TYPE(A0), L, 0L);
- BOOST_PP_REPEAT(BOOST_PP_DEC(BOOST_PP_ITERATION()), LUABIND_ADD_LUA_TYPE_NAME, _)
-#endif
- s += ") const";
- }
-
- // const C& obj
- template<class T BOOST_PP_COMMA_IF(BOOST_PP_ITERATION()) BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(), class A)>
- inline void get_member_signature_impl(T(*f)(BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(), A)), lua_State* L, std::string& s)
- {
- s += "(";
-#if BOOST_PP_ITERATION() > 0
- s += name_of_type(LUABIND_DECORATE_TYPE(A0), L, 0L);
- BOOST_PP_REPEAT(BOOST_PP_DEC(BOOST_PP_ITERATION()), LUABIND_ADD_LUA_TYPE_NAME, _)
-#endif
- s += ")";
- }
-
- // free functions
- template<class T BOOST_PP_COMMA_IF(BOOST_PP_ITERATION()) BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(), class A)>
- inline void get_free_function_signature_impl(T(*f)(BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(), A)), lua_State* L, std::string& s)
- {
- (void)f;
- s += "(";
-#if BOOST_PP_ITERATION() > 0
- s += name_of_type(LUABIND_DECORATE_TYPE(A0), L, 0L);