On Wednesday, 27 February 2019 at 03:53:35 UTC, Victor Porton wrote:
After following your suggestion to rewrite it with Stride it does not work either. I assume the error is somehow related to allSatisfy!.

https://github.com/vporton/struct-params-dlang/blob/c1adc86672f46fd6b743903cc270dceef120a8fe/source/struct_params.d

Please help. It is important for both D community and world at large.

Your problem is exactly here:

    allSatisfy!(x => is(typeof(x) == string), Names)

allSatisfy expects its first parameter to be a template, not a function. We can introduce a simple helper template:

template isA(T) {
    enum isA(alias U) = is(typeof(T) == U);
}

Then simply replace the code above with allSatisfy!(isA!string, Names).

--
  Simen

Reply via email to