fix(src): updated to compile on gcc and clang

gcc disallows some constexprs that work in clang, these have been removed to that SERiF compiles on gcc and clang
This commit is contained in:
2025-06-17 10:12:07 -04:00
parent 287807cef0
commit 8269c35405
2 changed files with 3 additions and 9 deletions

View File

@@ -357,7 +357,7 @@ namespace serif::composition {
for (const auto& mass_fraction : mass_fractions) {
sum += mass_fraction;
}
for (int i = 0; i < mass_fractions.size(); ++i) {
for (int i = 0; i < static_cast<int>(mass_fractions.size()); ++i) {
mass_fractions[i] /= sum;
}
for (auto& [symbol, entry] : m_compositions) {
@@ -594,10 +594,10 @@ namespace serif::composition {
throw std::runtime_error("Composition has not been finalized (Consider running .finalize()).");
}
CanonicalComposition canonicalComposition;
constexpr std::array<std::string, 7> canonicalH = {
const std::array<std::string, 7> canonicalH = {
"H-1", "H-2", "H-3", "H-4", "H-5", "H-6", "H-7"
};
constexpr std::array<std::string, 8> canonicalHe = {
const std::array<std::string, 8> canonicalHe = {
"He-3", "He-4", "He-5", "He-6", "He-7", "He-8", "He-9", "He-10"
};
for (const auto& symbol : canonicalH) {

View File

@@ -148,12 +148,6 @@ namespace serif::eos {
*/
double specificHeatCapacityAtConstantPressure();
/**
* @brief Returns the format of the EOS data used to generate this output.
* @return The EOSFormat enum value (currently only EOSFormat::HELM).
*/
EOSFormat EOSFormat() const;
friend std::ostream& operator<<(std::ostream& os, const EOSOutput& output) {
os << "EOSOutput:\n"
<< "\tElectron Fraction: " << output.electronFraction << "\n"