Re: Is there anyway to Deify the following code snippet?

2025-04-15 Thread Andy Valencia via Digitalmars-d-learn
On Wednesday, 16 April 2025 at 01:44:33 UTC, Paul Backus wrote: Nope, you're not missing anything. Using pointers is totally normal and idiomatic in D. That said, I try to code under @safe when I can, and let the compiler guide me clear of a whole class of C-type potential bugs. Andy

Re: Is there anyway to Deify the following code snippet?

2025-04-15 Thread Salih Dincer via Digitalmars-d-learn
On Tuesday, 15 April 2025 at 21:06:30 UTC, WhatMeWorry wrote: I had assumed that ref keyword negated the use of * and & operators but when I try to use it, DMD is saying "only parameters, functions and `foreach` declarations can be `ref`". Fair enough. I thought that the * and & operator was fo

Re: Is there anyway to Deify the following code snippet?

2025-04-15 Thread Paul Backus via Digitalmars-d-learn
On Tuesday, 15 April 2025 at 21:06:30 UTC, WhatMeWorry wrote: I had assumed that ref keyword negated the use of * and & operators but when I try to use it, DMD is saying "only parameters, functions and `foreach` declarations can be `ref`". Fair enough. I thought that the * and & operator was fo

Is there anyway to Deify the following code snippet?

2025-04-15 Thread WhatMeWorry via Digitalmars-d-learn
I had assumed that ref keyword negated the use of * and & operators but when I try to use it, DMD is saying "only parameters, functions and `foreach` declarations can be `ref`". Fair enough. I thought that the * and & operator was for when interfacing with C/C++ code. Since this is entirely in