On Thursday, 16 September 2021 at 03:26:46 UTC, Tejas wrote:
On Wednesday, 15 September 2021 at 19:59:43 UTC,
james.p.leblanc wrote:
s
Use the `mixin` compiler flag
`dmd -mixin= file.d`
Beware, this will also include **all** the mixin code from
standard library and runtime.
But it's
On Wednesday, 15 September 2021 at 19:59:43 UTC, james.p.leblanc
wrote:
Dear All,
In attempting to learn and use code generation, it
would be useful to be able to view the source code
that gets generated.
However, with various combinations of templates, UDAs, and
mixins it has not been easy.
On Tuesday, 14 September 2021 at 20:59:14 UTC, Ali Çehreli wrote:
On 9/14/21 9:56 AM, eugene wrote:
> On Tuesday, 14 September 2021 at 16:43:50 UTC, jfondren wrote:
>> The misaligned pointer and the
>> reference-containing struct that vanishes on the return of
your
>> corresponding function
On Wednesday, 15 September 2021 at 21:02:29 UTC, Paul Backus
wrote:
On Wednesday, 15 September 2021 at 20:32:12 UTC, eXodiquas
wrote:
```d
[1,0,3,4,0,5]
.fold!((a, e) => e != 0 ? a[0] ~ e : a[1] ~ e)(cast(int[][])
[[],[]])
.flatten
.writeln
```
This should sort all non 0s into the `a[0]`
On Wednesday, 15 September 2021 at 20:32:12 UTC, eXodiquas wrote:
```d
[1,0,3,4,0,5]
.fold!((a, e) => e != 0 ? a[0] ~ e : a[1] ~ e)(cast(int[][])
[[],[]])
.flatten
.writeln
```
This should sort all non 0s into the `a[0]` array and all 0s
into the `a[1]` array. But it won't work because the
Howdy everyone. :)
Today I came across a small problem (I mean, I could solve it by
writing a function that solves my problem, but maybe there is
something in std that can help me here). Let's say we have the
following code:
```d
void main() {
int[][] a = [[],[]];
(a[0] ~ 5).writeln; //
Dear All,
In attempting to learn and use code generation, it
would be useful to be able to view the source code
that gets generated.
However, with various combinations of templates, UDAs, and
mixins it has not been easy.
Is there some standard way this is done?
Optimal would be to print out
On Wednesday, 15 September 2021 at 13:52:40 UTC, z wrote:
```D
float[2] somevalue = somefloat3value[] + cast(Unqual!float[2])
[somesharedfloatarray1[i],somesharedfloatarray2[ii]];
```
Older LDC/DMD releases never complained but now that i upgraded
DMD, DMD-compiled builds suffer from runtime
Thanks for the responses.
```D
float[2] somevalue = somefloat3value[] + cast(Unqual!float[2])
[somesharedfloatarray1[i],somesharedfloatarray2[ii]];
```
Older LDC/DMD releases never complained but now that i upgraded
DMD, DMD-compiled builds suffer from runtime assert error
On Wednesday, 15 September 2021 at 10:08:13 UTC, DLearner wrote:
Please confirm that if the addition of two uint variables
produces a result larger than can be held in a uint:
1. This is a D-legal operation (however inadvisable!), with
the D-defined result of wraparound;
Definition under
https://dlang.org/spec/expression.html#add_expressions
"7. If both operands are of integral types and an overflow or underflow
occurs in the computation, wrapping will happen. For example, uint.max +
1 == uint.min, uint.min - 1 == uint.max, int.max + 1 == int.min, and
int.min - 1 == int.max."
Please confirm that if the addition of two uint variables
produces a result larger than can be held in a uint:
1. This is a D-legal operation (however inadvisable!), with the
D-defined result of wraparound;
2. Emphasing 1. above: the result is not undefined, or an error
(by the rules of D),
13 matches
Mail list logo