hasInOperator

Indicates wether an aggregate can be used with the in operator.

template hasInOperator (
T
A
) {
enum hasInOperator;
enum hasInOperator;
enum hasInOperator;
enum hasInOperator;
enum hasInOperator;
}

Parameters

T

The aggregate or an associative array type.

A

The type of the in left hand side argument.

Examples

1 alias AA = int[string];
2 static assert(hasInOperator!(AA, string));
3 static assert(!hasInOperator!(AA, int));
4 
5 struct Tester1 {static bool opIn_r(int){return true;}}
6 static assert(hasInOperator!(Tester1, int));
7 
8 struct Tester2 {bool opIn_r(int){return true;}}
9 static assert(hasInOperator!(Tester2, int));
10 static assert(!hasInOperator!(Tester2, string));
11 
12 struct Nothing {}
13 static assert(!hasInOperator!(Nothing, int));

Meta