From 99027fdd1531d634ca53af83e9e006df331ad9f5 Mon Sep 17 00:00:00 2001 From: lewisgross1296 Date: Wed, 10 Aug 2022 17:35:30 -0500 Subject: [PATCH] erase needs an iterator, so feed it model::tallies.begin()+index --- src/tallies/tally.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tallies/tally.cpp b/src/tallies/tally.cpp index f5edf75b2f..0df00bbe76 100644 --- a/src/tallies/tally.cpp +++ b/src/tallies/tally.cpp @@ -1277,9 +1277,9 @@ extern "C" size_t tallies_size() extern "C" void openmc_remove_tally_from_tallies(int32_t id) { // query map for index corersponding to the given id - int index = model::tally_map[id]; - // delete the tally - model::tallies.erase(index); + int32_t index = model::tally_map[id]; + // delete the tally via iterator pointing to correct position + model::tallies.erase(model::tallies.begin() + index); } } // namespace openmc