From ebf95aab40ddf584f0945247d3c65013e7b81975 Mon Sep 17 00:00:00 2001 From: Rainer Kartmann <rainer.kartmann@kit.edu> Date: Mon, 6 Apr 2020 11:57:41 +0200 Subject: [PATCH] Cast at the right place --- SimoxUtility/meta/EnumNames.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SimoxUtility/meta/EnumNames.hpp b/SimoxUtility/meta/EnumNames.hpp index dd3c65e53..893aa529e 100644 --- a/SimoxUtility/meta/EnumNames.hpp +++ b/SimoxUtility/meta/EnumNames.hpp @@ -129,7 +129,7 @@ namespace simox::meta template <typename E, typename N> UnknownEnumValue(E value, const EnumNames<E, N>& names) : - std::out_of_range(make_msg(value, names, "value")) + std::out_of_range(make_msg(int(value), names, "value")) {} template <typename E, typename N> @@ -142,7 +142,7 @@ namespace simox::meta static std::string make_msg(const Key& value, const EnumNames<E, N>& names, const std::string& what) { std::stringstream ss; - ss << "Unknown enum " << what << " '" << int(value) << "'" + ss << "Unknown enum " << what << " '" << value << "'" << " of type '" << simox::meta::get_type_name<E>() << "'." << "\n" << names; return ss.str(); -- GitLab