www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 8930] New: std.algorithm.move only operates on hasLvalueElements


           Summary: std.algorithm.move only operates on hasLvalueElements
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: monarchdodra gmail.com

import std.algorithm;
import std.container;

void main()
    auto r = Array!int([1, 2, 3])[];
    r.remove!"a == 2"();
src\phobos\std\algorithm.d(6740): Error: template std.algorithm.move does not
match any function template declaration
src\phobos\std\algorithm.d(1336): Error: template std.algorithm.move cannot
deduce template function from argument types !()(int,int)

The call to "move" is smart, but pre-supposes the range has Lvalue elements.
remove should be able to work just fine for encapsulating ranges such as

Just a bit of change in the doc, and sparkle a few static ifs in the

Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 01 2012