-
-
Notifications
You must be signed in to change notification settings - Fork 368
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
Update c++ interop reference page on lifetime handling interoperability #3798
base: master
Are you sure you want to change the base?
Conversation
Thanks for your pull request and interest in making D better, @Emmankoko! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please see CONTRIBUTING.md for more information. If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment. Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. |
bab50f7
to
9286c5f
Compare
Okay so I have finally been able to get this PR pass with the CI. |
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.
Thanks for working on this. Just to bear in mind, please try to avoid using 'you' in the spec.
spec/cpp_interface.dd
Outdated
$(P Note that you cannot call C++ Copy constructor using D classes since classes in D are reference types. | ||
you need value semantics to be able to copy so you need to call them using D struct.) |
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.
$(P Note that you cannot call C++ Copy constructor using D classes since classes in D are reference types. | |
you need value semantics to be able to copy so you need to call them using D struct.) | |
$(P Note that the C++ Copy constructor cannot be called using D classes since classes in D are reference types. | |
Value semantics are needed to be able to copy, so use a D struct.) |
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 that's better. Thanks for the correction!
spec/cpp_interface.dd
Outdated
$(P Notice you don't need to call destroy on a struct object to invoke the destructor | ||
since it does stack allocation and its lifetimes ends after leaving the stack.) |
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.
$(P Notice you don't need to call destroy on a struct object to invoke the destructor | |
since it does stack allocation and its lifetimes ends after leaving the stack.) | |
$(P Notice there is no need to call destroy on a struct object to invoke the destructor | |
since it does stack allocation (by default) and its lifetime ends with its declaration scope.) |
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.
Just force pushed the changes! Thanks again for the suggestions.
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.
Thanks!
calling C++ constructors in D are now possible and so must be updated in documentation
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.
Thanks for writing this!
I don't use C++ so I can't verify the info deeply, perhaps @Geod24 can take a quick look?
Okay let me ping him |
CC @TurkeyMan |
calling C++ constructors in D are now possible and so must be updated in documentation
@dkorpel