Re: How to realize isSortedRange?

2014-08-20 Thread Alexandr Druzhinin via Digitalmars-d-learn
Thank you!

Re: How to realize isSortedRange?

2014-08-20 Thread hane via Digitalmars-d-learn
On Wednesday, 20 August 2014 at 07:18:12 UTC, Kagamin wrote: http://dlang.org/phobos/std_traits.html#TemplateOf Or isInstanceOf. static if (__traits(isSame, TemplateOf!R, SortedRange)) static if (isInstanceOf!(SortedRange, R))

Re: How to realize isSortedRange?

2014-08-20 Thread Kagamin via Digitalmars-d-learn
http://dlang.org/phobos/std_traits.html#TemplateOf

How to realize isSortedRange?

2014-08-19 Thread Alexandr Druzhinin via Digitalmars-d-learn
I need to ensure that range passed to function is SortedRange to use binary search. I did something like: static if(!__traits(compiles, { ElementType!(typeof(data)) element; auto d = data.trisect(element); } )) assert(0, "DataRange shall be