Thread overview
How do I filter out this type?
Jun 22, 2018
Dr.No
Jun 23, 2018
Dr.No
June 22, 2018
In the below code, "A[] found" is never printed. What's the proper way to check for this type?

import std.stdio;
import std.traits : FieldNameTuple;

class A { }
class B
{
    string foo;
    string baa;
    A[] list;
}

void main()
{
    static foreach(field; FieldNameTuple!B)
	{
       static if(is(typeof(__traits(getMember, B, field) == A[])))
       {
           writeln("A[] found");
       }
    }
    writeln("done");
}



June 22, 2018
On 6/22/18 1:07 PM, Dr.No wrote:
>         static if(is(typeof(__traits(getMember, B, field) == A[])))
          static if(is(typeof(__traits(getMember, B, field)) == A[]))

Note the slight change in parentheses.

-Steve
June 23, 2018
On Friday, 22 June 2018 at 17:20:03 UTC, Steven Schveighoffer wrote:
> On 6/22/18 1:07 PM, Dr.No wrote:
>>         static if(is(typeof(__traits(getMember, B, field) == A[])))
>           static if(is(typeof(__traits(getMember, B, field)) == A[]))
>
> Note the slight change in parentheses.
>
> -Steve


oh, I'm a bit embarrassed. haha Thanks anyway!