Something like this (Not sure if I have the syntax quite right): template BaseTypeOfVector(T : __vector(T[N]), size_t N) { T is the type of the vector N is the number of elements } It's important to be able to know the type and width of vectors at compile time to generate appropriate code.
Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/186dba1320fa1874bbfb71da1fa3f00ae07304d7 fix Issue 7411 - Deduce base type from vector types in templates