What is "FilterResult" type?
Bahman Movaqar via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Wed Sep 9 04:20:16 PDT 2015
On Wednesday, 9 September 2015 at 09:08:28 UTC, Atila Neves wrote:
> No, it doesn't. It needs to know what the compile-time
> interface is, i.e. what it can do with that type. If the type
> in question happens to be an InputRange, then the consumer
> function would be:
>
> void func(R)(R range) if(isInputRange!R) { ... }
>
> instead of using a concrete type like this:
>
> void func(MyType range) { ... }
>
> That way you can change range types and `func` doesn't care.
Ah...makes sense. Thanks.
More information about the Digitalmars-d-learn
mailing list