Argumnentation against external function operator overloading is unconvincing
Jonathan M Davis via Digitalmars-d
digitalmars-d at puremagic.com
Sun Sep 25 06:48:05 PDT 2016
On Sunday, September 25, 2016 13:10:42 ZombineDev via Digitalmars-d wrote:
> D's built-in dynamic arrays are hidden from you and you only get
> to interact with them by referring to their elements by using
> slices.
That's a common misconception propagated by Steven's otherwise excellent
article. As far as the official language spec goes, T[] _is_ the dynamic
array. What backs it is irrelevant as far as that goes. It's just that if
it's backed by the GC, then when you append to it, the GC might not have to
allocate a new memory buffer for the array. All of the operations on a
dynamic array work the same regardless of what backs it, and focusing on the
memory buffer being the array risks causing you problems when you have to
deal with dynamic arrays backed by something else.
But on the whole, what you said was right. It's just the terminology that's
off.
- Jonathan M Davis
More information about the Digitalmars-d
mailing list