Skip to content

Commit

Permalink
Fix MSVC errors with ambiguous assignment
Browse files Browse the repository at this point in the history
Thanks to nlohmann/json#1061

Signed-off-by: Geoff Hutchison <geoff.hutchison@gmail.com>
  • Loading branch information
ghutchis committed Apr 18, 2020
1 parent cc295cf commit cd5a7f0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions avogadro/quantumio/nwchemjson.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ bool NWChemJson::read(std::istream& file, Molecule& molecule)
}
}
if (calcSetup.count("waveFunctionTheory")) {
theory = calcSetup["waveFunctionTheory"];
theory = calcSetup["waveFunctionTheory"].get<std::string>();
if (theory == "Density Functional Theory") {
theory = "dft";
}
Expand Down Expand Up @@ -198,9 +198,9 @@ bool NWChemJson::read(std::istream& file, Molecule& molecule)

string elementType;
if (currentFunction.count("elementLabel"))
elementType = currentFunction["elementLabel"];
elementType = currentFunction["elementLabel"].get<std::string>();
else if (currentFunction.count("elementType"))
elementType = currentFunction["elementType"];
elementType = currentFunction["elementType"].get<std::string>();

if (elementType == symbol)
break;
Expand All @@ -213,7 +213,7 @@ bool NWChemJson::read(std::istream& file, Molecule& molecule)

if (currentFunction.count("basisSetName")) {
if (basisSetName.empty()) {
basisSetName = currentFunction["basisSetName"];
basisSetName = currentFunction["basisSetName"].get<std::string>();
} else if (basisSetName != currentFunction["basisSetName"]) {
basisSetName = "Custom";
}
Expand All @@ -226,9 +226,9 @@ bool NWChemJson::read(std::istream& file, Molecule& molecule)
json contractionShell = contraction[j];
string shellType;
if (contractionShell.count("basisSetShell"))
shellType = contractionShell["basisSetShell"];
shellType = contractionShell["basisSetShell"].get<std::string>();
else if (contractionShell.count("basisSetShellType"))
shellType = contractionShell["basisSetShellType"];
shellType = contractionShell["basisSetShellType"].get<std::string>();
json exponent = contractionShell.value("basisSetExponent", json());
json coefficient =
contractionShell.value("basisSetCoefficient", json());
Expand Down

0 comments on commit cd5a7f0

Please sign in to comment.