Re: [go-nuts] Best way of implementing generic binary search?

2022-07-19 Thread Martin Schnabel
Hi, there is an experimental package golang.org/x/exp/slices which has a generic binary search. I have not much to add but hope it helps. https://pkg.go.dev/golang.org/x/exp/slices https://cs.opensource.google/go/x/exp/+/79cabaa2:slices/sort.go;l=64 On 7/19/22 14:53, Slawomir Pryczek wrote: Hi

[go-nuts] Best way of implementing generic binary search?

2022-07-19 Thread Slawomir Pryczek
Hi Guys, is it possible to implement generic, efficient binary search using generics or interfaces. So i'll have some index, and data inside single struct and then could just define a comparison function between 2 variables of same type index which will return bool. Will have 20-30 million