A kind of "static foreach" already works for tuples, why not other constants as well? Example: import std.typetuple; void main() { alias TypeTuple!(void, void, void) TL; foreach (t; TL) { pragma(msg, "this prints three times"); } const char[] s = "abc"; foreach (c; s) { pragma(msg, "and maybe this should as well?"); } }