On Friday, November 8, 2024 4:27:40 PM MST Dom DiSc via Digitalmars-d-learn
wrote:
> I _very_ often use this pattern:
>
> ```
> fun(ref int[] a)
> {
> assert(a.length && a.length<=100);
> int[100] b;
> b[0 .. a.length-1] = a[];
> b[a.length .. 100] = 5;
> }
> ```
>
> I consider thi
On Friday, 8 November 2024 at 23:27:40 UTC, Dom DiSc wrote:
I _very_ often use this pattern:
```
fun(ref int[] a)
{
assert(a.length && a.length<=100);
int[100] b;
b[0 .. a.length-1] = a[];
b[a.length .. 100] = 5;
}
```
I use `a.length +(-1)`. It's not pretty but at least dscanner i
On Friday, 8 November 2024 at 23:27:40 UTC, Dom DiSc wrote:
I _very_ often use this pattern:
```
fun(ref int[] a)
{
assert(a.length && a.length<=100);
int[100] b;
b[0 .. a.length-1] = a[];
b[a.length .. 100] = 5;
}
```
I consider this perfectly safe, but DScanner gives warnings for
I _very_ often use this pattern:
```
fun(ref int[] a)
{
assert(a.length && a.length<=100);
int[100] b;
b[0 .. a.length-1] = a[];
b[a.length .. 100] = 5;
}
```
I consider this perfectly safe, but DScanner gives warnings for
this, no matter if a check is present or not.
What's the rec
On Friday, 8 November 2024 at 21:55:53 UTC, Liam McGillivray
wrote:
if(isNumeric!T)
```
Error: cannot implicitly convert expression `40.0F` of type
`float` to `Milligrams`
```
I dont believe phoboes type detection templates are well
designed; given some sort of type pattern matching issue yo
I am working on a library for making types representing units of
measurement. Base units are derived from a struct called
`BaseUnit`. I want to make it so that `BaseUnit`-derived types
can have their values assigned from float constants, but not from
each-other or from float variables.
I just
On 09/11/2024 4:03 AM, Maximilian Naderer wrote:
On Friday, 8 November 2024 at 11:21:33 UTC, Richard (Rikki) Andrew
Cattermole wrote:
On 09/11/2024 12:10 AM, Maximilian Naderer wrote:
Is the -betterC config not creating the equals, hash functions which
are generated by D ?
I just checked, no.
On Friday, 8 November 2024 at 11:21:33 UTC, Richard (Rikki)
Andrew Cattermole wrote:
On 09/11/2024 12:10 AM, Maximilian Naderer wrote:
Is the -betterC config not creating the equals, hash functions
which are generated by D ?
I just checked, no.
Hello Rikki,
Thanks for checking. Just to conf
On 09/11/2024 12:10 AM, Maximilian Naderer wrote:
Is the -betterC config not creating the equals, hash functions which are
generated by D ?
I just checked, no.
I have the following struct with i compile with -betterC into a
static library.
```d
struct SubmitDesc {
union {
uint[4] viewport;
struct {
uint vpx;
uint vpy;
uint vpw;
uint vph;
}
}
union {
float[4] c
10 matches
Mail list logo