Re: Order of interfaces

2019-06-21 Thread Tomas via Digitalmars-d-learn
On Friday, 21 June 2019 at 20:50:02 UTC, user1234 wrote: On Friday, 21 June 2019 at 20:42:00 UTC, Tomas wrote: Does it matter in which order a class inherits from interfaces? class A : Interface1, Interface2{ ... } vs class A : Interface2, Interface1{ ... } Conceptually it should no

Order of interfaces

2019-06-21 Thread Tomas via Digitalmars-d-learn
Does it matter in which order a class inherits from interfaces? class A : Interface1, Interface2{ ... } vs class A : Interface2, Interface1{ ... } Conceptually it should not matter, but I'm getting really weird segfault errors with one version and no errors with the other version.

Re: Parameter pack expansion

2019-05-30 Thread Tomas via Digitalmars-d-learn
On Thursday, 30 May 2019 at 20:55:00 UTC, Q. Schroll wrote: If it would be implemented, you could place your parameter pack into a Tuple-like structure with an opDispatch that returns such a Tuple again, but the contents would be the member components "projection" to the member. It's doable[2],

Re: Parameter pack expansion

2019-05-30 Thread Tomas via Digitalmars-d-learn
On Thursday, 30 May 2019 at 20:34:18 UTC, Adam D. Ruppe wrote: Foo foo; test(foo.tupleof); // works! This is really neat! I will definitely use this in the future. import std.meta; then staticMap is like what your myMap thing was. http://dpldocs.info/experimental-docs/std.meta.staticMap.htm

Parameter pack expansion

2019-05-30 Thread Tomas via Digitalmars-d-learn
I'm very new to D, coming from C++ I'm missing parameter pack expansion and fold expressions. For example, I want to write a function `f(x[0], ..., x[n])` which accepts any number of objects and calls `g(x[0].member, ..., x[n].member)`. In C++, I would write this: template void f(X ..