www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 9734] New: setIntersection accepts only 2 ranges, but documentation says otherwise

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9734

           Summary: setIntersection accepts only 2 ranges, but
                    documentation says otherwise
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: websites
        AssignedTo: nobody puremagic.com
        ReportedBy: josvanuden gmail.com



std.algorithm.setIntersection only accepts 2 ranges, although the documentation
says it accepts 2 or more. There's a static assert in the code that limits the
input to 2 ranges. Even the example on the webpage doesn't compile:

int[] a = [ 1, 2, 4, 5, 7, 9 ]; 
int[] b = [ 0, 1, 2, 4, 7, 8 ]; 
int[] c = [ 0, 1, 4, 5, 7, 8 ]; 
assert(equal(setIntersection(a, a), a)); 
assert(equal(setIntersection(a, b), [1, 2, 4, 7][])); 
assert(equal(setIntersection(a, b, c), [1, 4, 7][]));

(...)\dmd2\windows\bin\..\..\src\phobos\std\algorithm.d(10076): Error: static
assert  (3u == 2u) is false
(...)\dmd2\windows\bin\..\..\src\phobos\std\algorithm.d(10150):       
instantiated from here: SetIntersection!("a < b", int[], int[], int[])
test.d(16):        instantiated from here: setIntersection!("a < b",
int[],int[],int[])

Whether this limitation is temporary or permanent, I think the docs should
indicate that you cannot (for now) input more than 2 ranges.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 16 2013
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9734


jens.k.mueller gmx.de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jens.k.mueller gmx.de



I just found this out as well. Can you update the documentation?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 27 2013