-
-
Notifications
You must be signed in to change notification settings - Fork 704
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
reduce ndslice template bloat #4823
Conversation
|
Do you have any data for the compile time speed difference? |
|
No |
|
Compilation speed for unittests is the same. But this is not a goal. Goal is more clean API, less function names in object files and in the documentation. A lot of prototypes was removed, but API functionality remains the same. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks quite a bit nicer, too.
| @@ -513,6 +477,8 @@ private bool isValidPartialPermutationImpl(size_t N)(in size_t[] perm, ref int[N | |||
| return true; | |||
| } | |||
|
|
|||
| enum toSize_t(size_t i) = i; | |||
| enum isSize_t(alias i) = is(typeof(i) == size_t); | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you make all of these private or package?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
std/experimental/ndslice/internal.d is public because it is required to remove existing ndslice modules from Mir but continue add new ndslice modules. So, it should be shared/public for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
alrighty then
| @@ -329,7 +329,7 @@ Returns: | |||
| n-dimensional slice of the same type | |||
| See_also: $(LREF swapped), $(LREF transposed) | |||
| +/ | |||
| Slice!(N, Range) everted(size_t N, Range)(auto ref Slice!(N, Range) slice) | |||
| Slice!(N, Range) everted(size_t N, Range)(Slice!(N, Range) slice) | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wait, this is a typo, should be reverted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Evert is a word, though 9il might have meant reverted,
Eversion (from the verb "evert") is the process of turning inside-out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is not a typo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool thx! live and learn
|
Auto-merge toggled on |
There are 2 commits with different template bloat optimizations.
auto refwas also removed.This PR follows suggestions from @aG0aep6G and @timotheecour from the thread http://forum.dlang.org/thread/njcoyysqeqhbejxperyv@forum.dlang.org?page=1