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.constraints & std.array code/import swap #2701
Conversation
I'm unsure about putting array range primitives in |
Both range and array primitives should be imported into So I think this PR is good. It also do not break any code. |
@quickfur The name is unfortunate but let's not dwell on that. Think of it as |
LGTM |
@9il Would be cool to see some stats on build times. I'll collect some on my own when time permits but if you did such measures would be nice to share them. |
@DmitryOlshansky I know how to build |
@9il technically Digger should accept old pull numbers and hashes of commits as well? But anyway:
|
I think test with
|
This stuff should be compiled faster with PR. import std.range.constraints;
auto foo(Range, E)(Range r, E e) if(isInputRange!Range)
{
while(!r.empty && r.front != e)
r.popFront;
return r;
}
alias bar = foo!(uint[], uint); |
All in all things seem to improve, or at least not regress.
|
Aaand your test case, before this pull:
After:
|
@DmitryOlshansky Thanks! |
use static import rm static
Anything else to address? Are we ready to merge? |
P.S. Regarding the naming of |
Yes, I ready) |
@quickfur Please take under control the question about module name and discus it with other collaborators. |
Maybe we should bring it up in the forum? |
Auto-merge toggled on |
std.range.constraints & std.array code/import swap
@quickfur At your convenience (about forum). |
The goal of this PR is to prevent import
std.array
,std.functional
andstd.algorithm
throughstd.range.constraints
.std.array
std.range.constraints
. The reason is optimisation of compilation time.Note:
std.array
importsstd.functional
andstd.algorithm
in global scope. Seestd.array.splitter
.std.range.constraints
is going to be common global import for half of phobos instead ofstd.range
.See also: #2700 #2661 Issue 13253 - use more scoped imports in phobos