From 57147779e4e99a805be3b2b6611e46b9f6321bd8 Mon Sep 17 00:00:00 2001 From: Gregor Jasny Date: Sat, 23 Apr 2016 14:09:34 +0200 Subject: [PATCH] Explicitly call std::stringstream::fail() Implicit cast to bool does not work with C++11 and later. See http://en.cppreference.com/w/cpp/io/basic_ios/operator_bool Signed-off-by: Gregor Jasny --- tools/cpp/src/cpp-build/generate_geocoding_data.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/cpp/src/cpp-build/generate_geocoding_data.cc b/tools/cpp/src/cpp-build/generate_geocoding_data.cc index ef94ef674..79560c779 100644 --- a/tools/cpp/src/cpp-build/generate_geocoding_data.cc +++ b/tools/cpp/src/cpp-build/generate_geocoding_data.cc @@ -141,7 +141,7 @@ bool StrToInt(const string& s, int32* n) { std::stringstream stream; stream << s; stream >> *n; - return stream; + return !stream.fail(); } // Converts integer to string, returns true on success. @@ -149,7 +149,7 @@ bool IntToStr(int32 n, string* s) { std::stringstream stream; stream << n; stream >> *s; - return stream; + return !stream.fail(); } // Parses the prefix descriptions file at path, clears and fills the output