What is "FilterResult" type?

cym13 via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Sep 9 06:16:48 PDT 2015


On Wednesday, 9 September 2015 at 11:30:26 UTC, Bahman Movaqar 
wrote:
> For the lame example I gave, something similar occurred to me 
> at first; but then I thought 4 `filter`s (assuming `all` is 
> simply a `filter`) might be non-idiomatic as it might incur 
> some performance penalty.

As those are templates I don't think you'd have any overhead ; I 
may be wrong about that but the whole point of such constructs is 
to allow what Walter poetically called “memory disallocation”.

https://www.youtube.com/watch?v=znjesAXEEqw

> True.  But is pumping the output of `filter` as the seed into 
> `reduce` really considered weird usage!?

I don't think it is really weird per se, I just can't think of a 
case where there isn't a better way to do it. I find it 
completely unreadable frankly, and I generally avoid reduce when 
I can because it is not UFCS-able. This is only personal opinion 
though.


More information about the Digitalmars-d-learn mailing list