Generator implements InputRange interface#5515
Conversation
|
Thanks for your pull request, @dukc! We are looking forward to reviewing it, and you should be hearing from a maintainer soon. Some tips to help speed things up:
Bear in mind that large or tricky changes may require multiple rounds of review and revision. Please see CONTRIBUTING.md for more information. Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. |
18eeb7f to
5656d9b
Compare
…ement std.range.interfaces.InputRange without having to call inputRangeObject().
5656d9b to
5983bcc
Compare
MetaLang
left a comment
There was a problem hiding this comment.
This is good, but I'd suggest adding a few more tests (preferably non-trivial ones). Maybe look at some of the std.range tests for inspiration.
std/concurrency.d
Outdated
|
|
||
| private | ||
| { | ||
| import core.atomic; |
There was a problem hiding this comment.
Can you remove the un-needed imports? (core.thread, core.sync.mutex, core.sync.condition, std.range.primitives)
std/concurrency.d
Outdated
| import core.sync.condition; | ||
| import std.range.primitives; | ||
| import std.range.interfaces; | ||
| import std.traits; |
There was a problem hiding this comment.
import std.traits: hasElaborateCopyConstructor
std/concurrency.d
Outdated
| { | ||
| import core.exception; | ||
| import std.exception; | ||
| import std.range.interfaces; |
std/concurrency.d
Outdated
| { | ||
| tid.send(e); | ||
| } | ||
|
|
There was a problem hiding this comment.
This isn't a show stopper but there's no reason to clutter the diff with extraneous whitespace.
std/concurrency.d
Outdated
| assert(counter == [7, 21]); | ||
| } | ||
|
|
||
| // MessageBox Implementation |
There was a problem hiding this comment.
Is this related to the changes in question? If not please remove it.
std/concurrency.d
Outdated
| } | ||
|
|
||
| /** | ||
| * Returns the most recently generated value without excuting a copy |
std/concurrency.d
Outdated
| { | ||
| static assert(0, | ||
| "Fiber front is rvalue and thus cannot be moved when it defines a postblit."); | ||
| "Fiber front is always rvalue and thus cannot be moved if it defines a postblit."); |
There was a problem hiding this comment.
We know here that T defines an elaborate copy constructor so it might be better to mention it by name. Better wording for this message might be:
"Fiber front cannot be moved because " ~ t.stringof ~ " defines a postblit"
Another option is to use a template guard instead, like:
final T moveFront()
if (!hasElaborateCopyConstructor!T)
There was a problem hiding this comment.
Template guard won't do since then postblitting fibers would not implement InputRange anymore. I can clarify wording trough.
71793fa to
13fc6cf
Compare
|
@wilzbach why hasn't the bot suggested someone from the core team that could review this PMR? Has that functionality been disabled? |
Yes, we disabled it because it was too noisy. IIRC it was only enabled for one week in August 2016: dlang-bots/mention-bot#7 Btw (for contributors) GH now suggests reviewers based on the diff and other information: |
JackStouffer
left a comment
There was a problem hiding this comment.
Everything looks ok to me.
13fc6cf to
942da35
Compare
Removed the whitespace line from the diff. |
|
Thanks @JackStouffer and @wilzbach. There's one other one that needs to be looked at when you have some time; it apparently fixes random segfaults in the std.concurrency test suite. Unfortunately I'm not familiar with std.concurrency so I can't review it. |

Reboot of #5309 which is a reboot of #5194.