Re: problem with alias this and Tuple

2021-10-12 Thread Mike Parker via Digitalmars-d-learn
On Tuesday, 12 October 2021 at 15:55:40 UTC, Johann Lermer wrote: Thanks, understood. But isn't this a deficiency in the library that should be fixed? The problem extends to more than just `toHash`. Take a look at this DConf 2019 presentation by Eduard Staniloiu on ProtoObject (as proposed

Re: problem with alias this and Tuple

2021-10-12 Thread Paul Backus via Digitalmars-d-learn
On Tuesday, 12 October 2021 at 15:55:40 UTC, Johann Lermer wrote: Thanks, understood. But isn't this a deficiency in the library that should be fixed? You mean the part about how `Object.toHash` doesn't work with `const`? Yes, it is a deficiency in the library. The problem is, it cannot be

Re: problem with alias this and Tuple

2021-10-12 Thread Johann Lermer via Digitalmars-d-learn
Thanks, understood. But isn't this a deficiency in the library that should be fixed?

Re: problem with alias this and Tuple

2021-10-12 Thread Paul Backus via Digitalmars-d-learn
On Tuesday, 12 October 2021 at 09:30:57 UTC, Johann Lermer wrote: Hi all, I have a problem with Tuples and struct templates that contain an alias this: ```d import std; struct Element(T) { T payload; alias payload this; this (T p) { payload =

problem with alias this and Tuple

2021-10-12 Thread Johann Lermer via Digitalmars-d-learn
Hi all, I have a problem with Tuples and struct templates that contain an alias this: ```d import std; struct Element(T) { T payload; alias payload this; this (T p) { payload = p; } } class Item {} void main () { auto e =