From d9a135f2344f626db5d898569efb831f4d4416fc Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Fri, 28 Feb 2020 10:50:10 -0600 Subject: [PATCH] Change initialization order instead of declaration order for FilterBinIter. --- include/openmc/tallies/tally_scoring.h | 13 +++++-------- src/tallies/tally_scoring.cpp | 4 ++-- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/include/openmc/tallies/tally_scoring.h b/include/openmc/tallies/tally_scoring.h index 0a76025db..224a9ef14 100644 --- a/include/openmc/tallies/tally_scoring.h +++ b/include/openmc/tallies/tally_scoring.h @@ -39,18 +39,15 @@ public: FilterBinIter& operator++(); + int index_ {1}; + double weight_ {1.}; + + std::vector& filter_matches_; + private: void compute_index_weight(); - // Data members const Tally& tally_; - -public: - - int index_ {1}; - double weight_ {1.}; - - std::vector& filter_matches_; }; //============================================================================== diff --git a/src/tallies/tally_scoring.cpp b/src/tallies/tally_scoring.cpp index 81f6c504e..e0cd5d095 100644 --- a/src/tallies/tally_scoring.cpp +++ b/src/tallies/tally_scoring.cpp @@ -27,7 +27,7 @@ namespace openmc { //============================================================================== FilterBinIter::FilterBinIter(const Tally& tally, Particle* p) - : tally_{tally}, filter_matches_{p->filter_matches_} + : filter_matches_{p->filter_matches_}, tally_{tally} { // Find all valid bins in each relevant filter if they have not already been // found for this event. @@ -57,7 +57,7 @@ FilterBinIter::FilterBinIter(const Tally& tally, Particle* p) FilterBinIter::FilterBinIter(const Tally& tally, bool end, std::vector* particle_filter_matches) - : tally_{tally}, filter_matches_{*particle_filter_matches} + : filter_matches_{*particle_filter_matches}, tally_{tally} { // Handle the special case for an iterator that points to the end. if (end) {