<div dir="ltr"><div>Hello,</div>
<div>&nbsp;</div>
<div>I&#39;ve just noticed that the following code might be missleading:</div>
<div>&nbsp;</div>
<div>boost::optional&lt;int&gt; opt;</div>
<div>opt = 0;</div>
<div>std::cout &lt;&lt; opt;</div>
<div>&nbsp;</div>
<div>If boost/optional/optional_io.hpp is not included, the above code outputs &quot;1&quot; - because&nbsp;boost::optional is implicitly convertible to bool.</div>
<div>Maybe it&#39;s worth either including boost/optional/optional_io.hpp in boost/optional.hpp or making some trick to generate compiler error if operator &lt;&lt;() used&nbsp;and optional_io.hpp is not included?</div>
<div>&nbsp;</div></div>