www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 8584] New: bug with std.range.zip? range with opEquals(const) const not allowed inside zip

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

           Summary: bug with std.range.zip? range with opEquals(const)
                    const not allowed inside zip
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: thelastmammoth gmail.com



see
http://forum.dlang.org/thread/ewhhutwupqxbepqyzhlr forum.dlang.org#post-mailman.1402.1345925314.31962.digitalmars-d:40puremagic.com

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 25 2012
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8584


bearophile_hugs eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bearophile_hugs eml.cc



I suggest to explain the problem here again, with a minimal example code of the
problem too.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 26 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8584




copied form the above mentioned thread:


---
import std.range;
struct A{
    int x;
    //bool opEquals(const A a) {return a.x==x;} //comiles when this 
is used
    //bool opEquals(const A a)const{return a.x==x;} //will not 
compile
        bool opEquals(A a)const{return a.x==x;} //will not compile
}

struct Range(S){
    auto front(){return 0;}
    auto popFront(){}
    auto empty(){return false;}
}

void main(){
    auto a=Range!A();
    zip(a,a);
}
----

phobos/std/range.d(3449): Error: function 
std.typecons.Tuple!(Range!(A),Range!(A)).Tuple.opEquals!(const(Tuple!(Range!(A),R
nge!(A)))).opEquals 
(const(Tuple!(Range!(A),Range!(A))) rhs) is not callable using 
argument types (const(Tuple!(Range!(A),Range!(A)))) const
phobos/std/range.d(3811): Error: template instance 
std.range.Zip!(Range!(A),Range!(A)) error instantiating
scratchd(26):        instantiated from here: 
zip!(Range!(A),Range!(A))
test_scratch.d(26): Error: template instance 
std.range.zip!(Range!(A),Range!(A)) error instantiating

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