Filter AA at compile time

Andrey saasecondbox at yandex.ru
Thu Dec 27 07:45:15 UTC 2018


Hi,
I want to filter AA at compile time and do this:
> void main()
> {
>     // datamap is some AA
>     enum qaz = "qq";
>     enum types = datamap.byKeyValue.filter!(pair => 
> qaz.isGood(pair)).assocArray();
> 
>     types.writeln;
> }

But compiler says:
> Error: _aaRange cannot be interpreted at compile time, because 
> it has no available source code

Why, where is a problem? And how to filter it correctly? Write my 
own foreach-loop?


More information about the Digitalmars-d-learn mailing list