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

Issue 5233 - std.range.put accepts *any* element type when putting to an array. #433

Closed
wants to merge 1 commit into from

Conversation

sandford
Copy link

This patch primarily adds code snippets to put and adds support for output ranges to recursively call put on themselves and bypassing the r.put code snippets. This lets templated output ranges support all the code snippets in put() without having to re-implement them.

This patch also address issue 4880 - [patch] std.range.put does not handle output ranges implement via opDispatch; breaks on RefAppender

Other Changes

  • char[] and wchar[] are now considered output ranges.

Unchanged

  • Mutable arrays are filled, while immutable arrays are appended to, which seems inconsistent at first.
  • static assert usage; there was a time when static assert inside template constraints caused issues, but this appears to have been fixed.

fix issue 5233
http://d.puremagic.com/issues/show_bug.cgi?id=5233
fix issue 4880
http://d.puremagic.com/issues/show_bug.cgi?id=4880

std.range.put accepts *any* element type when putting to an array.
http://d.puremagic.com/issues/show_bug.cgi?id=5233

Additions
- several additional overloads
- output ranges can now recursively call put on themselves by calling put!(R,E,true)(r,e).

Changes
- char[] and wchar[] are now considered output ranges.

Unchanged
- Mutable arrays are filled, while immutable arrays are appended.
@andralex
Copy link
Member

I'm willing to pull this in only as a step towards a complete rewrite. With time put() has become a mess and this request only adds to it. We need to rethink and reimplement what a.put(b) really does and for what kinds of as and bs it works.

@andralex
Copy link
Member

andralex commented Jul 9, 2012

rebase please

@sandford sandford closed this Jul 9, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants