On Sunday, 1 July 2018 at 06:55:35 UTC, Robert M. Münch wrote:
The looping needs to be done in the handler because there are
two loops running one after the other and the range to loop
over is detected in the handler too. Otherwise a lot of code
duplication would happen.
Maybe an
This one look nasty...
I get an access violation crash after some time. The crash is
reproducible in that it always happens after some time while executing
the same code sequence (meaning the same function call chain).
The debugger kicks in with a call stack, but it looks strange to me:
All,
Request your help, the D document states that "Template
functions are useful for avoiding code duplication - instead of
writing several copies of a function, each with a different
parameter type, a single function template can be sufficient"
which mean we can passing any type of
On Sunday, 1 July 2018 at 01:48:15 UTC, Simen Kjærås wrote:
I'd send you straight to std.meta.ApplyLeft, but it seems to do
the wrong thing here, in that it doesn't handle IFTI. This
thing does:
void fooImpl(int n, T)(const T line) { }
unittest {
alias fun = applyLeft!(fooImpl, 3);
On Sunday, 1 July 2018 at 09:46:32 UTC, vino.B wrote:
All,
Request your help, the D document states that "Template
functions are useful for avoiding code duplication - instead of
writing several copies of a function, each with a different
parameter type, a single function template can be
On 2018-06-30 22:53:47 +, Jerry said:
Btw this is pretty much std.algorithm.each
import std.algorithm;
void main() {
auto cs = [ new C(), new C() ];
cs.each!(o => o.A());
}
https://dlang.org/phobos/std_algorithm_iteration.html#.each
The looping needs to be done in the handler
On Sunday, 1 July 2018 at 06:55:35 UTC, Robert M. Münch wrote:
On 2018-06-30 22:53:47 +, Jerry said:
Btw this is pretty much std.algorithm.each
import std.algorithm;
void main() {
auto cs = [ new C(), new C() ];
cs.each!(o => o.A());
}
On Sunday, 1 July 2018 at 09:55:34 UTC, Timoses wrote:
On Sunday, 1 July 2018 at 09:46:32 UTC, vino.B wrote:
All,
Request your help, the D document states that "Template
functions are useful for avoiding code duplication - instead
of writing several copies of a function, each with a
On Sunday, 1 July 2018 at 11:19:50 UTC, vino.B wrote:
Hi Timoses,
Thank you very much, can you help me on how to rewrite the
below using Variadic template
Passing function as a parameter to another function:
void ptFun(T)(T function(string, string, int) coRoutine,
Array!string Dirlst, )
On Sunday, 1 July 2018 at 11:52:19 UTC, Alex wrote:
On Sunday, 1 July 2018 at 11:19:50 UTC, vino.B wrote:
Hi Timoses,
Thank you very much, can you help me on how to rewrite the
below using Variadic template
Passing function as a parameter to another function:
void ptFun(T)(T
On Sunday, 1 July 2018 at 09:46:55 UTC, Timoses wrote:
Would be nice if std.meta.ApplyLeft did the job here.. Is there
no way of achieving that?
[snip]
Would have to find a way to determine whether Template would
resolve to a function or not. Can't find anything in Traits[1]
or std.traits[2].
On Sunday, 1 July 2018 at 11:19:50 UTC, vino.B wrote:
On Sunday, 1 July 2018 at 09:55:34 UTC, Timoses wrote:>
Hi Timoses,
Thank you very much, can you help me on how to rewrite the
below using Variadic template
Passing function as a parameter to another function:
void ptFun(T)(T
On Sunday, 1 July 2018 at 01:16:59 UTC, Jonathan M Davis wrote:
On Sunday, July 01, 2018 00:42:30 spikespaz via
Digitalmars-d-learn wrote:
Hey guys, I'm getting a linker error when compiling with DMD
`-m63` that I don't get as 23 bit.
I'm importing `ShowWindow` from
On Sunday, 1 July 2018 at 05:20:17 UTC, Anton Fediushin wrote:
Now I tried it and indeed, it's vibe.d's fault. I'm not quite
sure what causes it and if this problem is known, I'll look
into that later and open an issue if it doesn't exist already.
Yes, please do this when you have time. That
On Sunday, 1 July 2018 at 11:58:30 UTC, vino.B wrote:
On Sunday, 1 July 2018 at 11:52:19 UTC, Alex wrote:
NewType.d(19): Error: function declaration without return type.
(Note that constructors are always named this)
[...]
auto coCleanFiles(T ...)(T args) {
auto dFiles =
On Sunday, 1 July 2018 at 11:55:15 UTC, Simen Kjærås wrote:
On Sunday, 1 July 2018 at 09:46:55 UTC, Timoses wrote:
Would be nice if std.meta.ApplyLeft did the job here.. Is
there no way of achieving that?
[snip]
Would have to find a way to determine whether Template would
resolve to a
On Sunday, 1 July 2018 at 13:01:20 UTC, Timoses wrote:
Aw, okay, then that won't work.
Still, this looks like it should work:
void foo(F, T)(T param) { writeln("Called with type: ",
T.stringof); }
alias tfoo = ApplyLeft!(foo, int);
tfoo!string("hi");
// tfoo("hi"); // Error
On Sunday, 1 July 2018 at 12:32:25 UTC, Jacob Shtokolov wrote:
On Sunday, 1 July 2018 at 05:20:17 UTC, Anton Fediushin wrote:
Now I tried it and indeed, it's vibe.d's fault. I'm not quite
sure what causes it and if this problem is known, I'll look
into that later and open an issue if it
I'm creating a bunch of objects and need to use these object pointers
with C code. Hence I need to protect them from being GC with GC.addRoot.
Can this call be made out of a constructor? So that I can protect the
objects as earyl as possible?
Could I then unprotect the memory inside the
On 2018-07-01 09:05:56 +, Robert M. Münch said:
This one look nasty...
And it was... the problem was, that I kept D allocated pointers in C
code without informing the GC that the memory can't be collected nor
moved. Bridging from D to C and back, is pretty tricky to not miss any
On Sunday, 1 July 2018 at 13:44:23 UTC, Anton Fediushin wrote:
I reduced the test case to _one_ line:
```
1.seconds.setTimer(() => "http://google.com".requestHTTP((scope
req) {}, (scope res) {res.disconnect;}), true);
```
What happens is `res.disconnect` doesn't free all of the
internal
On Sunday, 1 July 2018 at 20:15:02 UTC, crimaniak wrote:
On Sunday, 1 July 2018 at 13:44:23 UTC, Anton Fediushin wrote:
I reduced the test case to _one_ line:
```
1.seconds.setTimer(() =>
"http://google.com".requestHTTP((scope req) {}, (scope res)
{res.disconnect;}), true);
```
What
I'm a bit puzzled because I think this is pretty straight forward but
doesn't work...
struct mystruct {
myPtr* root;
opApply(...){
myPtr*[] childs;
childs ~= root;
...
}
}
foreach(node; mystruct(myRoot)){
On 2018-07-01 20:55:16 +, Robert M. Münch said:
I'm a bit puzzled because I think this is pretty straight forward but
doesn't work...
struct mystruct {
myPtr* root;
opApply(...){
myPtr*[] childs;
childs ~= root;
On Sunday, 1 July 2018 at 20:55:16 UTC, Robert M. Münch wrote:
I'm a bit puzzled because I think this is pretty straight
forward but doesn't work...
struct mystruct {
myPtr* root;
opApply(...){
myPtr*[] childs;
childs ~= root;
On 2018-07-01 21:05:43 +, Cym13 said:
On Sunday, 1 July 2018 at 20:55:16 UTC, Robert M. Münch wrote:
I'm a bit puzzled because I think this is pretty straight forward but
doesn't work...
struct mystruct {
myPtr* root;
opApply(...){
myPtr*[] childs;
26 matches
Mail list logo