Re: [PATCH 2/4] gdbsupport: add array_view copy function

Tom Tromey
2021-11-17T00:20:55Z

>> In C++20 I think we could use std::copy by having the array view
>> iterators implement the contiguous_iterator concept. So, maybe a
>> comment to this effect would be good.

Simon> Do you mean we could use std::copy to implement this copy function,
Simon> instead of using memcpy, and that would deal with the details of copying
Simon> in the most efficient manner?

Yeah, but IIUC it will only use memcpy or whatever if it sees the
contiguous_iterator concept (and if the content type is trivially
copyable). I'm not sure if there's a way to get this behavior before
C++20 though.

Tom