On Saturday, 3 April 2021 at 13:46:17 UTC, kdevel wrote:
Why does this code

   ec.opAssign (bar (1)); // okay
// ec = bar (1); // Error: expression bar(1) is void and has no value

compile with the abovementioned error?

You cannot assign void returned from bar() as parameter to opAssign(). The lazy keyword creates some internal delegate, thus opAssign() works instead. I'm afraid lazy storage class only works with arguments, not rvalues.

Reply via email to