[patch] Use a more idiomatic bool operator in ErrorOr
Reid Kleckner
rnk at google.com
Thu Jan 16 10:21:41 PST 2014
Oh, then I take it back. For something as central as ErrorOr, let's leave
in the portable safe bool idiom.
On Thu, Jan 16, 2014 at 10:13 AM, Alp Toker <alp at nuanti.com> wrote:
>
> On 16/01/2014 18:05, Reid Kleckner wrote:
>
>> With the impending switch to C++11, feel free to cleanup instances of
>> this safe bool idiom.
>>
>
> Very unfortunate news on that front: explicit operators aren't support
> until MSVC 2013.
>
> http://msdn.microsoft.com/en-us/library/hh567368.aspx
>
> That means LLVM_EXPLICIT will still be defined to nothing on MSVC 2012,
> resulting in inappropriate conversions taking precedence over the bool
> operator.
>
> My heart sank when I saw this won't be in our supported C++11 set.
>
> Alp.
>
>
>>
>> On Wed, Jan 15, 2014 at 10:19 AM, Rafael EspĂndola <
>> rafael.espindola at gmail.com <mailto: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 <mailto:llvm-commits at cs.uiuc.edu>
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>>
>>
>>
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>>
>
> --
> http://www.nuanti.com
> the browser experts
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140116/115cf349/attachment.html>
More information about the llvm-commits
mailing list