Closed
Description
I'm trying to read into a vector, but run into the following problem:
#include <vector>
#include <json.hpp>
void from_json(const nlohmann::json &j, std::vector<int> &v) { /* something */ }
int main() {
nlohmann::json j;
std::vector<int> v1 = j; // compiles
std::vector<int> v2;
v2 = j; // does not compile
}
Implementing as adl_serializer
does not seem to work. Any help is greatly appreciated!