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

           Summary: struct with @disable this cannot make range
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nob...@puremagic.com
        ReportedBy: k.hara...@gmail.com


--- Comment #0 from Kenji Hara <k.hara...@gmail.com> 2011-11-12 01:11:57 PST ---
Following code should compile, but doesn't.

import std.range;
struct R
{
    @disable this();  // requires explicit initializer

    @property bool empty() const{ return false; }
    @property int front(){ return 0; }
    void popFront(){}

    @property R save(){ return this; }

    int back(){ return 0; }
    void popBack(){}

    int opIndex(size_t n){ return 0; }
    @property size_t length() const { return 0; }
}
static assert(isInputRange!R);
static assert(isForwardRange!R);
static assert(isBidirectionalRange!R);
static assert(isRandomAccessRange!R);

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

Reply via email to