Timon Gehr: > The compiler should do loop invariant code motion for pure functions. Right, that too. But in DMD 2.058alpha this doesn't compile, regex() isn't pure: import std.regex; void main() pure { auto re = regex(r"\d"); } Bye, bearophile