<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Tue, Sep 20, 2016 at 2:51 PM Greg Clayton <<a href="mailto:gclayton@apple.com">gclayton@apple.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br class="gmail_msg">
> On Sep 20, 2016, at 2:49 PM, Mehdi Amini <<a href="mailto:mehdi.amini@apple.com" class="gmail_msg" target="_blank">mehdi.amini@apple.com</a>> wrote:<br class="gmail_msg">
><br class="gmail_msg">
><br class="gmail_msg">
>> On Sep 20, 2016, at 2:46 PM, Zachary Turner <<a href="mailto:zturner@google.com" class="gmail_msg" target="_blank">zturner@google.com</a>> wrote:<br class="gmail_msg">
>><br class="gmail_msg">
>> Occasionally (and in my experience *very* occasionally), you need to treat "" as different from null.<br class="gmail_msg">
<br class="gmail_msg">
doesn't StringRef store an actual pointer to ""? This would mean StringRef::data() would return non null, but StringRef::size() would return 0. So I believe that isn't a problem with StringRef<br class="gmail_msg"></blockquote><div><br></div><div>Right, it's only a problem when you need to write a function that returns or accepts a string, and null has to be treated differently than empty.  As Mehdi said, one option is an Optional<StringRef>, although I admit that there are times where pointers would still be more convenient.  They're still used in some places in llvm and clang for example, just not nearly as often as StringRef.</div></div></div>