[Issue 9980] [CTFE] Allow interpreting function with variable arguments when their values aren't used

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Aug 12 17:34:30 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=9980



--- Comment #3 from Don <clugdbug at yahoo.com.au> 2013-08-12 17:34:27 PDT ---
The values _are_ used, though. Function arguments are evaluated when the
function is called, unless it's a 'lazy' argument.

Would you want this to also happen with:

static assert(g(true, 2, i + 1) == 2);

?
since 'i + 1' is used exactly as much as 'i' is in the original example.

So what this request is, is quite difficult to describe. It's kind of "delay
evaluation of function arguments in CTFE until the point at which they are used
in the function, if the argument has no side-effects".

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list