Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

std.range.RefRange does not forward all methods/properties of underlying range #9613

Open
dlangBugzillaToGithub opened this issue Aug 25, 2013 · 2 comments

Comments

@dlangBugzillaToGithub
Copy link

joseph.wakeling (@WebDrake) reported this on 2013-08-25T04:55:04Z

Transfered from https://issues.dlang.org/show_bug.cgi?id=10888

CC List

  • hsteoh

Description

Created attachment 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.

!!!There are attachements in the bugzilla issue that have not been copied over!!!

@dlangBugzillaToGithub
Copy link
Author

hsteoh commented on 2013-08-26T22:01:01Z

This is where it would be nice if the language supported alias *p this. :)

@dlangBugzillaToGithub
Copy link
Author

joseph.wakeling commented on 2015-07-26T11:45:54Z

See also Issue #14830 for a similarly problematic issue with RNGs and RefCounted.

@LightBender LightBender removed the P3 label Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants