fix build: Don't use libfmt or ranges in win cpp

I can't deal with this anymore. My build is suddenly broken on Windows
(for spark_crypto.prod branch). I assume they updated the compiler
in a way that isn't backwards compatible. Thanks Windows.
This commit is contained in:
John Colvin committed 2023-07-05 11:58:14 -04:00
1 parent 15b1d55ef1
commit 3c97f2552b
3 files changed
+30 -42

No files matched your search

+8 -6
View File
@@ -1,15 +1,17 @@
#include "QueryParams.h"
#include <fmt/format.h>
#include <range/v3/view.hpp>
namespace bts::io {
std::string QueryParams::to_string() const {
std::string rv;
auto query_param_strs = ranges::transform_view(
*this, [](const auto &qp) { return qp.first + "=" + qp.second; });
rv.append(fmt::format(
"{}", fmt::join(query_param_strs.begin(), query_param_strs.end(), "&")));
auto it = begin();
if (it == end()) {
return "";
}
rv.append(it->first + "=" + it->second);
while (++it != end()) {
rv.append("&" + it->first + "=" + it->second);
}
return rv;
}