Shuffling code in test_smart_ptr.cpp to separate struct/class definitions from bindings code. #2875
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.
smart_holder
branch, to minimize diffs and the potential for merge conflicts.TEST_MODULE
moved to the anonymousnamespace
. This isn't strictly necessary for thesmart_holder
work, but best practice. AllPYBIND11_DECLARE_HOLDER_TYPE
were grouped together right after the anonymousnamespace
(to not have to close-reopen thenamespace
N times).std::unique_ptr
is explicitly specified as holder (see diff below). On currentmaster
this is redundant, becausestd::unique_ptr
is the default holder, but it enables testing against thesmart_holder
branch with-DPYBIND11_USE_SMART_HOLDER_AS_DEFAULT
.namespace
and inTEST_MODULE
. See diff below.Changelog not needed.
Simple proof that nothing got lost:
The full output from the
diff
command above: