Re: C++ vs D: Default param values and struct to array casting

2019-09-07 Thread Maximillian via Digitalmars-d-learn
On Saturday, 7 September 2019 at 11:22:09 UTC, Maximillian wrote: Please could you tell what "goto case;" do here? I see now "fall-through" [1]. To be honest I like this feature in C and I was sad it didn't work in D, at least now I know how to solve it. :) Max. [1]

Re: C++ vs D: Default param values and struct to array casting

2019-09-07 Thread Maximillian via Digitalmars-d-learn
On Friday, 6 September 2019 at 18:31:29 UTC, Ali Çehreli wrote: ... void enforceMemberWiseEquality(Demo d, const(float)[] values) { switch (values.length) { case 4: assert(d.d == values[3]); goto case; case 3: assert(d.c == values[2]); goto case;