[Issue 13091] New: nothrow std.algorithm.cartesianProduct

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu Jul 10 15:10:01 PDT 2014


https://issues.dlang.org/show_bug.cgi?id=13091

          Issue ID: 13091
           Summary: nothrow std.algorithm.cartesianProduct
           Product: D
           Version: D2
          Hardware: x86
                OS: Windows
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: Phobos
          Assignee: nobody at puremagic.com
          Reporter: bearophile_hugs at eml.cc

void main() pure nothrow @safe @nogc {
    import std.algorithm: cartesianProduct;
    int[1] a = [1];
    foreach (t; cartesianProduct(a[], a[])) {}
}


dmd 2.066beta2 gives me:

test.d(4,33): Error: pure function 'D main' cannot call impure function
'std.algorithm.cartesianProduct!(int[], int[]).cartesianProduct'
test.d(4,33): Error: @nogc function 'D main' cannot call non- at nogc function
'std.algorithm.cartesianProduct!(int[], int[]).cartesianProduct'
test.d(4,5): Error: pure function 'D main' cannot call impure function
'std.algorithm.joiner!(MapResult!(__lambda3, int[])).joiner.Result.popFront'
test.d(4,5): Error: @nogc function 'D main' cannot call non- at nogc function
'std.algorithm.joiner!(MapResult!(__lambda3, int[])).joiner.Result.popFront'
test.d(4,33): Error: 'std.algorithm.cartesianProduct!(int[],
int[]).cartesianProduct' is not nothrow
test.d(4,5): Error: 'std.algorithm.joiner!(MapResult!(__lambda3,
int[])).joiner.Result.popFront' is not nothrow
test.d(1,6): Error: function 'D main' is nothrow yet may throw

--


More information about the Digitalmars-d-bugs mailing list