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

Use std::chrono_literals only #197

Merged
merged 3 commits into from
Dec 17, 2017

Conversation

youtalk
Copy link
Contributor

@youtalk youtalk commented Dec 17, 2017

All examples in rclcpp directory use std::chrono_literals except in publisher_node.cpp.
This PR changes to use 500ms instead of std::chrono::milliseconds(500) using std::chrono_literals such as the other examples.

@@ -12,18 +12,18 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include <chrono>

Copy link
Member

Choose a reason for hiding this comment

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

Since the code is using std::chrono_literals it needs to keep this include.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dirk-thomas Thank you for reviewing. I've reverted it.

Because other cpp files don't also include it, I remove it.

@dirk-thomas dirk-thomas added the in progress Actively being worked on (Kanban column) label Dec 17, 2017
@dirk-thomas
Copy link
Member

Thank you for the patch.

Because other cpp files don't also include it, I remove it.

Everything a source file uses should be explicitly included since the source file can't assume that other header don't change in the future and might remove the transitive dependency.

@dirk-thomas dirk-thomas merged commit 5c635c9 into ros2:master Dec 17, 2017
@dirk-thomas dirk-thomas removed the in progress Actively being worked on (Kanban column) label Dec 17, 2017
@youtalk youtalk deleted the use-chrono-literals-only branch December 17, 2017 13:52
@youtalk
Copy link
Contributor Author

youtalk commented Dec 17, 2017

That sounds good. I'll make another PR to make it.

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