joiner and map, strange behavior

bearophile bearophileHUGS at lycos.com
Tue Mar 12 10:43:42 PDT 2013


Stephan Schiffels:

> I am struggling with understanding this behavior. In the code 
> below, the function "getVec" is called 8 times, but it should 
> be called only 4 times (once for each call inside of map).
>
> Any explanations?

Maybe it's a matter of calling front() more times, as in filter 
in a recent thread. To be sure take a look inside phobos sources.

By the way, your code is quite inefficient, because it allocates 
a new matrix at each call to getVec.

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list