isFuncLike

Checks if Model's parameter types are convertible to Func's parameter types and Func's return type can be converted to Model's return type.

Members

Manifest constants

isFuncLike
enum isFuncLike;
Undocumented in source.

Examples

struct S
{
    int   f1(int)   { return 0; }
    float f2(int)   { return 0; }
    int   f3(float) { return 0; }
    float f4(float) { return 0; }
}

static assert ( isFuncLike!(typeof(&S.f1), Func!(int, int)));
static assert (!isFuncLike!(typeof(&S.f2), Func!(int, int)));
static assert ( isFuncLike!(typeof(&S.f3), Func!(int, int)));
static assert (!isFuncLike!(typeof(&S.f4), Func!(int, int)));

static assert ( isFuncLike!(typeof(&S.f1), Func!(float, int)));
static assert ( isFuncLike!(typeof(&S.f2), Func!(float, int)));
static assert ( isFuncLike!(typeof(&S.f3), Func!(float, int)));
static assert ( isFuncLike!(typeof(&S.f4), Func!(float, int)));

static assert (!isFuncLike!(typeof(&S.f1), Func!(int, float)));
static assert (!isFuncLike!(typeof(&S.f2), Func!(int, float)));
static assert ( isFuncLike!(typeof(&S.f3), Func!(int, float)));
static assert (!isFuncLike!(typeof(&S.f4), Func!(int, float)));

static assert (!isFuncLike!(typeof(&S.f1), Func!(float, float)));
static assert (!isFuncLike!(typeof(&S.f2), Func!(float, float)));
static assert ( isFuncLike!(typeof(&S.f3), Func!(float, float)));
static assert ( isFuncLike!(typeof(&S.f4), Func!(float, float)));

Meta