map! evaluates twice

Ali Çehreli acehreli at yahoo.com
Thu Jun 16 16:09:24 UTC 2022


On 6/16/22 00:58, Salih Dincer wrote:

 > I guess the developed cached() and cache() are different things,
 > right?

cache caches only the front element.

   https://dlang.org/library/std/algorithm/iteration/cache.html

 > I tried cached()

cached() is supposed to cache as many elements as needed as long as 
there are ranges that still reference the elements. Technically, 
cached() does not exist because only a couple of people have seen a 
draft of it. :)

Ali



More information about the Digitalmars-d-learn mailing list