Closed
Description
this worked in v2.1.1, but no longer works in v3.9.1:
int main() {
std::vector<std::byte> rg;
nlohmann::json::parse({rg.begin(), rg.end()});
}
include/nlohmann/nlohmann/json.hpp:5164:40: error: no matching function for call to ‘nlohmann::detail::iterator_input_adapter<const char*>::iterator_input_adapter(nlohmann::detail::iterator_input_adapter_factory<__gnu_cxx::__normal_iterator<std::byte*, std::vector<std::byte> >, void>::adapter_type)’
5164 | : ia(input_adapter(first, last)) {}
i tried just passing the iterators directly:
int main() {
std::vector<std::byte> rg;
nlohmann::json::parse(rg.begin(), rg.end());
}
but this gives a bunch of these:
include/nlohmann/nlohmann/json.hpp:7423:59: error: cannot convert ‘char’ to ‘std::byte’ in initialization
7423 | std::array<char_type, 4> true_literal = {{'t', 'r', 'u', 'e'}};
| ^~~
| |
| char