On Thursday, July 4, 2019 2:49:18 AM MDT zoujiaqing via Digitalmars-d-learn
wrote:
> On Thursday, 4 July 2019 at 07:46:53 UTC, Paolo Invernizzi wrote:
> > On Thursday, 4 July 2019 at 01:01:03 UTC, Nicholas Wilson wrote:
> >> On Wednesday, 3 July 2019 at 20:49:20 UTC, JN wrote:
> >>> Does anyone kn
On Friday, 5 July 2019 at 00:54:15 UTC, Samir wrote:
Is there a cleaner way of finding the maximum value of say the
third column in a multi-dimensional array than this?
int[][] p = [[1,2,3,4], [9,0,5,4], [0,6,2,1]];
writeln([p[0][2], p[1][2], p[2][2]].max);
I've tried the following
writeln([0,
On Friday, 5 July 2019 at 00:54:15 UTC, Samir wrote:
Is there a cleaner way of finding the maximum value of say the
third column in a multi-dimensional array than this?
int[][] p = [[1,2,3,4], [9,0,5,4], [0,6,2,1]];
writeln([p[0][2], p[1][2], p[2][2]].max);
I've tried the following
writeln([0,
Is there a cleaner way of finding the maximum value of say the
third column in a multi-dimensional array than this?
int[][] p = [[1,2,3,4], [9,0,5,4], [0,6,2,1]];
writeln([p[0][2], p[1][2], p[2][2]].max);
I've tried the following
writeln([0, 1, 2].map!(p[a][2]).max);
but get an "Error: undefine
On Thursday, 4 July 2019 at 15:22:08 UTC, Marco de Wild wrote:
On Thursday, 4 July 2019 at 15:10:05 UTC, aliak wrote:
[...]
I don't know if it will solve your whole problem, but have you
tried __traits(isSame, W0.fun, fun)?
Reduced example:
struct Foo(alias fun){
alias bar = fun;
}
vo
On Thursday, 4 July 2019 at 17:00:33 UTC, Q. Schroll wrote:
Probably you've come over this problem once in a while, too.
You have a repeating solution, so you use a for(each) loop.
Sometimes, there is an action to be performed between the end
of one iteration and the beginning of the next, if th
Probably you've come over this problem once in a while, too.
You have a repeating solution, so you use a for(each) loop.
Sometimes, there is an action to be performed between the end of
one iteration and the beginning of the next, if there is one. The
prime example is printing the comma when pri
On Thursday, 4 July 2019 at 15:10:05 UTC, aliak wrote:
Any ideas on how to be able to do something like this?
struct S(alias _fun) {
alias Fun = _fun;
}
void algorithm(alias f, T)(T s) {
static if (&f == &T.Fun) {
// trivial return
} else {
// must perform work, then return
}
}
Any ideas on how to be able to do something like this?
struct S(alias _fun) {
alias Fun = _fun;
}
void algorithm(alias f, T)(T s) {
static if (&f == &T.Fun) {
// trivial return
} else {
// must perform work, then return
}
}
Can you use function addresses in some way? I've seen t
On Thursday, 4 July 2019 at 10:56:50 UTC, Nick Treleaven wrote:
immutable(int[]) f() @nogc {
return [1,2];
}
onlineapp.d(2): Error: array literal in `@nogc` function
`onlineapp.f` may cause a GC allocation
specify the size of the static array:
immutable(int[ 2 /*HERE*/ ]) f() @nogc { re
On Thursday, 4 July 2019 at 10:56:50 UTC, Nick Treleaven wrote:
immutable(int[]) f() @nogc {
return [1,2];
}
onlineapp.d(2): Error: array literal in `@nogc` function
`onlineapp.f` may cause a GC allocation
This makes dynamic array literals unusable with @nogc, and adds
to GC pressure for
immutable(int[]) f() @nogc {
return [1,2];
}
onlineapp.d(2): Error: array literal in `@nogc` function
`onlineapp.f` may cause a GC allocation
This makes dynamic array literals unusable with @nogc, and adds
to GC pressure for no reason. What code would break if dmd used
only static data f
On 2019-07-03 19:07:10 +, ag0aep6g said:
On 03.07.19 20:20, Robert M. Münch wrote:
So, I need to carry around the object from which a delegate was created
from because it's not possible to query the delegate for the object
later somewhere else in the code.
It is possible to get the conte
On Wednesday, 3 July 2019 at 17:12:04 UTC, lpcvoid wrote:
Thanks for the time you invest in this.
You're welcome. Tell your friends. :)
On Thursday, 4 July 2019 at 07:46:53 UTC, Paolo Invernizzi wrote:
On Thursday, 4 July 2019 at 01:01:03 UTC, Nicholas Wilson wrote:
On Wednesday, 3 July 2019 at 20:49:20 UTC, JN wrote:
Does anyone know if and how well D works on ARM laptops (such
as Chromebooks and similar)?
For example this o
On Thursday, 4 July 2019 at 01:01:03 UTC, Nicholas Wilson wrote:
On Wednesday, 3 July 2019 at 20:49:20 UTC, JN wrote:
Does anyone know if and how well D works on ARM laptops (such
as Chromebooks and similar)?
For example this one https://www.pine64.org/pinebook/ . Can it
compile D? Obviously
16 matches
Mail list logo