<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Fri, Nov 6, 2015 at 3:24 PM Joerg Sonnenberger via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Fri, Nov 06, 2015 at 09:07:43AM -0500, Ramkumar Ramachandra via llvm-dev wrote:<br>
> I think it's the same difference we have between int * and<br>
> ArrayRef<int>, for instance. If you have a raw pointer, you are<br>
> expected to keep track of the size out-of-band. In aggregate types,<br>
> size is part of the type, making it very difficult to confuse a [1 x<br>
> i8] with a [3 x i8]. Many people probably use the raw pointer as a way<br>
> to hold a reference to dynamically allocated memory, and as a<br>
> type-escape hatch.<br>
<br>
StringRef is explicitly sized. I'd be more interested in which<br>
interfaces are actually simplified by implicit or explicit conversions<br>
between StringRef and ArrayRef<char>.<br></blockquote><div><br></div><div>I was thinking about mixing SmallVector<> with ArrayRef<>. E.g. to have SmallVector<>::assign(ArrayRef<>). That probably should be my first question. I just realized that ArrayRef and SmallVector are not directly related.<br><br>Having the interface above, SmallVector<char> would not work with StringRef.</div><div><br></div><div>- PaweÅ‚</div></div></div>