D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 10656 - support array operations for complex arrays
Summary: support array operations for complex arrays
Status: RESOLVED WONTFIX
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-16 17:45 UTC by thelastmammoth
Modified: 2020-03-21 03:56 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description thelastmammoth 2013-07-16 17:45:52 UTC
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 basile-z 2017-09-01 07:47:23 UTC
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.