Skip to content
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

type trait rcpputils::is_pointer<T>` #19

Merged
merged 2 commits into from
Aug 26, 2019
Merged

Conversation

Karsten1987
Copy link
Contributor

Moving the PR ros2/rclcpp#817 over to rcpputils.

I hopefully addressed previous feedback about adding documentation to it. Please let me know if the documentation is sufficient or if more details should be provided.

Signed-off-by: Karsten Knese karsten@openrobotics.org

Signed-off-by: Karsten Knese <karsten@openrobotics.org>
@Karsten1987 Karsten1987 requested a review from a team as a code owner August 26, 2019 02:57
@Karsten1987 Karsten1987 self-assigned this Aug 26, 2019
Copy link
Contributor

@emersonknapp emersonknapp left a comment

Choose a reason for hiding this comment

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

This looks good to me! Thanks for the updates

Copy link

@prajakta-gokhale prajakta-gokhale left a comment

Choose a reason for hiding this comment

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

Looks good to me too! Let's merge after green CI.

@Karsten1987
Copy link
Contributor Author

CI:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

#include "rcpputils/pointer_traits.hpp"

TEST(TestPointerTraits, is_pointer) {
auto ptr = new int(13);

Choose a reason for hiding this comment

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

Should delete this at the end of the test.

Choose a reason for hiding this comment

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

Sorry noticed this after approving and green CI, and we don't run ASan/TSan jobs in CI so this won't get flagged in that either.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No worries, you're absolutely right!
Addressed in 49c52d8


TEST(TestPointerTraits, is_pointer) {
auto ptr = new int(13);
const auto * const cptrc = new int(13);
Copy link
Contributor

Choose a reason for hiding this comment

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

this one is also new allocated

Copy link
Contributor Author

@Karsten1987 Karsten1987 Aug 26, 2019

Choose a reason for hiding this comment

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

true, but this was passed into a shared pointer object and thus deallocated

To stay consistent, I've also addressed this in 49c52d8

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, you're right! Thanks for making it more obvious though :)

Signed-off-by: Karsten Knese <karsten@openrobotics.org>
@Karsten1987
Copy link
Contributor Author

new round of CI:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@emersonknapp
Copy link
Contributor

OSX failed with a network error, restarted to see if it was just a hiccup

Build Status

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.

3 participants