On Friday, 28 September 2012 at 17:52:55 UTC, Tommi wrote:
In a perfect world, I think, the compiler would always evaluate
all possible functions at compile-time, given that doing so
would produce a smaller (or equal size) executable than what
not-evaluating-at-compile-time would produce.
Or, a simpler rule (for both the compiler and the coder):
Have a compiler flag where you set a value (in bytes), and if a
function returns a type that's size is not larger than the set
value, the compiler would execute all calls to that function at
compile-time (if possible).