Well im using D1 so if anyone knows of a way that would be lovely, the basics are this: template foo(char[] src) { static if(src available at compile time for CTFE /*Ie is src const*/) blah; else blah; }