On 14/03/12 15:57, Boscop wrote:
Hi everyone,

I wrote a blog post for people who know a bit of D and want to dig
deeper, it shows different approaches to get vector swizzling syntax in D:

http://boscop.tk/blog/?p=1

There is nothing revolutionary involved but it might still be useful to
someone.
Comments and criticism are welcome.

In the last bit of code, why not use CTFE for valid(string s) instead of templates?

bool valid(string s)
{
   foreach(c; s)
   {
     if (c < 'w' || c > 'z') return false;
   }
   return true;
}

In fact you can use CTFE for the other template functions as well.

Reply via email to