OctoMap / octomap

An Efficient Probabilistic 3D Mapping Framework Based on Octrees. Contains the main OctoMap library, the viewer octovis, and dynamicEDT3D.
http://octomap.github.io
1.94k stars 657 forks source link

always enable C++11 #416

Closed toge closed 6 months ago

toge commented 6 months ago

I met compilation error octomap/1.10.0 on gcc 5.4.

compilation error ``` In file included from ./octomap/include/octomap/OcTreeBaseImpl.h:83:0, from ./octomap/include/octomap/OccupancyOcTreeBase.h:44, from ./octomap/include/octomap/OcTreeStamped.h:39, from ./octomap/src/OcTreeStamped.cpp:34: ./octomap/include/octomap/OcTreeIterator.hxx:45:13: error: expected nested-name-specifier before ‘iterator_category’ using iterator_category = std::forward_iterator_tag; ^ ./octomap/include/octomap/OcTreeIterator.hxx:46:13: error: expected nested-name-specifier before ‘value_type’ using value_type = NodeType; ^ ./octomap/include/octomap/OcTreeIterator.hxx:47:13: error: expected nested-name-specifier before ‘difference_type’ using difference_type = NodeType; ^ ./octomap/include/octomap/OcTreeIterator.hxx:48:13: error: expected nested-name-specifier before ‘pointer’ using pointer = NodeType*; ^ ./octomap/include/octomap/OcTreeIterator.hxx:49:13: error: expected nested-name-specifier before ‘reference’ using reference = NodeType&; ^ In file included from ./octomap/include/octomap/OcTreeBaseImpl.h:83:0, from ./octomap/include/octomap/OccupancyOcTreeBase.h:44, from ./octomap/include/octomap/OcTree.h:38, from ./octomap/src/OcTree.cpp:34: ./octomap/include/octomap/OcTreeIterator.hxx:45:13: error: expected nested-name-specifier before ‘iterator_category’ using iterator_category = std::forward_iterator_tag; ^ ./octomap/include/octomap/OcTreeIterator.hxx:46:13: error: expected nested-name-specifier before ‘value_type’ using value_type = NodeType; ^ ./octomap/include/octomap/OcTreeIterator.hxx:47:13: error: expected nested-name-specifier before ‘difference_type’ using difference_type = NodeType; ^ ./octomap/include/octomap/OcTreeIterator.hxx:48:13: error: expected nested-name-specifier before ‘pointer’ using pointer = NodeType*; ^ ./octomap/include/octomap/OcTreeIterator.hxx:49:13: error: expected nested-name-specifier before ‘reference’ using reference = NodeType&; ^ ```

It seems to be caused by using type alias. type alias has been introduced C++11. ref

This PR ensures that C++11 is always used on CMakeLists.txt.

toge commented 6 months ago

Thanks!