std.algorithm.sort error with default predicate
anonymous via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Mon Jul 7 13:35:53 PDT 2014
On Monday, 7 July 2014 at 20:10:10 UTC, Archibald wrote:
> Using std.algorithm.sort(a,b,c,d,e) I get the error message :
>
> core.exception.AssertError at C:\dmd\windows\bin\..\..\src\phobos\std\algorithm.d(1
> 0350): Predicate for isSorted is not antisymmetric. Both
> pred(a, b) and pred(b,
> a) are true for a=Tuple!(float, int, uint[], int,
> uint[])(-7.56963e-05, 17, [585
> 105407, 512], 1041, [2732589055, 0]) and b=Tuple!(float, int,
> uint[], int, uint[
> ])(-7.56963e-05, 17, [2732589055, 0], 1105, [585105407, 512])
> in positions 25182
> and 25183
>
> I am using the default predicate so is it a bug?
Looks like a bad bug:
void main()
{
uint[] a = [0x22_DF_FF_FF];
uint[] b = [0xA2_DF_FF_FF];
assert(!(a < b && b < a)); /* fails */
}
More information about the Digitalmars-d-learn
mailing list