Re: Determination of thread status.

2018-12-30 Thread Vitaly via Digitalmars-d-learn
On Sunday, 30 December 2018 at 08:24:20 UTC, Brakeran wrote: On Thursday, 27 December 2018 at 06:22:31 UTC, Vitaly wrote: Maybe use spawnLinked()? https://run.dlang.io/is/9xbyAF Thanks. At the moment, I implemented it through sending a message, and receiveTimeout receiving, if the response is

Re: Weird combo of static function, templates, interfaces (that doesn't link)

2018-12-30 Thread Ali Çehreli via Digitalmars-d-learn
On 12/30/2018 05:05 AM, 0xEAB wrote: >> interface FooAdapter >> { >> FooBundle!(Handle) createSome(Handle)(); >> } Function templates cannot be virtual functions. One reason is the compiler cannot know how large the virtual function table should be, and the other one is it's just a templat

Re: Why can't or shouldn't I just hash the address of an object? And how.

2018-12-30 Thread Enjoys Math via Digitalmars-d-learn
On Sunday, 30 December 2018 at 05:54:05 UTC, Neia Neutuladh wrote: On Sun, 30 Dec 2018 05:36:41 +, Enjoys Math wrote: Is it: typeof(T).getHash(&o)? This gets the hashcode for the object by calling toHash() on it. Or does that do something other than just get the address? It XORs the a

Weird combo of static function, templates, interfaces (that doesn't link)

2018-12-30 Thread 0xEAB via Digitalmars-d-learn
void main() { StaticThingy.register(new SomeAdapter()); StaticThingy.createSome!Dummy(); } interface FooAdapter { FooBundle!(Handle) createSome(Handle)(); } private class SomeAdapter : FooAdapter { Bundle createSome() { auto w = new Dummy(); auto c = new FooD

Re: Determination of thread status.

2018-12-30 Thread Brakeran via Digitalmars-d-learn
On Thursday, 27 December 2018 at 06:22:31 UTC, Vitaly wrote: Maybe use spawnLinked()? https://run.dlang.io/is/9xbyAF Thanks. At the moment, I implemented it through sending a message, and receiveTimeout receiving, if the response is not received after the timeout expires, then it is considered