Re: Voldemort type for mixin template.

2018-01-11 Thread ChangLong via Digitalmars-d-learn
On Thursday, 11 January 2018 at 21:30:43 UTC, aliak wrote: On Thursday, 11 January 2018 at 08:56:11 UTC, ChangLong wrote: When I try add some sub type for struct with mixin template, seems there is no way to hidden the private type. Is there a way to hidden type from mix template like

Voldemort type for mixin template.

2018-01-11 Thread ChangLong via Digitalmars-d-learn
When I try add some sub type for struct with mixin template, seems there is no way to hidden the private type. Is there a way to hidden type from mix template like Voldemort type ? fake code: mix template TypeX () { alias This = typeof(this); static struct Unique { This*

Error: non-shared method Node.~this is not callable using a shared object

2018-01-06 Thread ChangLong via Digitalmars-d-learn
This code is not working. --- shared struct Stack { Node n = void ; } struct Node { ~this() {} } --- Error: non-shared method test.Node.~this is not callable using a shared object Is this a bug ? Node.~this is not called from Stack.

Re: why @property cannot be pass as ref ?

2018-01-03 Thread ChangLong via Digitalmars-d-learn
On Wednesday, 3 January 2018 at 08:51:55 UTC, Simen Kjærås wrote: On Saturday, 30 December 2017 at 03:49:37 UTC, ChangLong wrote: What I am try to do is implement a unique data type. (the ownership auto moved into new handle) Have you considered std.typecons.Unique[0]? If yes, in what ways

Fiber.yield with call scope guard

2017-12-29 Thread ChangLong via Digitalmars-d-learn
I am look a method like Fiber.yieldAndThrow, but also call all scopeguard. I am hack Fiber into struct with no throw, try to use it on network project with high performance. I use scopeguard to auto release memory or resource, but when I call Fiber .yieldAndThrow the scopeguard chain will

Re: why @property cannot be pass as ref ?

2017-12-29 Thread ChangLong via Digitalmars-d-learn
On Wednesday, 20 December 2017 at 18:43:21 UTC, Ali Çehreli wrote: Thanks to Mengü for linking to that section. I have to make corrections below. Ali Thanks for explain, Ali And Mengu. What I am try to do is implement a unique data type. (the ownership auto moved into new handle)

why @property cannot be pass as ref ?

2017-12-20 Thread ChangLong via Digitalmars-d-learn
=== struct A { alias This = typeof(this) ; void opAssign(ref This ){ } ref auto left(){ return This() ; } } void main(){ A root ;