Browse Source

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 <gjasny@googlemail.com>
pull/1091/head
Gregor Jasny 10 years ago
parent
commit
57147779e4
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      tools/cpp/src/cpp-build/generate_geocoding_data.cc

+ 2
- 2
tools/cpp/src/cpp-build/generate_geocoding_data.cc View File

@ -141,7 +141,7 @@ bool StrToInt(const string& s, int32* n) {
std::stringstream stream; std::stringstream stream;
stream << s; stream << s;
stream >> *n; stream >> *n;
return stream;
return !stream.fail();
} }
// Converts integer to string, returns true on success. // Converts integer to string, returns true on success.
@ -149,7 +149,7 @@ bool IntToStr(int32 n, string* s) {
std::stringstream stream; std::stringstream stream;
stream << n; stream << n;
stream >> *s; stream >> *s;
return stream;
return !stream.fail();
} }
// Parses the prefix descriptions file at path, clears and fills the output // Parses the prefix descriptions file at path, clears and fills the output


Loading…
Cancel
Save