Replaced for-loop with std::transform.
the build was successful Details

This commit is contained in:
tastytea 2019-03-30 22:24:15 +01:00
parent 57ec1fd23a
commit ff0bd7b906
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
1 changed files with 9 additions and 5 deletions

View File

@ -20,11 +20,13 @@
#include <codecvt> #include <codecvt>
#include <utility> #include <utility>
#include <iostream> #include <iostream>
#include <algorithm>
#include "version.hpp" #include "version.hpp"
#include "debug.hpp" #include "debug.hpp"
#include "mastodon-cpp.hpp" #include "mastodon-cpp.hpp"
using namespace Mastodon; using namespace Mastodon;
return_base::operator bool() return_base::operator bool()
{ {
if (error_code == 0) if (error_code == 0)
@ -166,11 +168,13 @@ const curlpp::Forms API::maptoformdata(const parametermap &map)
} }
else else
{ {
for (const string &str : it.second) std::transform(it.second.begin(), it.second.end(),
{ std::back_inserter(formdata),
formdata.push_back( [&it](const string &s)
new curlpp::FormParts::Content(it.first + "[]", str)); {
} return new curlpp::FormParts::Content
(it.first + "[]", s);
});
} }
} }