On Monday, 18 November 2024 at 21:59:43 UTC, Andrey Zherikov
wrote:
Is this a correct/safe way to go since I'm copying `const
string[]` to `string[]`?
Copying constants to variables is something absolutely normal. If
this wouldn't work, how would you program at all?
So, yes this is safe and c
I am doing work on the `units-d` library. This library contains
some struct templates which don't contain any variables. Because
of this, all instances are effectively constant. However, when
they are placed as arguments in other templates, it causes
problems when one is unexpectedly `const`.
Below is the reduced code that replicates my problem.
I'm trying to remember a value (of some type) that can be used at
run time (assigned to a variable). "Remembering" must be done at
compile time because it's a part of UDA.
```d
// I can't get rid of this struct because it contains a lot of
On Thursday, 14 November 2024 at 13:08:36 UTC, Manfred Nowak
wrote:
On Saturday, 9 November 2024 at 04:02:46 UTC, Jonathan M Davis
wrote:
[...]
b[0 .. a.length-1] = a[];
You'll get a RangeError being thrown when you run the code.
[...]
Therefore a fix might be to not deminish the length: