Update c++ interop reference page on lifetime handling interoperability#3798
Update c++ interop reference page on lifetime handling interoperability#3798Emmankoko wants to merge 1 commit intodlang:masterfrom
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. |
ntrel
left a comment
There was a problem hiding this comment.
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.
| $(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.
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.
| $(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.
Just force pushed the changes! Thanks again for the suggestions.
calling C++ constructors in D are now possible and so must be updated in documentation
Okay let me ping him |
|
CC @TurkeyMan |
calling C++ constructors in D are now possible and so must be updated in documentation
@dkorpel