Thread overview
[Issue 6935] New: struct with @disable this cannot make range
Nov 12, 2011
Kenji Hara
Nov 12, 2011
Kenji Hara
Nov 14, 2011
Kenji Hara
November 12, 2011
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: nobody@puremagic.com
        ReportedBy: k.hara.pg@gmail.com


--- Comment #0 from Kenji Hara <k.hara.pg@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: -------
November 12, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6935


Kenji Hara <k.hara.pg@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch


--- Comment #1 from Kenji Hara <k.hara.pg@gmail.com> 2011-11-12 01:28:41 PST ---
https://github.com/D-Programming-Language/phobos/pull/324

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
November 14, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6935


Kenji Hara <k.hara.pg@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


--- Comment #2 from Kenji Hara <k.hara.pg@gmail.com> 2011-11-14 04:48:11 PST ---
https://github.com/D-Programming-Language/phobos/commit/bd5141b027b5acddde0cf8596a2d223b47e1f8d3

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