[patch] Use a more idiomatic bool operator in ErrorOr

dblaikie at gmail.com dblaikie at gmail.com
Wed Jan 15 11:01:31 PST 2014


I think the story goes something like this:
1) people implemented operator bools all over the place because they didn't
know about its pitfalls
2) someone, aware of the pitfalls of operator bool, implemented ErrorOr's
boolean testability safely
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.

But I never looked around for/cleaned up any instances of (2). There may be
others.
On Wed Jan 15 2014 at 10:21:07 AM, Rafael EspĂ­ndola <
rafael.espindola at gmail.com> wrote:

> This seems to be the more common way to implement operator bool in
> LLVM. Any reason why the one in ErrorOr was different?
>
> Cheers,
> Rafael
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140115/1310d3c3/attachment.html>


More information about the llvm-commits mailing list