Allocator: fix experimental makeMultidimensionalArray API#5155
Merged
dlang-bot merged 1 commit intodlang:masterfrom Feb 22, 2017
Merged
Allocator: fix experimental makeMultidimensionalArray API#5155dlang-bot merged 1 commit intodlang:masterfrom
dlang-bot merged 1 commit intodlang:masterfrom
Conversation
Contributor
|
489bd6a to
b4c1de4
Compare
andralex
approved these changes
Feb 22, 2017
std/experimental/allocator/package.d
Outdated
| An N-dimensional array with individual elements of type T. | ||
| */ | ||
| auto makeMultidimensionalArray(uint n, T, Allocator)(auto ref Allocator alloc, size_t[n] lengths) | ||
| auto makeMultidimensionalArray(T, Allocator, size_t N)(auto ref Allocator alloc, size_t[N] lengths...) |
Member
There was a problem hiding this comment.
Cool. We've had this chataroo in the previous PR - N is not exempt from the usual rules: lowercase for values, uppercase for types. So let's make it lowercase. Thanks!
std/experimental/allocator/package.d
Outdated
| else | ||
| { | ||
| alias E = typeof(makeMultidimensionalArray!(n - 1, T)(alloc, lengths[1..$])); | ||
| alias E = typeof(makeMultidimensionalArray!(T, Allocator, N - 1)(alloc, lengths[1..$])); |
b4c1de4 to
64a0814
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Unfortunately I was away when #4982 was merged (and no one else has raised their voice either).
However, luckily this hasn't been released :)
Imho we can do provide a better API if
Tis always the first parameter (after all that's the only template parameter manually provided by the user)FWIW I really don't like the name and would prefer sth. like
makeNdarray(that was the name of this method inndslice.In short - instead of:
let's better write code like this: