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