static foreach

Neia Neutuladh neia at ikeran.org
Wed Oct 10 23:29:04 UTC 2018


On 10/10/2018 04:03 PM, James Japherson wrote:> Says that it cannot 
interpret X(the class that contains the static> opApply).
It's a bit hard to diagnose the problem you're getting using that 
function when we don't have the code that uses it. Or the context that's 
referenced with the foreach loop there. You might want to post a larger 
segment of code and the entire error message.

The error I'm seeing that might be related is: opApply is a static 
member of the type. So part of the function (after mixins) reads:

     dg(X.opApply);

This attempts to call X.opApply with no arguments and pass the result to 
dg. But X.opApply requires an argument.

You probably want to add a `is(typeof(mixin("X." ~ m)) == cPiece)` in there.



More information about the Digitalmars-d-learn mailing list