On Friday, September 23, 2011 11:15 Gor F. Gyolchanyan wrote: > It's not a performance issue. > You can't do this: > > if(_ctfe) > to!string(...); > else > toStringNow!(...); > > because the toStringNow!(...) won't compile, because it's argument is not a > compile-time value.
So, use a normal function. The main reason to use _ctfe is because the normal function doesn't work with CTFE for one reason or another, and so you use a less efficient function which _can_ do it at compile time. Since you're operating on a value rather than a type, there's no reason why you can't use a function rather than an eponymous template. - Jonathan M Davis
