Re: how to implement a function in a different D source file

2019-11-30 Thread Omar via Digitalmars-d-learn
ok, thanks for the replies everyone ! I think i might try fiddling around with mixins and see how i like that.

Hum Humm, Typedef

2019-11-30 Thread Treebeard via Digitalmars-d-learn
Hoom, hum, I met a dark forest of complains from the compilers here. I walk slowly, but I would love typedef and cookies.. """ import std.datetime, std.typecons; alias M = Typedef!Duration; void main() { auto d1 = 100.msecs; auto d2 = 110.msecs; assert(d1 < d2); auto m1 = M(10

Re: Referance usage in async function

2019-11-30 Thread aliak via Digitalmars-d-learn
On Saturday, 30 November 2019 at 13:45:00 UTC, kerdemdemir wrote: I have simplified my problem which can be seen below. import std.stdio; import vibe.core.core; import vibe.core.concurrency; import vibe.data.json; void main() { int[] list; bool ListManipulator(ref int[] list) {

Referance usage in async function

2019-11-30 Thread kerdemdemir via Digitalmars-d-learn
I have simplified my problem which can be seen below. import std.stdio; import vibe.core.core; import vibe.core.concurrency; import vibe.data.json; void main() { int[] list; bool ListManipulator(ref int[] list) { list ~= 2; list ~= 4; return true; }

Re: Alias of template class

2019-11-30 Thread tcak via Digitalmars-d-learn
On Saturday, 30 November 2019 at 09:39:59 UTC, tcak wrote: I defined a class: class KNN(size_t k){} I want to define an alias for KNN when k=5, alias KNN5 = KNN!5; So that I could define a variable as KNN5 knnObject; Then create it later as knnObject = new KNN5(); But the compiler giv

Alias of template class

2019-11-30 Thread tcak via Digitalmars-d-learn
I defined a class: class KNN(size_t k){} I want to define an alias for KNN when k=5, alias KNN5 = KNN!5; So that I could define a variable as KNN5 knnObject; Then create it later as knnObject = new KNN5(); But the compiler gives error for the alias line: Error: template instance KNN!5