[llvm] r303011 - [StringExtras] Add llvm::to_integer.

Zachary Turner via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 16 16:05:27 PDT 2017


On Fri, Jun 16, 2017 at 3:41 PM Justin Bogner <mail at justinbogner.com> wrote:

> I'm a little late to the discussion, but I pretty strongly agree with
> Rui's suggestion that returning an Optional is a better interface here.
> I'm not really convinced that the cases where we can actually deduce a
> type come up often enough that there's a significant useability
> improvement.
>

I'm still not real crazy about it.  I don't like having to indent to handle
the *success* case, which you would see a lot of with an Optional<T> return
and which goes against our coding standard guidelines of early return.
There's also the issue of size.  For example, an Optional<uint64_t> is 16
bytes, so it has non-zero performance cost and questionable style benefits.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170616/9f2a444e/attachment.html>


More information about the llvm-commits mailing list