D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 10888 - std.range.RefRange does not forward all methods/properties of underlying range
Summary: std.range.RefRange does not forward all methods/properties of underlying range
Status: NEW
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: All All
: P3 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-25 04:55 UTC by Joseph Rushton Wakeling
Modified: 2024-12-01 16:18 UTC (History)
1 user (show)

See Also:


Attachments
Example with std.random.Random wrapped by RefRange. .min and .max properties are not forwarded. (801 bytes, text/x-dsrc)
2013-08-25 04:55 UTC, Joseph Rushton Wakeling
Details

Note You need to log in before you can comment on or make changes to this issue.
Description Joseph Rushton Wakeling 2013-08-25 04:55:04 UTC
Created attachment 1244 [details]
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.
Comment 1 hsteoh 2013-08-26 22:01:01 UTC
This is where it would be nice if the language supported alias *p this. :)
Comment 2 Joseph Rushton Wakeling 2015-07-26 11:45:54 UTC
See also Issue #14830 for a similarly problematic issue with RNGs and RefCounted.
Comment 3 dlangBugzillaToGithub 2024-12-01 16:18:38 UTC
THIS ISSUE HAS BEEN MOVED TO GITHUB

https://github.com/dlang/phobos/issues/9613

DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB