From 703b790939f8c65bce01f5bde91b382c9ad48a2e Mon Sep 17 00:00:00 2001 From: Alex Ames Date: Thu, 24 Sep 2015 14:19:32 -0700 Subject: [PATCH] Removed call to pop_back on std::string. The pop_back function was added to strings in C++11 and it appears not all compilers we target support it. The call to pop_back has been replaced with a call to erase. Tested on Linux. All unit tests pass. --- include/flatbuffers/util.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/flatbuffers/util.h b/include/flatbuffers/util.h index d34850b16..b9d1f74ec 100644 --- a/include/flatbuffers/util.h +++ b/include/flatbuffers/util.h @@ -68,7 +68,8 @@ template<> inline std::string NumToString(double t) { auto p = s.find_last_not_of('0'); if (p != std::string::npos) { s.resize(p + 1); // Strip trailing zeroes. - if (s.back() == '.') s.pop_back(); // Strip '.' if a whole number. + if (s.back() == '.') + s.erase(s.size() - 1, 1); // Strip '.' if a whole number. } return s; }