[Patch] ErrorOr is not a pointer, don't use a pointer API.

Rui Ueyama ruiu at google.com
Wed Jan 8 14:57:19 PST 2014


On Wed, Jan 8, 2014 at 11:57 AM, Rafael EspĂ­ndola <
rafael.espindola at gmail.com> wrote:

> On 8 January 2014 14:45, dblaikie at gmail.com <dblaikie at gmail.com> wrote:
> > FWIW there are other non-pointers that use pointer-like semantics, such
> as
> > boost::optional. So there's precedence in some pretty mainstream APIs for
> > this design.
>
> Thanks for the pointer. I still find using * and -> confusing in
> something that behaves like a value. If we do decide to keep them,
> would you guys be ok with
>
> * Still adding the explicit get and getError methods (boost::optional
> has a get).
> * Removing the error_code conversion operator. IMHO foo.getError() is
> always nicer than error_code(foo).


I agree, especially on removing error_code operator.


>  > But I don't work with code using this type very much, so it's best left
> up
> > to you/them to decide what kind of API they're most comfortable with.
> >
> > Perhaps a thread link for the "as was observed before" reference would
> also
> > be useful.
>
> Good point. It was
> http://lists.cs.uiuc.edu/pipermail/llvmdev/2013-November/068094.html.
>
> 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/20140108/3f3c7303/attachment.html>


More information about the llvm-commits mailing list