<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">+1, totally a bug.  That’s the domain of MutableArrayRef.<div class=""><br class=""></div><div class="">-Chris</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Oct 1, 2017, at 6:52 AM, David Blaikie via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">+1 seems like a bug<br class=""></div><br class=""><div class="gmail_quote"><div dir="ltr" class="">On Sun, Oct 1, 2017 at 12:35 AM Reid Kleckner via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto" class="">It wraps a constant T* and a size_t, so I'm surprised std::sort works. It shouldn't.</div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Sep 30, 2017 5:22 PM, "Daniel Berlin via llvm-dev" <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank" class="">llvm-dev@lists.llvm.org</a>> wrote:<br type="attribution" class=""><blockquote class="m_7643836357708728490quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="">It seems like ArrayRefs are supposed to be immutable (<div class="">However, as far as i can tell, the iterators are defined wrong to make this true.</div><div class=""><br class=""></div><div class="">While </div><div class="">ArrayRef<int> Foo(Something);</div><div class="">Foo[0] = 5;</div><div class=""><br class=""></div><div class="">will give a compile time error.</div><div class=""><br class=""></div><div class="">something like:<br class=""><br class=""></div><div class="">ArrayRef<int> Foo(Something);</div><div class="">std::sort(Foo.begin(), Foo.end());</div><div class=""><br class=""></div><div class="">Will work fine.</div><div class=""><br class=""></div><div class="">Is this expected?</div><div class=""><br class=""></div><div class="">(FWIW: I expected this to only work with a MutableArrayRef)</div><div class=""><br class=""></div><div class=""><br class=""></div></div>
<br class="">_______________________________________________<br class="">
LLVM Developers mailing list<br class="">
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank" class="">llvm-dev@lists.llvm.org</a><br class="">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br class="">
<br class=""></blockquote></div><br class=""></div>
_______________________________________________<br class="">
LLVM Developers mailing list<br class="">
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank" class="">llvm-dev@lists.llvm.org</a><br class="">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br class="">
</blockquote></div>
_______________________________________________<br class="">LLVM Developers mailing list<br class=""><a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a><br class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev<br class=""></div></blockquote></div><br class=""></div></body></html>