Boost C++ Libraries: Ticket #9436: Add predefined concept for contextual conversion to bool https://svn.boost.org/trac10/ticket/9436 <p> One concept that is often useful in many types is a contextual conversion to bool. The following expressions should be valid with the concept: </p> <pre class="wiki"> if (o) {} if (!o) {} return bool(o); </pre><p> </p> <p> Add a predefined concept that catches these requirement. A possible implementation: </p> <pre class="wiki">namespace boost { namespace type_erasure { template&lt;class T&gt; struct testable { static bool apply(const T&amp; arg) { return bool(arg); } }; template&lt;class T, class Base&gt; struct concept_interface&lt;testable&lt;T&gt;, Base, T&gt; : Base { explicit operator bool () const { return call(testable&lt;T&gt;(), *this); } }; }} </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/9436 Trac 1.4.3