ElemInfo.fromType

get ElemInfo from type

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

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

Examples

1 static assert( ElemInfo.fromType!vec2 == ElemInfo( 2, DataType.FLOAT ) );
2 static assert( ElemInfo.fromType!mat4 == ElemInfo( 16, DataType.FLOAT ) );
3 static assert( ElemInfo.fromType!(int[2]) == ElemInfo( 2, DataType.INT ) );
4 static assert( ElemInfo.fromType!float == ElemInfo( 1, DataType.FLOAT ) );
5 
6 static class A{}
7 
8 static assert( !__traits(compiles, ElemInfo.fromType!A ) );
9 static assert( !__traits(compiles, ElemInfo.fromType!(int[]) ) );
10 static assert( !__traits(compiles, ElemInfo.fromType!dvec ) );

Meta