Contrarian opinion: Pointer arithmetic is harmful and shouldn’t have been in C. (Use &ptr[1] instead of ptr + 1.)
-
-
Also, using + invites all sorts of unreadable overly-clever ++ operator trickery, sadly encouraged by K&R.
-
That one kinda seems like what the language is built around. Gotta getcha while(x[i++] = y[++j);
End of conversation
New conversation -
-
-
also RIP Swift has `ptr[i]`, `ptr + i`, and `ptr.advanced(by: i)`. `ptr[i]` isn't very useful b/c you can't call move/init/deinit.
-
and advanced(by: i) is so verbose that... https://github.com/apple/swift/blob/master/stdlib/public/core/HashedCollections.swift.gyb#L2986-L2988 …
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.