diff --git a/Util/scripts/write_probdata.py b/Util/scripts/write_probdata.py index 68cb716aac..2cd7cdd398 100755 --- a/Util/scripts/write_probdata.py +++ b/Util/scripts/write_probdata.py @@ -237,8 +237,8 @@ def write_probin(prob_param_files, cxx_prefix): size = p.size if (size == "nspec"): size = "NumSpec" - fout.write(f" for (int n = 0; n < {size}; n++) {{\n") - fout.write(f" problem::{p.name}[n] = {p.default_format(lang='C++')};\n") + fout.write(f" for (auto & e : problem::{p.name}) {{\n") + fout.write(f" e = {p.default_format(lang='C++')};\n") fout.write(f" }}\n") else: fout.write(f" {p.get_default_string()}")