From d9a28567bff7ad22929a6eca6af2a6e491c28571 Mon Sep 17 00:00:00 2001 From: Kei Okada Date: Sat, 15 Feb 2025 13:32:31 +0900 Subject: [PATCH] apply furuta's patch (#146) only when BOOST_VERSION >= 108300 --- src/nodelet/face_recognition_nodelet.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/nodelet/face_recognition_nodelet.cpp b/src/nodelet/face_recognition_nodelet.cpp index f3d82c1..449ae3a 100644 --- a/src/nodelet/face_recognition_nodelet.cpp +++ b/src/nodelet/face_recognition_nodelet.cpp @@ -89,13 +89,27 @@ namespace filesystem3 namespace filesystem { #endif +#if BOOST_VERSION < 108300 +template <> +path& path::append(typename path::iterator lhs, typename path::iterator rhs, + const codecvt_type& cvt) +{ + for (; lhs != rhs; ++lhs) + *this /= *lhs; + return *this; +} +#endif path user_expanded_path(const path& p) { +#if BOOST_VERSION < 108300 + path::const_iterator it(p.begin()); +#else if (p.size() < 2) return p; auto it = p.begin(); // Replace the tilda with the home directory +#endif std::string user_dir = (*it).string(); if (user_dir.length() == 0 || user_dir[0] != '~') return p; @@ -120,12 +134,16 @@ path user_expanded_path(const path& p) // Append the rest of path ret = path(std::string(homedir)); +#if BOOST_VERSION < 108300 + return ret.append(++it, p.end(), path::codecvt()); +#else ++it; for (; it != p.end(); ++it) { ret /= *it; } return ret; +#endif } } // namespace filesystem } // namespace boost