Arrays, overlapping, etc

Vladimir Panteleev thecybershadow at gmail.com
Mon Jul 9 09:42:11 PDT 2007


On Mon, 09 Jul 2007 11:31:25 +0300, Regan Heath <regan at netmail.co.nz> wrote:

> The next point is that surely an overlapping copy can be implemented/handled?  I had a quick look in Bugzilla and found a couple of of items the topic and related topics.  One even suggests documenting the various methods you can use to get around the deficiency.

The main reason for overlapping copy being forbidden is because forbidding it makes normal array operations much faster - the compiler doesn't have to check for overlaps each time an array (slice) is copied. I made a suggestion some time ago to make the compiler allow overlapping copy when it's obvious that you're doing it (copying a slice of one array onto itself). No one has yet discussed implementing it as a separate language feature, though.

-- 
Best regards,
  Vladimir                          mailto:thecybershadow at gmail.com



More information about the Digitalmars-d mailing list