On Thursday, 15 May 2014 at 06:52:44 UTC, Jonathan M Davis via Digitalmars-d-learn wrote:
On Thu, 15 May 2014 05:53:45 +0000
monarch_dodra via Digitalmars-d-learn
<digitalmars-d-learn@puremagic.com> wrote:

As a workaround, I'm sure we could specialize enforce without
lazy for built-in types?

No. I don't think that that would work. The problem is that you'd have to be
able to overload between stuff like "error message" and
format("error message: %s", foo), because you don't want the first one to be
lazy, whereas you do want the second one to be lazy.

Oh... right. It's the *second* parameter that's lazy.

Arguably, the compiler should be able too "see" if the argument passed is a value or an expression though, and optimize accordingly.

Reply via email to