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
I am trying to parse a JSON Array of values to a global declared vector.
For some reason, it does not properly parsed it to an actually declared vector, but it does to a newly inline created vector.
./source/main.cpp: In function ‘int main(int, char**)’:
../source/main.cpp:116:19: error: ambiguous overload for ‘operator=’ (operand types are ‘std::vector<std::__cxx11::basic_string<char> >’ and ‘nlohmann::basic_json<>::value_type {aka nlohmann::basic_json<>}’)
UserList = ConfigurationJSON["Program"]["UserList"];
In case your type contains several operator= definitions, code like your_variable = your_json; may not compile. You need to write your_variable = your_json.get<decltype your_variable>(); instead.
I am trying to parse a JSON Array of values to a global declared vector.
For some reason, it does not properly parsed it to an actually declared vector, but it does to a newly inline created vector.
This does NOT work...
The console returns this
While both this...
and this...
do work.
The text was updated successfully, but these errors were encountered: