[android] Fixed compilation on gcc 4.6

This commit is contained in:
Alex Zolotarev 2014-01-28 14:29:31 +03:00 committed by Alex Zolotarev
parent d9d52789c1
commit 2c940c20ad
3 changed files with 24 additions and 18 deletions

View file

@ -81,3 +81,25 @@ bool StringUtf8Multilang::GetString(int8_t lang, string & utf8s) const
return false;
}
namespace
{
struct Printer
{
string & m_out;
Printer(string & out) : m_out(out) {}
bool operator()(int8_t code, string const & name) const
{
m_out += string(StringUtf8Multilang::GetLangByCode(code)) + string(":") + name + " ";
return true;
}
};
} // namespace
string DebugPrint(StringUtf8Multilang const & s)
{
string out;
Printer printer(out);
s.ForEachRef(printer);
return out;
}

View file

@ -92,20 +92,4 @@ public:
}
};
string DebugPrint(StringUtf8Multilang const & s)
{
string out;
struct Printer
{
string & m_out;
Printer(string & out) : m_out(out) {}
bool operator()(int8_t code, string const & name) const
{
m_out += string(StringUtf8Multilang::GetLangByCode(code)) + string(":") + name + " ";
return true;
}
} printer(out);
s.ForEachRef(printer);
return out;
}
string DebugPrint(StringUtf8Multilang const & s);

View file

@ -73,7 +73,7 @@ public:
}
};
string DebugPrint(StringNumericOptimal const & s)
inline string DebugPrint(StringNumericOptimal const & s)
{
return s.Get();
}