How to iterate getSymbolsByUDA
Eko Wahyudin
eko.wahyudin at yahoo.co.id
Mon Nov 26 13:50:13 UTC 2018
On Sunday, 25 November 2018 at 01:01:30 UTC, bauss wrote:
> On Saturday, 24 November 2018 at 08:50:59 UTC, Eko Wahyudin
> wrote:
>> On Saturday, 24 November 2018 at 08:09:38 UTC, Stanislav
>> Blinov wrote:
>>> [...]
>>
>> aah ya,, this statement is work
>>
>> static foreach (i; 0 .. symbols.length)
>>
>> thank you.
>
> It should work with just:
>
> static foreach(sym; getSymbolsByUDA!(A, Attr)){
> ...
> }
>
> or
>
> alias symbols = getSymbolsByUDA!(A, Attr);
>
> static foreach(sym; symbols){
> ...
> }
>
>
> ---
>
> What you were missing was just making it a static foreach.
seems my problem is i use GDC, i got this error
error: basic type expected, not foreach.
More information about the Digitalmars-d-learn
mailing list