www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 3234] New: Range comparison with array

http://d.puremagic.com/issues/show_bug.cgi?id=3234

           Summary: Range comparison with array
           Product: D
           Version: 2.029
          Platform: Other
               URL: http://www.digitalmars.com/d/2.0/phobos/std_algorithm.
                    html#filter
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: Jesse.K.Phillips+D gmail.com
                CC: Jesse.K.Phillips+D gmail.com


Comparisons between a range and a static array gave error.

The error received is:

    Error: incompatible types for ((small) == ([1,2])): 'Filter!(result,int[])'
and 'int[2u]'

Example code provided by std.algorithms webpage:

import std.algorithm;

void main() {
   int[] arr = [ 1, 2, 3, 4, 5 ];
   // Sum all elements
   auto small = filter!("a < 3")(arr);
   assert(small == [ 1, 2 ]);
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 07 2009