Closed matthew-reynolds closed 5 years ago
Travis failing on clang format
Updated - Apologies for slow turnaround.
Because pragma once is not standard, should we keep the include guards just in case? Supposedly g++ does the same optimization when include guards are detected.
You're right, these days most compilers (At least GCC) are smart enough to perform the same optimizations with include guards and pragma once.
Pragma once is supported by every worthwhile compiler and is easier to maintain, I would prefer to keep it unless there are compelling arguments otherwise. The biggest one people point out is that including the same file from different relative paths can cause issues in some cases, but that isn't really a concern the way Catkin does things - We always #include <package_name/header.h>
rather than using relative paths.
(Also I'm pretty sure a lot of ROS pkgs use #pragma once
so if we're worried about portability I think we're toast anyways.)
Pull Request
Now that we're on Melodic, the default C++ standard is C++14, rather than C++03 in Kinetic. This PR just updates a few small things to bring the packages up to modern C++.
(I know
#pragma once
isn't standard and isn't part of C++11 or 14, but it's pretty fair to lump it with modern C++)Contribution Checklist
Change Checklist