Update of /cvsroot/luabind/luabind/luabind/doc
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3191/doc
Modified Files:
Tag: luabind_rc_0_7
docs.html docs.rst
Log Message:
added stream operator for ValueWrappers
Index: docs.html
===================================================================
RCS file: /cvsroot/luabind/luabind/luabind/doc/docs.html,v
retrieving revision 1.54
retrieving revision 1.54.2.1
diff -u -d -r1.54 -r1.54.2.1
--- docs.html 22 Dec 2005 03:06:54 -0000 1.54
+++ docs.html 1 Jan 2006 16:55:56 -0000 1.54.2.1
@@ -1105,11 +1105,6 @@
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>
-<!-- So what? implementation detail, leave out of docs
-isn't really an implicit cast to bool, but an implicit cast
-to a member pointer, since member pointers don't have any arithmetic operators
-on them (which can cause hard to find errors). The functionality of the cast
-operator -->
<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
that these snippets are equivalent:</p>
<pre class="literal-block">
@@ -1164,6 +1159,13 @@
<p>If you take a <tt class="docutils literal"><span class="pre">luabind::object</span></tt> as a parameter to a function, any Lua value
will match that parameter. That's why we have to make sure it's a table before
we index into it.</p>
+<pre class="literal-block">
+std::ostream& operator<<(std::ostream&, object const&);
+</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>
+operator, the stream operator for that type will be used.</p>
<div class="section" id="iterators">
<h2><a name="iterators">9.1 Iterators</a></h2>
<p>There are two kinds of iterators. The normal iterator that will use the metamethod
Index: docs.rst
===================================================================
RCS file: /cvsroot/luabind/luabind/luabind/doc/docs.rst,v
retrieving revision 1.26
retrieving revision 1.26.2.1
diff -u -d -r1.26 -r1.26.2.1
--- docs.rst 28 Nov 2005 20:55:33 -0000 1.26
+++ docs.rst 1 Jan 2006 16:55:56 -0000 1.26.2.1
@@ -1092,12 +1092,6 @@
an object valid, you can assign it a value. If you want to invalidate an object
you can simply assign it an invalid object.
-.. So what? implementation detail, leave out of docs
- isn't really an implicit cast to bool, but an implicit cast
- to a member pointer, since member pointers don't have any arithmetic operators
- on them (which can cause hard to find errors). The functionality of the cast
- operator
-
The ``operator safe_bool_type()`` is equivalent to ``is_valid()``. This means
that these snippets are equivalent::
@@ -1155,6 +1149,14 @@
will match that parameter. That's why we have to make sure it's a table before
we index into it.
+::
+
+ std::ostream& operator<<(std::ostream&, object const&);
+
+There's a stream operator that makes it possible to print objects or use
+``boost::lexical_cast`` to convert it to a string. This will use lua's string
+conversion function. So if you convert a C++ object with a ``tostring``
+operator, the stream operator for that type will be used.
Iterators
---------
|