[patch] Use a more idiomatic bool operator in ErrorOr

Alp Toker alp at nuanti.com
Thu Jan 16 10:13:58 PST 2014


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




More information about the llvm-commits mailing list