Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Fix 11761: aa.byKey and aa.byValue are not forward ranges. #925

Merged
merged 2 commits into from Aug 15, 2014

Conversation

quickfur
Copy link
Member

The problem is that Phobos' isForwardRange template requires that
.save must be @property, otherwise it does not acknowledge the range
as a forward range; however, aa.byKey and aa.byValue's .save weren't
marked as such. This PR fixes this problem and introduces a unittest to
ensure the forward range criteria are satisfied.

The problem is that Phobos' `isForwardRange` template requires that
`.save` must be `@property`, otherwise it does not acknowledge the range
as a forward range; however, aa.byKey and aa.byValue's `.save` weren't
marked as such. This PR fixes this problem and introduces a unittest to
ensure the forward range criteria are satisfied.
@CyberShadow
Copy link
Member

I'd DRY up the unit test, considering we want a byPair eventually as well.

@quickfur
Copy link
Member Author

Done. Even threw in a test for byPair (commented out, of course), for good measure. :)

@9rnsr
Copy link
Contributor

9rnsr commented Aug 15, 2014

Link to the bugzilla report: https://issues.dlang.org/show_bug.cgi?id=11761

And, the fix looks good to me.

@9rnsr
Copy link
Contributor

9rnsr commented Aug 15, 2014

Auto-merge toggled on

9rnsr added a commit that referenced this pull request Aug 15, 2014
Fix 11761: aa.byKey and aa.byValue are not forward ranges.
@9rnsr 9rnsr merged commit 38eee4c into dlang:master Aug 15, 2014
@quickfur quickfur deleted the issue11761 branch August 15, 2014 15:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants