Replies: 2 comments 3 replies
-
It's better to use explicit get rather than implicit conversions.
We recommend you do this to disable them:
|
Beta Was this translation helpful? Give feedback.
2 replies
-
class TaskRsrc {
public:
vector<float> units_rng;
TaskRsrc(json data) {
this->units_rng = data["units_rng"].get<vector<float>>();
}
};
class Task {
public:
map<string, TaskRsrc> rsrcs;
Task(json data) {
for (auto const& [k, v] : data["rsrcs"].get<map<string, json>>()) {
this->rsrcs.insert({k, TaskRsrc(v)});
}
}
}; |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
"More than one operator = matches these operands" error
, how can i fix this?Beta Was this translation helpful? Give feedback.
All reactions