This repository was archived by the owner on Oct 12, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 411
core.lifetime: Fix copyEmplace() wrt. shared/mutability qualifiers #3246
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
72528ac
core.lifetime: Fix copyEmplace() wrt. shared qualifier
kinke e37a24a
core.internal.traits: Add BaseElemOf!T
kinke 499aa03
core.lifetime: Fix copyEmplace() wrt. mutability qualifiers
kinke 66b033f
core.lifetime: Work around apparent DMD codegen issues in unittests
kinke File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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.
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.
Any reason why
lengthwas changed tosizeof?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.
I don't understand how
BaseElemOf!Sis any different fromtypeof(S.init[0])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.
The difference shows up for multi-dimensional static arrays -
BaseElemOf!(float[10][20][30]) == float. - Extracting it as little helper IMO helps to emphasize the intent and may reduce recursive instantiations of thesehasElaborate{Move,Destructor,CopyConstructor,Assign}traits; higher dimensions don't matter here except for one of them being 0 and thus making the whole size 0; that's why I've had to change from recursively checking thelengthof each dimension to checkingS.sizeofwhen passing a static array type and then instantiating the same template once again with the base element type.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.
Makes total sense. Maybe we should have a test for this so that it does not get modified in the future.
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, some tests added.