is it bug?

anonymous via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Jan 30 05:11:34 PST 2015


On Friday, 30 January 2015 at 12:32:05 UTC, drug wrote:
>
> ```
> import std.container: RedBlackTree;
>
> class Manager(TT, alias Cmp = "a<b")
> {
>     alias Container = RedBlackTree!(TT, Cmp);
>     Container _cont;
>
>     static init()
>     {
>         auto instance = new typeof(this)();
>         instance._cont = new Container();
>         return instance;
>     }
> }
>
> unittest
> {
>     alias IntManager = Manager!int;
>     auto im = IntManager.init();
> }
>
> void main() {}
> ```
>
> run it using
> 	rdmd -unittest filename.d
>
> it fails in a RedBlackTree unittest with 2.065 and 2.066, is it 
> bug?

Reduced:

import std.container: RedBlackTree;
alias Container = RedBlackTree!(int, "a<b");

Error: [...]/std/container/rbtree.d(850): unittest failure

Lines 846-850:

         static if(less == "a < b")
             auto vals = [1, 2, 3, 4, 5];
         else
             auto vals = [5, 4, 3, 2, 1];
         assert(equal(r, vals));


More information about the Digitalmars-d-learn mailing list