-
-
Notifications
You must be signed in to change notification settings - Fork 743
Finally fix emplace
for structs
#949
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
Conversation
OK, it isn't lucky enough to pass autotester. At least it compiles - already not bad. |
It's not only not passing, it's also causing grief due to tests hanging (a problem with the test system, I admit, but generally not a huge issue). One stack trace from glibc detecting double frees: *** glibc detected *** generated/linux/debug/32/unittest/std/algorithm: double free or corruption (fasttop): 0x09bf72a8 *** Would you please either close this request until it's fixed or get it working? What platform did you test it on before submitting the pull? |
I will rebase instead.
Windows XP 32 bit, an "dirEntry" test failed at runtime and I had no idea why. |
|
||
|
||
// Used in `emplace` | ||
private template _implicitlyConvertibleDim(From, To) |
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.
If this is used only inside emplace, it would be simpler to simply define it inside emplace.
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.
Impossible. It is used in _initializeFrom
and emplace
overload for a static array.
To @andralex:
Done.
Done.
It is unrelated to this pull. First commit of this pull is Finally fix |
Using `scoped` with nested class compiles but shouldn't as it results in undefined behavior.
I'd really like to see a solid Please consider turning this into a nicely self-contained patch (you could add any templates you need for the implementation as private helpers), and re-open the pull request after that. |
I have also submitted an emplace fix: #1082. It does not benefit from denis' templated functions ("callPostblits"), but has the advantage of being stand alone. Did you see it? Review? |
In the name of God, the King, and Walter I managed to release it.
This is the time D becoming a language with working
emplace
for structs (sorry, not for classes now).Now specialization for struct works this way:
T t = args[0];
if the latter compiles and works like
otherwise.
And specialization for static array works this way:
Note:
I have almost exhausted my power of apprehension so some bugs may be missed.
Requires: #776, #952, #928, #948.