ElemInfo.fromType

get ElemInfo from type

works with: * single numeric * static arrays * static vector * static matrix

struct ElemInfo
pure @safe nothrow @nogc static @property
fromType
(
T
)
()
if (
!hasIndirections!T
)

Examples

static assert( ElemInfo.fromType!vec2 == ElemInfo( DataType.FLOAT, 2 ) );
static assert( ElemInfo.fromType!mat4 == ElemInfo( DataType.FLOAT, 16 ) );
static assert( ElemInfo.fromType!(int[2]) == ElemInfo( DataType.INT, 2 ) );
static assert( ElemInfo.fromType!float == ElemInfo( DataType.FLOAT, 1 ) );

static class A{}

static assert( !__traits(compiles, ElemInfo.fromType!A ) );
static assert( !__traits(compiles, ElemInfo.fromType!(int[]) ) );
static assert( !__traits(compiles, ElemInfo.fromType!dvec ) );

Meta