D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 7411 - Deduce base type from vector types in templates
Summary: Deduce base type from vector types in templates
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: No Owner
URL:
Keywords: SIMD
Depends on:
Blocks:
 
Reported: 2012-01-31 10:30 UTC by Manu
Modified: 2012-02-28 19:28 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Manu 2012-01-31 10:30:19 UTC
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.
Comment 1 github-bugzilla 2012-02-28 19:27:48 UTC
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