<div class="gmail_quote">On Mon, Jun 8, 2009 at 2:16 PM, Steven Watanabe <span dir="ltr">&lt;<a href="mailto:watanabesj@gmail.com">watanabesj@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
AMDG<div><div></div><div class="h5"><br>
<br>
Robert Dailey wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Just wondering what happens if I do this:<br>
<br>
boost::shared_ptr&lt;Foo&gt; foo;<br>
boost::shared_ptr&lt;Bar&gt; bar;<br>
if( foo &amp;&amp; bar )<br>
{<br>
  // Do stuff if both pointers are valid...<br>
}<br>
<br>
I did not see an overloaded &amp;&amp; operator in the interface of the class. When<br>
using normal pointer semantics, this code is valid through implicit<br>
conversion of a pointer value to a boolean type.<br>
  <br>
</blockquote>
<br></div></div>
The same applies to shared_ptr.<br>
<a href="http://www.boost.org/libs/smart_ptr/shared_ptr.htm#conversions" target="_blank">http://www.boost.org/libs/smart_ptr/shared_ptr.htm#conversions</a></blockquote><div><br></div><div>Thanks. I figured this was the case but I guess I was just having trouble finding the header file in which this casting operator is implemented. I appreciate the answers to my embarrassingly obvious question.</div>
</div>

