Boost C++ Libraries: Ticket #9561: tribool documentation suggestion https://svn.boost.org/trac10/ticket/9561 <p> Please add warning to docs (like basic usage of tribool) that you can't write like this. </p> <p> <br /> <br /> </p> <p> false==0, so it casted to function pointer, so this expression is always <strong>indeterminate</strong>, not false: </p> <pre class="wiki">tribool a = 0? indeterminate : false; </pre><p> <br /> <br /> </p> <p> true!=0, so cast goes other way - indeterminate casted to bool, this epression always <strong>true</strong>, not indeterminate: </p> <pre class="wiki">tribool b = 1? indeterminate : true; </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/9561 Trac 1.4.3 James E. King, III Sat, 13 Oct 2018 04:24:56 GMT owner changed https://svn.boost.org/trac10/ticket/9561#comment:1 https://svn.boost.org/trac10/ticket/9561#comment:1 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Douglas Gregor</span> to <span class="trac-author">James E. King, III</span> </li> </ul> <p> The two operands to ? have different types. One is used by tribool (which is not a bool), and one is a bool. If you enable C++11 the compiler properly detects this issue and fails. If you use C++03 it does fail as documented. I'm not certain it's worth documenting this behavior for C++03 however, so I am going to resolve this as wontfix. It can be reopened as a github issue if folks feel strongly it needs to be addressed. </p> Ticket James E. King, III Sat, 13 Oct 2018 04:25:04 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/9561#comment:2 https://svn.boost.org/trac10/ticket/9561#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">wontfix</span> </li> </ul> Ticket