Future of memory management in D

Tejas notrealemail at gmail.com
Thu Nov 18 13:25:26 UTC 2021


On Thursday, 18 November 2021 at 13:05:02 UTC, Steven 
Schveighoffer wrote:
> On 11/17/21 11:24 PM, rumbu wrote:
>> Finally, I found 
>> [something](https://digitalmars.com/d/1.0/builtin.html) from 
>> the old D1 page:
>> 
>>> Complex Numbers
>>> A detailed comparison with C++'s std::complex.
>>>
>>> The most compelling reason is compatibility with C's 
>>> imaginary and complex floating point >types. Next, is the 
>>> ability to have imaginary floating point literals. Isn't:
>>>
>>> c = (6 + 2i - 1 + 3i) / 3i;
>>> far preferable than writing:
>>>
>>> c = (complex!(double)(6,2) + complex!(double)(-1,3)) / 
>>> complex!(double)(0,3);
>>> ? It's no contest.
>> 
>> 15 years ago. I will reply  with this quote to everyone who 
>> has "another library solution".
>
> Let's adjust the straw in that man:
>
> ```d
> import std.complex;
>
> auto i(double v)
> {
>     return complex(0, v);
> }
>
> void main()
> {
>     auto c = (6 + 2.i - 1 + 3.i) / 3.i;
> }
> ```
>
> -Steve

This is amazing :D

But, this has not been documented anywhere in the `std.complex` 
page, so I don't feel its fair to say that rumbu is making a 
straw man argument.


More information about the Digitalmars-d mailing list