<div dir="ltr">Oh I guess because one of them has const values?  Oh well, ignore my suggestion then :)</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jan 30, 2019 at 10:50 AM Davide Italiano via Phabricator <<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">davide marked an inline comment as done.<br>
davide added inline comments.<br>
<br>
<br>
================<br>
Comment at: lldb/source/Utility/Scalar.cpp:168<br>
+      swapped_words[6] = apint_words[1];<br>
+      swapped_words[7] = apint_words[0];<br>
+      apint_words = swapped_words;<br>
----------------<br>
zturner wrote:<br>
> davide wrote:<br>
> > davide wrote:<br>
> > > aprantl wrote:<br>
> > > > std::reverse perhaps?<br>
> > > We might want to change this everywhere.<br>
> > I updated the comment but I can't really easily use `std::swap` or `std::reverse` because they operate on vectors and the unit of currency here is an array.<br>
> > I thought about initializing a vector from the array we read and then call `std::reverse` (and then covert back to a pointer), but that didn't seem better than what we have now (or, at least, less ugly).<br>
> I'm confused why `std::swap(swapped_words[7], swapped_words[0]);` and similar for the other 4 doesn't work though.<br>
```<br>
/Users/davide/llvm-monorepo/llvm-mono/llvm/tools/lldb/source/Utility/Scalar.cpp:144:7: error: no matching function for call to 'swap'<br>
      std::swap(apint_words[0], apint_words[3]);<br>
      ^~~~~~~~~<br>
/Applications/Xcode4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/type_traits:4515:1: note: candidate template ignored: requirement 'is_move_assignable<const unsigned long long>::value' was not satisfied [with _Tp = const unsigned long long]<br>
swap(_Tp& __x, _Tp& __y) _NOEXCEPT_(is_nothrow_move_constructible<_Tp>::value &&<br>
```<br>
<br>
<br>
CHANGES SINCE LAST ACTION<br>
  <a href="https://reviews.llvm.org/D57213/new/" rel="noreferrer" target="_blank">https://reviews.llvm.org/D57213/new/</a><br>
<br>
<a href="https://reviews.llvm.org/D57213" rel="noreferrer" target="_blank">https://reviews.llvm.org/D57213</a><br>
<br>
<br>
<br>
</blockquote></div>