Setting array length without initializing/reallocating.
Jackson22
jack.sonof at gmail.com
Mon Dec 14 20:53:39 UTC 2020
On Monday, 14 December 2020 at 01:36:02 UTC, Mike Parker wrote:
> On Sunday, 13 December 2020 at 20:03:46 UTC, Jackson22 wrote:
>>
>> There's a reason .ptr exist, I wish people would stop
>> pretending that using it where it is appropriate is somehow
>> going to lead to failure when there are more successful
>> programming languages that have zero automatic bounds checking.
>>
>
> There's no pretending here. What the OP is doing *is* dangerous.
If someone writes a wrapper around .ptr which checks. It'd be
literally no different than the implementation in druntime.
Like I said, I wish people would stop pretending that using it
where it is appropriate is somehow going to lead to failure.
Maybe those people just aren't knowledgeable enough to
understand, I don't know.
More information about the Digitalmars-d
mailing list