1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-06-16 14:20:56 +03:00

C++20 fixes

This commit is contained in:
Leonid Fedorov
2022-02-01 15:54:05 +00:00
parent 0ee5203262
commit 65252df4f6
36 changed files with 22433 additions and 310 deletions

View File

@ -29,7 +29,7 @@
#include <fstream>
using namespace std;
#include <boost/format.hpp>
#include <boost/tokenizer.hpp>
#include <boost/thread.hpp>
using namespace boost;
@ -41,6 +41,7 @@ using namespace config;
#include "installdir.h"
#include "format.h"
namespace
{
boost::mutex mx;
@ -143,43 +144,7 @@ void Message::Args::reset()
void Message::format(const Args& args)
{
Args::AnyVec::const_iterator iter = args.args().begin();
Args::AnyVec::const_iterator end = args.args().end();
boost::format fmt(fMsg);
fmt.exceptions(boost::io::no_error_bits);
while (iter != end)
{
if (iter->type() == typeid(long))
{
long l = any_cast<long>(*iter);
fmt % l;
}
else if (iter->type() == typeid(uint64_t))
{
uint64_t u64 = any_cast<uint64_t>(*iter);
fmt % u64;
}
else if (iter->type() == typeid(double))
{
double d = any_cast<double>(*iter);
fmt % d;
}
else if (iter->type() == typeid(string))
{
string s = any_cast<string>(*iter);
fmt % s;
}
else
{
throw logic_error("Message::format: unexpected type in argslist");
}
++iter;
}
fMsg = fmt.str();
formatMany(fMsg, args.args());
}
/* static */