-
Notifications
You must be signed in to change notification settings - Fork 429
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
move user-defined literals in their own namespace #284
Conversation
Cool, thanks! I added the I'll start some CI for you shortly. |
Apparently one of our linters (
I'd vote for the last, since it's unlikely to result in needing multiple lines in the examples and avoids doing nasty things like disabling linter warnings. I would prefer to merge this contribution in some form, even if we're thinking about converting to the chrono literals with C++14. |
@Sarcasm note that if you're interested in reproducing these linter errors, you can just run |
Arf, I passed the linters on rclcpp itself but not on the other changes. I agree it's sad to disable the warning globally. using rclcpp::literals::operator ""_ms;
void f() {
spin_some(30_ms);
} VS void f() {
spin_some(std::chrono::milliseconds(30));
} What do you think of whitelisting |
Seeing as we'll need a similar |
@Sarcasm a no lint comment would be ok for me, since I think it will be temporary because we're going to probably do the switch to C++14 soon. We may or may not have need of the "using namespace .*literals;" exclusion in |
Ok, I can do that. |
Up to you, worst case we decline the cpplint pr. |
I updated all the PRs with no lint comments. And the cpplint proposal is here: |
I would still avoid Imo the I also think that we should avoid adding further patches into our cpplint fork. I would rather aim to use upstream at some point in the future and this detaches us even further. |
I do not believe that was suggested here. Except in the intermediate commit which restored existing behavior. That was removed in the last commit.
I agree that the http://en.cppreference.com/w/cpp/language/user_literal
So in this very narrow case, I think it's ok to use the
I agree with that. The correct thing to do would be to propose an upstream patch which gives us the option to ignore this linter error if we don't agree with it in every case, or a way to configure cpplint.py to allow the exact line |
Even the cppreference website's documentation suggests that you use the http://en.cppreference.com/w/cpp/chrono/operator%22%22h
Though they do limit the scope of the |
You are totally right I can fix my cpplint.py PR to disable the additional checks in headers but if your goal is to use upstream at one point, I think it's best to close the PR. Maybe I can propose upstream. I checked the code a bit more.
For the examples and demos, I think the best is to keep them as simple as possible meaning the NOLINT comment would be better avoided and (personal opinion here) the using directive should also be avoided. For system_tests, the NOLINT comment seems reasonable. Regarding the scope of the using namespace, I can refine the scope but I think in system_tests it will look better for the whole file. |
For the record, Google would not accept the upstream change:
|
The examples have been migrated to the new namespace.
_ms returned nanoseconds instead of milliseconds. A few return types where using integral return type for floating point literals.
I had to rebase this one to fix the CI. |
I'm going to merge these because they are blocking the other prs and the changes are relatively straightforward. If anyone has some issues or comments I can address them in a follow up pr. |
@wjwwood This broke the packaging job / |
@dirk-thomas sorry about that, fix is in: ros2/ros1_bridge#52 |
👍 |
* Clock has multiple time jump callbacks Replaces pre_update and post_update Adds callbacks when ROS time is activated or deactivated Add rcl_clock_change_t, rcl_time_jump_t, rcl_jump_threshold_t Add rcl_clock_add_jump_callback() Add rcl_clock_remove_jump_callback() * Fini generic clock after confirming correct clock type * test_time no ASAN detections
* Close storage before compression * Only compress if the bag file exists and has content Signed-off-by: Anas Abou Allaban <allabana@amazon.com> Signed-off-by: Zachary Michaels <zmichaels11@gmail.com>
Following the discussion from #282 (comment)
There are 3 commits:
The tests and examples will come in separate pull requests.
Connects to #282