Re: is operator and SortedRange

2016-11-11 Thread RazvanN via Digitalmars-d-learn
On Friday, 11 November 2016 at 12:02:10 UTC, ketmar wrote: On Friday, 11 November 2016 at 11:49:25 UTC, RazvanN wrote: [...] template isSortedRange(T) { private import std.range : SortedRange; static if (is(T : SortedRange!TT, TT)) { enum isSortedRange = true; } else { enum

Re: is operator and SortedRange

2016-11-11 Thread ketmar via Digitalmars-d-learn
On Friday, 11 November 2016 at 11:49:25 UTC, RazvanN wrote: I am a bit confused about how the is operator works. I have a function which receives an InputRange and a predicate. Now I need to be able to test if the InputRange is actually a SortedRange. I don't care about how the datatypes

Re: is operator and SortedRange

2016-11-11 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, November 11, 2016 11:49:25 RazvanN via Digitalmars-d-learn wrote: > I am a bit confused about how the is operator works. I have a > function which receives an InputRange and a predicate. Now I need > to be able to test if the InputRange is actually a SortedRange. I > don't care about

is operator and SortedRange

2016-11-11 Thread RazvanN via Digitalmars-d-learn
I am a bit confused about how the is operator works. I have a function which receives an InputRange and a predicate. Now I need to be able to test if the InputRange is actually a SortedRange. I don't care about how the datatypes behind the SortedRange or the predicate, I just need to see if