www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 10888] New: std.range.RefRange does not forward all methods/properties of underlying range

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

           Summary: std.range.RefRange does not forward all
                    methods/properties of underlying range
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: joseph.wakeling webdrake.net


--- Comment #0 from Joseph Rushton Wakeling <joseph.wakeling webdrake.net>
2013-08-25 04:55:04 PDT ---
Created an attachment (id=1244)
Example with std.random.Random wrapped by RefRange.  .min and .max properties
are not forwarded.

When a range is wrapped by RefRange, _all_ the public methods and properties
should be forwarded.

The attached example shows a case where std.random.Random is wrapped by
RefRange.  The regular range methods/properties are correctly forwarded, but
the .min and .max properties of Random are not, and the code fails with the
errors:

refrange.d(26): Error: no property 'min' for type
'RefRange!(MersenneTwisterEngine!(uint, 32, 624, 397, 31, 2567483615u, 11, 7,
2636928640u, 15, 4022730752u, 18))'
refrange.d(27): Error: no property 'max' for type
'RefRange!(MersenneTwisterEngine!(uint, 32, 624, 397, 31, 2567483615u, 11, 7,
2636928640u, 15, 4022730752u, 18))'

Desired behaviour: .min and .max properties should be present for
RefRange!Random.

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



--- Comment #1 from hsteoh quickfur.ath.cx 2013-08-26 22:01:01 PDT ---
This is where it would be nice if the language supported alias *p this. :)

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