FixedList Sort with IComparer also demands IComparable type

Having recently discovered FixedList[N]Bytes and their uses in jobs I quickly wanted to be able to sort them. But if you want to provide a IComparer to sort the list the implementation in FixedListExtensions requires FixedList type T to be IComparable. So if I have for example a FixedList512Bytes<float4> and I want to sort according to w using a IComparer that is not possible because float4 does not implement IComparable which makes no sense since I’m providing the IComparer to specify how to compare the values.

This appears to be a bug that affects all the FixedList[N]Bytes Sort IComparer implementations in FixedListExtensions. The underlying implementation does not seem to be depended on the IComparable interface.

1 Like

Seems to be still a thing in Collections 6.5.0. Wanted to just sort some float2 elements with custom comparer, and now I’ll have to figure out some silly workaround. A bit annoying.