Skip to content

cast: Ensure that pointers do not use rvalue / move overload #28

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

Merged

Conversation

m-chaturvedi
Copy link

@m-chaturvedi m-chaturvedi commented May 8, 2019

@EricCousineau-TRI
Copy link
Collaborator

Thanks!
But it looks like the Travis CI bit needs updating; I'll submit a PR to bump to master to incorporate this:
pybind#1744

@EricCousineau-TRI
Copy link
Collaborator

Submitted PR; updated this overview to indicate that it's a prerequisite.

@m-chaturvedi m-chaturvedi force-pushed the drake_drake_fix_cast branch 2 times, most recently from e4cb38c to a99f997 Compare May 9, 2019 14:52
Copy link
Collaborator

@EricCousineau-TRI EricCousineau-TRI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 1 files at r1.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @m-chaturvedi)

a discussion (no related file):
In the downstream Drake PR, I'm still confused as to why we need py_reference when returning T* from a cpp_function.

Might you be able to add a unittest here in pybind11 that tests returning / casting T* for a class with holder type unique_ptr, and a type that is non-copyable and non-moveable?

(Let me know if you'd like help on this part)


@EricCousineau-TRI
Copy link
Collaborator

a discussion (no related file):

Previously, EricCousineau-TRI (Eric Cousineau) wrote…

In the downstream Drake PR, I'm still confused as to why we need py_reference when returning T* from a cpp_function.

Might you be able to add a unittest here in pybind11 that tests returning / casting T* for a class with holder type unique_ptr, and a type that is non-copyable and non-moveable?

(Let me know if you'd like help on this part)

(And, uh, you may have already mentioned the reason beforehand... It's still fuzzy in my mind when reviewing the code / convos...)


@m-chaturvedi m-chaturvedi force-pushed the drake_drake_fix_cast branch 3 times, most recently from 9729855 to de49686 Compare May 13, 2019 15:53
@EricCousineau-TRI EricCousineau-TRI changed the title Fix cast cast: Ensure that pointers do not use rvalue / move overload May 13, 2019
Copy link
Collaborator

@EricCousineau-TRI EricCousineau-TRI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 2 of 2 files at r2.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @m-chaturvedi)

a discussion (no related file):
Made some suggested changes: m-chaturvedi#1

Are you OK with these?


Copy link
Collaborator

@EricCousineau-TRI EricCousineau-TRI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @m-chaturvedi)

a discussion (no related file):

Previously, EricCousineau-TRI (Eric Cousineau) wrote…

(And, uh, you may have already mentioned the reason beforehand... It's still fuzzy in my mind when reviewing the code / convos...)

OK I tried out an non-moveable and non-copyable type, same code paths. Thanks for your patience!


Copy link
Collaborator

@EricCousineau-TRI EricCousineau-TRI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm: pending remaining nits in meta-PR mentioned below

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @m-chaturvedi)

@m-chaturvedi
Copy link
Author

m-chaturvedi commented May 17, 2019

I apologize for not figuring this out before, but it looks like Pybind11 seems to provide some classes for testing. We could forgo some of our code. I tried to implement your comments in this:
m-chaturvedi@b893bd3
Let me know if this is acceptable.

Copy link
Collaborator

@EricCousineau-TRI EricCousineau-TRI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those look good! Can you push them here?

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @m-chaturvedi)

@m-chaturvedi m-chaturvedi force-pushed the drake_drake_fix_cast branch from de49686 to b893bd3 Compare May 17, 2019 17:24
@m-chaturvedi
Copy link
Author

a discussion (no related file):

Previously, EricCousineau-TRI (Eric Cousineau) wrote…

Made some suggested changes: m-chaturvedi#1

Are you OK with these?

Added the comments, the issue link and changed the message in the new commit.


Copy link
Author

@m-chaturvedi m-chaturvedi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Reviewable status: 2 of 3 files reviewed, 1 unresolved discussion (waiting on @EricCousineau-TRI)

Copy link
Collaborator

@EricCousineau-TRI EricCousineau-TRI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Sorry for the delay!

Reviewed 1 of 1 files at r3.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

@EricCousineau-TRI EricCousineau-TRI merged commit 96ea0fa into RobotLocomotion:drake May 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants