Hello
I notice that when trying something like:
cpr::Response r = cpr::Get(cpr::Url{u}, cpr::Parameters{p});
Where p is a map (function argument), for example a std::map, that can contain 0, 1, or multiple key-value parameters, then it shows an error:
"""
'': cannot convert from 'initializer list' to 'cpr::Parameters'
…
"""
Current way to work this
For now the way to work has been explicitly converting the map to a cpr::Parameters, which requires an extra step, for example:
// …
cpr::Parameters p_cpr{};
for (const auto& [k, v] : p) {
p_cpr.Add({k, v});
}
cpr::Response r = cpr::Get(cpr::Url{u}, cpr::Parameters{p_cpr});
// ...
Is there any way to work this kind of cases with c++ applicable elements (in this case a std::map)? just as an url can come from a std::string variable?