Bug 10656 – support array operations for complex arrays
Status
RESOLVED
Resolution
WONTFIX
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-07-16T17:45:52Z
Last change time
2020-03-21T03:56:34Z
Assigned to
No Owner
Creator
thelastmammoth
Comments
Comment #0 by thelastmammoth — 2013-07-16T17:45:52Z
import std.complex;
void main(){
version(a1)
auto a=[complex(0,0)];//Error: incompatible types for ((a[]) / (2)): 'Complex!(double)[]' and 'int'
else version(a2)
auto a = [0 + 0.0i];//Error: incompatible types for ((a[]) / (2)): 'cdouble[]' and 'int'
else version(a3)
auto a = [0.0];
else static assert(0);
//auto b=a[]+2.0; // Error: Array operation a[] + 2.00000 not implemented (a3) or incompatible types for ... (a1/a2)
a[]*=2;
}
Comment #1 by b2.temp — 2017-09-01T07:47:23Z
version a1:
What's not supported is actually std.complex.Complex.OpBinaryRight!"*"
version a2:
See https://dlang.org/deprecate.html, built-in complexs are planned for deprecation.
Please open en enhancement resquest for std.complex.Complex if you really think that this should be supported.