-
-
Notifications
You must be signed in to change notification settings - Fork 706
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
Simpler emplace #3805
Simpler emplace #3805
Conversation
|
Looks like a commit about static assert got mixed in this branch too.... |
38caf42 to
2eb1280
Compare
|
Boy I now messet stuff up... hold on... |
|
Where does the name |
|
I knew it! That code was in an experimental state. When I introduce experimental names, I use names that would never be plausible in the production codebase, like Happened to me in the Facebook codebase... and was seen by my Romanian coworkers :o). |
|
Alright I guess I fixed it but will need to wait for #3804. |
|
"Caca" means poop in English too :) |
|
@eco I live and I learn |
|
Looking good! Thanks for these changes, I never understood why |
|
BTW this adds documentation examples. But I'm still unhappy about dox - I think all overloads should appear in one place. Will get to that later. |
|
tests passed :) |
| static if (!is(T == struct)) | ||
| void emplaceImpl(Arg)(ref UT chunk, auto ref Arg arg) | ||
| else static if ( | ||
| !is(T == struct) && Args.length == 1 /* primitives, enums, arrays */ |
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 think this needs to check for unions, too.
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.
Yah, it occurred to me too. That would be an enhancement. I've added a test case for unions (see my next commit) and they seem to work. Could you please post a few tests that fail?
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 have any. And thinking about it, unions can have neither postblits nor destructors (and can't contain members that do), so they're POD types. They therefore shouldn't need special treatment.
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.
guess we're ready for the mergearoo!
|
How's it doing on: ? |
|
@WalterBright looks good, only CTFE code and code with I pushed one more commit to nominally improve coverage. |
The logic in
emplacecopies the logic used by the compiler itself in generating constructors. After sleeping on it for a night I figured I could get most of that logic just work for us by defining astructwith only one member and one constructor. Then the rest is taken care of.