D outperformed by C++, what am I doing wrong?
via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Sun Aug 13 03:09:38 PDT 2017
On Sunday, 13 August 2017 at 09:41:39 UTC, Johan Engelen wrote:
> On Sunday, 13 August 2017 at 09:08:14 UTC, Petar Kirov
> [ZombineDev] wrote:
>> [...]
>
>> [...]
>
> Execution of sum_subranges is already O(1), because the
> calculation of the sum is delayed: the return type of the
> function is not `uint`, it is `MapResult!(sum, <range>)` which
> does a lazy evaluation of the sum.
>
> - Johan
Heh, yeah you're absolutely right. I was just about to correct
myself, when I saw your reply. Don't know how I missed such an
obvious thing :D
More information about the Digitalmars-d-learn
mailing list