I think the story goes something like this:<br>1) people implemented operator bools all over the place because they didn't know about its pitfalls<br>2) someone, aware of the pitfalls of operator bool, implemented ErrorOr's boolean testability safely<br>
3) I noticed one (and then all) of the operator bools and fixed it by adding a compatibility macro and sticking that on to the existing operator bools to make them better.<br><br>But I never looked around for/cleaned up any instances of (2). There may be others.<br>
<div>On Wed Jan 15 2014 at 10:21:07 AM, Rafael Espíndola <<a href="mailto:rafael.espindola@gmail.com">rafael.espindola@gmail.com</a>> wrote:</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
This seems to be the more common way to implement operator bool in<br>
LLVM. Any reason why the one in ErrorOr was different?<br>
<br>
Cheers,<br>
Rafael<br>
______________________________<u></u>_________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/llvm-commits</a><br>
</blockquote>