Replace std::to_string with std::stringstream

The GCC 4.4.7 implementation of std::to_string only has overloads for long
long int, long long unsigned int and long double. It's better to use
std::stringstream with this version of GCC to avoid having to write custom
code.
This commit is contained in:
Markus Mäkelä 2018-04-09 22:35:40 +03:00
parent 7f06c02f89
commit 434a71bc4d
No known key found for this signature in database
GPG Key ID: 72D48FCE664F7B19

View File

@ -14,6 +14,7 @@
#include "gtid.hh"
#include <algorithm>
#include <sstream>
#include "utilities.hh"
using std::string;
@ -210,13 +211,12 @@ bool Gtid::eq(const Gtid& rhs) const
string Gtid::to_string() const
{
string rval;
std::stringstream ss;
if (m_server_id != SERVER_ID_UNKNOWN)
{
rval += std::to_string(m_domain) + "-" + std::to_string(m_server_id) + "-" +
std::to_string(m_sequence);
ss << m_domain << "-" << m_server_id << "-" << m_sequence;
}
return rval;
return ss.str();
}
Gtid GtidList::get_gtid(uint32_t domain) const