Why is ^^= not part of type definition of integers?

Max Haughton maxhaton at gmail.com
Tue May 4 15:27:13 UTC 2021


On Tuesday, 4 May 2021 at 15:20:53 UTC, 12345swordy wrote:
> Currently it relies on a function call of phobos math function 
> instead of code generation for backend optimization. If that 
> were the case, why does it not rewrite it as `this g() = 
> std.math.pow(g(),2)` for functions?
>
>
> This is a road block for me when implementing binary operators 
> for properties.
>
>
> -Alex

pow can be inlined, there is no optimization problem here.

As for why the rewriting doesn't happen in general I assume it's 
because there wasn't demand for it.

Why is this a roadblock, can't you just lower to the form similar 
to the one you suggest?


More information about the Digitalmars-d mailing list