From ea9d7073b9707958d0db28bebd78dc8c69c6e27a Mon Sep 17 00:00:00 2001 From: Bjar Ne Date: Fri, 17 Apr 2020 13:42:32 +0200 Subject: [PATCH] fix ifstream >> byte with c++17 std::byte can't be read from a file (no overload of operator >> available), fall back to typedef'fing it to unsigned char again. Related: #240 --- octomap/src/binvox2bt.cpp | 8 ++++---- octomap/src/edit_octree.cpp | 3 --- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/octomap/src/binvox2bt.cpp b/octomap/src/binvox2bt.cpp index 1e6358f8..74ad151a 100644 --- a/octomap/src/binvox2bt.cpp +++ b/octomap/src/binvox2bt.cpp @@ -56,9 +56,9 @@ using namespace std; using namespace octomap; -#if __cplusplus < 201500L +namespace octomap { typedef unsigned char byte; -#endif +} int main(int argc, char **argv) { @@ -229,8 +229,8 @@ int main(int argc, char **argv) cout.flush(); // read voxel data - byte value; - byte count; + octomap::byte value; + octomap::byte count; int index = 0; int end_index = 0; unsigned nr_voxels = 0; diff --git a/octomap/src/edit_octree.cpp b/octomap/src/edit_octree.cpp index cedadd64..77cc3b23 100644 --- a/octomap/src/edit_octree.cpp +++ b/octomap/src/edit_octree.cpp @@ -41,9 +41,6 @@ using namespace std; using namespace octomap; -#if __cplusplus < 201500L - typedef unsigned char byte; -#endif int main(int argc, char **argv) {