Use BOOST_EXPLICIT_OPERATOR_BOOL for optional

I often have the problem that when I change a std::wstring to boost::optional<std::wstring> and the variable is used as a parameter with Boost.Format, the result silently changes from the string contents to "1".

This change prevents implicit conversion to bool if the compiler supports explicit conversion operators.
This commit is contained in:
Marcel Raad
2014-04-24 10:00:43 +02:00
committed by Andrzej Krzemienski
parent b4738ac07e
commit c7cf80e5df
8 changed files with 46 additions and 23 deletions

View File

@ -163,7 +163,7 @@
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"><p><small>Last revised: April 11, 2014 at 13:25:26 GMT</small></p></td>
<td align="left"><p><small>Last revised: April 26, 2014 at 08:58:33 GMT</small></p></td>
<td align="right"><div class="copyright-footer"></div></td>
</tr></table>
<hr>