Index: libs/utility/operators.htm
===================================================================
RCS file: /cvsroot/boost/boost/libs/utility/operators.htm,v
retrieving revision 1.12
diff -u -r1.12 operators.htm
--- libs/utility/operators.htm	4 Nov 2002 01:59:31 -0000	1.12
+++ libs/utility/operators.htm	27 Feb 2003 10:51:17 -0000
@@ -340,6 +340,8 @@
 
       <li><code><a href="#indexable">indexable&lt;&gt;</a></code></li>
 
+      <li><code><a href="#bool_testable">bool_testable&lt;&gt;</a></code></li>
+
       <li>Any composite operator template that includes at least one of the
       above</li>
     </ul>
@@ -528,6 +530,16 @@
       </tr>
 
       <tr>
+        <td><code><a name=
+        "bool_testable">bool_testable&lt;T&gt;</a></code></td>
+
+        <td><code>operator <a href="#bool_testable_note">unspecified-bool-type</a>() const</code></td>
+
+        <td><code>!t</code>.<br>
+         Return convertible to <code>bool</code>.</td>
+      </tr>
+
+      <tr>
         <td><code><a name="addable1">addable&lt;T&gt;</a></code><br>
          <code>addable1&lt;T&gt;</code></td>
 
@@ -974,6 +986,45 @@
     that don't implement the NRVO. <br>
      <br>
      
+    <h4><a name="bool_testable_note">Bool Testable</a> Note</h4>
+
+    <p><code><a href="#bool_testable">bool_testable</a></code> provides a 
+    conversion operator to an unspecified value that, when used in boolean 
+    contexts, is equivalent to <code>!(!t)</code>.  This allows 
+    expressions such as :</p>
+
+    <pre>
+    if (object)
+       ...
+    </pre>
+
+    <p><code><a href="#bool_testable">bool_testable</a></code> differs in its
+    use slightly in that it is necessary to publicly derive from it.  This is
+    because conversion operators must be members. e.g:</p>
+
+<pre>
+class Stream : public boost::bool_testable&lt;Stream&gt;
+{
+public:
+    explicit Stream(const char * source);
+    bool operator!() const;  // (Could also be a non-member function)
+    // operator unspecified-bool-type() auto-generated 
+    // by bool_testable&lt;&gt;
+};
+
+void f()
+{
+    if (Stream stream("source.txt"))
+    {
+        // use stream ...
+    }
+}
+</pre>
+
+    <p>Although it would perhaps have made more semantic sense to provide 
+    <code>bool operator!()</code> given <code>operator bool()</code>, it is
+    difficult to implement a safe boolean conversion operator (that prevents
+    accidental conversion to integer types).</p>
 
     <h3><a name="grpd_oprs">Grouped Arithmetic Operators</a></h3>
 
