Templates and SIMD - examining types

Cecil Ward cecil at cecilward.com
Wed Jul 22 21:58:16 UTC 2020

I am using SIMD and I have a case in a template where I am being 
passed an argument that is a pointer to a 128-bit chunk of either 
16 bytes or 8 uwords but I don’t know which? What’s the best way 
to discover this at compile time - using the ‘is’ operator ? I 
forget for the moment. It will only ever be either a ubyte16 or a 
ushort8 (if those are the correct type names)? I’ll exclude other 
possibilities with an if qualifier on the template (somehow).

I need to then work out what is the size of the internal units 
within the 128-bit value, size in bytes,1 or 2, at compile time.

More information about the Digitalmars-d-learn mailing list