Skip to content

Commit

Permalink
fix: Use correct conversion from JSON to Material (#754)
Browse files Browse the repository at this point in the history
Two lines in MaterialJsonConverter.cpp of Json plugins showed the following compile error:
call of overloaded ‘Material(const value_type&)’ is ambiguous
  • Loading branch information
beomki-yeo committed Mar 23, 2021
1 parent f8c504e commit 34e75e6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Plugins/Json/src/MaterialJsonConverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ void Acts::to_json(nlohmann::json& j, const MaterialSlab& t) {
}

void Acts::from_json(const nlohmann::json& j, MaterialSlab& t) {
Material mat(j.at("material"));
Material mat(j["material"].get<Material>());
t = Acts::MaterialSlab(mat, j.at("thickness").get<float>());
}

Expand Down Expand Up @@ -276,7 +276,7 @@ void Acts::from_json(const nlohmann::json& j, volumeMaterialPointer& material) {
}
if (key == Acts::jsonKey().datakey and not value.empty()) {
for (const auto& bin : value) {
Acts::Material mat(bin);
Acts::Material mat(bin.get<Acts::Material>());
mmat.push_back(mat);
}
}
Expand Down Expand Up @@ -339,4 +339,4 @@ void Acts::from_json(const nlohmann::json& j, volumeMaterialPointer& material) {
bUtility);
return;
}
}
}

0 comments on commit 34e75e6

Please sign in to comment.