From 33351e42e44015aafea00a9cb1f25c33793b28aa Mon Sep 17 00:00:00 2001 From: Rasmus Date: Wed, 27 May 2026 11:57:12 +0200 Subject: [PATCH] Add fmt/std.h include to allow formatting of vector MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The codebase is trying to format bool vectors, which used to fail with fmt (https://github.com/fmtlib/fmt/issues/3567) but is supported nowadays, but it requires including this header. Otherwise we get something like this ``` /opt/homebrew/include/fmt/base.h:2310:45: error: implicit instantiation of undefined template 'fmt::detail::type_is_unformattable_for>, char>' 2310 | type_is_unformattable_for _; | ^ /opt/homebrew/include/fmt/base.h:2283:44: note: in instantiation of function template specialization 'fmt::detail::value::value>, 0>' requested here 2283 | FMT_CONSTEXPR20 FMT_INLINE value(T& x) : value(x, custom_tag()) {} | ^ /opt/homebrew/include/fmt/format.h:4349:40: note: in instantiation of function template specialization 'fmt::detail::value::value>, 0>' requested here 4349 | return vformat(fmt.str, vargs{{args...}}); | ^ /Users/rasmus/Downloads/source_builds/glim/include/glim/util/convert_to_string.hpp:15:15: note: in instantiation of function template specialization 'fmt::format> &>' requested here 15 | return fmt::format("{}", value); | ^ /Users/rasmus/Downloads/source_builds/glim/include/glim/util/convert_to_string.hpp:26:12: note: in instantiation of function template specialization 'glim::convert_to_string>>' requested here 26 | sst << convert_to_string(values[i]); | ^ /Users/rasmus/Downloads/source_builds/glim/include/glim/util/config_impl.hpp:152:42: note: in instantiation of function template specialization 'glim::convert_to_string' requested here 152 | spdlog::warn("use default_value={}", convert_to_string(default_value)); | ^ /opt/homebrew/include/fmt/base.h:2150:45: note: template is declared here 2150 | template struct type_is_unformattable_for; … ``` at least on macos with current homebrew fmt and spdlog. --- include/glim/util/convert_to_string.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/glim/util/convert_to_string.hpp b/include/glim/util/convert_to_string.hpp index 1249bf38..d85e4bc2 100644 --- a/include/glim/util/convert_to_string.hpp +++ b/include/glim/util/convert_to_string.hpp @@ -3,6 +3,7 @@ #include #include #include +#include #include #include @@ -54,4 +55,4 @@ inline std::string convert_to_string(const Eigen::Isometry3d& pose) { const Eigen::Quaterniond quat(pose.linear()); return fmt::format("se3({:.6f},{:.6f},{:.6f},{:.6f},{:.6f},{:.6f},{:.6f})", trans.x(), trans.y(), trans.z(), quat.x(), quat.y(), quat.z(), quat.w()); } -} // namespace glim \ No newline at end of file +} // namespace glim