How to search for an element in the array. D2 phobos.

2009-07-12 Thread Eldar Insafutdinov
I am a little bit confused with a simple operation of searching in the array with D2-phobos. With tango I used to use: size_t find( Elem[] buf, Elem pat, Pred2E pred = Pred2E.init ); Performs a linear scan of buf from [0 .. buf.length), returning the index of the first element matching p

Re: How to search for an element in the array. D2 phobos.

2009-07-12 Thread bearophile
Eldar Insafutdinov: > I think I completely misunderstood how to use it. Yes, it's too much complex. It tries to do many different things in the most efficient way possible, the result is a high complexity in usage. That's one of the faults of Andrei's code, it's not tested by letting average co

Re: How to search for an element in the array. D2 phobos.

2009-07-12 Thread Bill Baxter
On Sun, Jul 12, 2009 at 3:56 PM, bearophile wrote: > Eldar Insafutdinov: >> I think I completely misunderstood how to use it. > > Yes, it's too much complex. It tries to do many different things in the most > efficient way possible, the result is a high complexity in usage. That's one > of the fa

ulong divides (by) int cause dmd crash

2009-07-12 Thread Sam Hu
Below codes cause dmd crash in dmd2.031,but OK in dmd2.030: module dmdCrash; void main() { ulong num1=100; int num2=10; int result=num1/num2; }

Re: How to search for an element in the array. D2 phobos.

2009-07-12 Thread Daniel Keep
bearophile wrote: > Eldar Insafutdinov: >> I think I completely misunderstood how to use it. > > Yes, it's too much complex. It tries to do many different things in the most > efficient way possible, the result is a high complexity in usage. That's one > of the faults of Andrei's code, it's no