From c73c7bef552ea20e6f18293be61bb219ca8febb9 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Wed, 19 Feb 2020 11:15:54 +0100 Subject: [PATCH] avoid use of boost::lexical_cast --- opm/simulators/flow/MissingFeatures.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/opm/simulators/flow/MissingFeatures.cpp b/opm/simulators/flow/MissingFeatures.cpp index fcbfd2320..b5af4d1ed 100644 --- a/opm/simulators/flow/MissingFeatures.cpp +++ b/opm/simulators/flow/MissingFeatures.cpp @@ -32,7 +32,7 @@ #include #include #include -#include +#include namespace Opm { @@ -58,7 +58,13 @@ namespace MissingFeatures { const auto& record = keyword.getRecord(0); if (record.getItem(it->second.item).template get(0) != it->second.item_value) { const auto& location = keyword.location(); - std::string msg = "For keyword '" + it->first + "' only value " + boost::lexical_cast(it->second.item_value) + std::string val; + if constexpr (std::is_arithmetic::value) + val = std::to_string(it->second.item_value); + else + val = it->second.item_value; + + std::string msg = "For keyword '" + it->first + "' only value " + val + " in item " + it->second.item + " is supported by flow.\n" + "In file " + location.filename + ", line " + std::to_string(location.lineno) + "\n"; parseContext.handleError(ParseContext::SIMULATOR_KEYWORD_ITEM_NOT_SUPPORTED, msg, errorGuard);