`ref T` should be a type!!
John Colvin
john.loughran.colvin at gmail.com
Tue Apr 2 07:38:51 UTC 2019
On Tuesday, 2 April 2019 at 00:00:34 UTC, Rubn wrote:
> On Monday, 1 April 2019 at 20:51:44 UTC, Walter Bright wrote:
>> On 4/1/2019 1:00 PM, Rubn wrote:
>>> Arrays in C++ are just pointers.
>>
>> No, they're not.
>
> Yes they are. The only time an array exists in C++ is (oddly)
> only when you pass it by reference :). Otherwise every
> operation you do on array, any time you pass an array to a
> function that isn't a reference it is just a pointer. This is
> why buffer overflows exist in C++, because an is literally just
> a pointer -- it doesn't even know it's own size! How can you
> call that an array?
I love it, stridently arguing with Walter about the basics of
C++, one of the few people in the world who groks the basics of
the language well enough to implement a compiler for it*!
Obviously there's always a chance he's wrong about things, but on
a topic like this? Very bad odds. :)
* Memorizing the standard & writing a million lines of C++ code
would be no guarantee of getting to this level.
More information about the Digitalmars-d
mailing list