You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Conversion to STL map<string, vector<int>> gives error #220
If I understand the problem correctly, std::vector<int> v(j); fails, because a json value can be implicitly converted to a lot of types, including size_type. I am not sure whether we can do anything about this.
Activity
nlohmann commentedon Mar 6, 2016
This could be related to #176.
nlohmann commentedon Mar 6, 2016
I can reproduce the error.
Clang:
GCC:
nlohmann commentedon Mar 6, 2016
json j = {1,2,3,4}; std::vector<int> v(j);yields
This error message is similar to the one of
std::map<std::string, std::vector <int> > v2 = j_map;which is
Note that
json j = {1,2,3,4}; std::vector<int> v(j);fails, whereas
json j = {1,2,3,4}; std::vector<int> v = j;works.
nlohmann commentedon May 9, 2016
If I understand the problem correctly,
std::vector<int> v(j);fails, because ajsonvalue can be implicitly converted to a lot of types, includingsize_type. I am not sure whether we can do anything about this.nlohmann commentedon Jul 31, 2016
It seems that no one has an idea about this.