X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/2f2db04b850386899392bc06568f17f071f8620f..fe4080b8dd04acb2074ca72d36e3019acddea455:/src/mc/explo/udpor/maximal_subsets_iterator.hpp diff --git a/src/mc/explo/udpor/maximal_subsets_iterator.hpp b/src/mc/explo/udpor/maximal_subsets_iterator.hpp index 7d0ab46565..49872d809a 100644 --- a/src/mc/explo/udpor/maximal_subsets_iterator.hpp +++ b/src/mc/explo/udpor/maximal_subsets_iterator.hpp @@ -38,15 +38,16 @@ public: using node_filter_function = std::function; using topological_order_position = std::vector::const_iterator; - maximal_subsets_iterator() = default; + maximal_subsets_iterator() = default; explicit maximal_subsets_iterator(const Configuration& config, - std::optional filter = std::nullopt, - std::optional maximum_subset_size = std::nullopt) + const std::optional& filter = std::nullopt, + std::optional maximum_subset_size = std::nullopt) : maximal_subsets_iterator(config.get_events(), filter, maximum_subset_size) { } - explicit maximal_subsets_iterator(const EventSet& events, std::optional filter = std::nullopt, - std::optional maximum_subset_size = std::nullopt); + explicit maximal_subsets_iterator(const EventSet& events, + const std::optional& filter = std::nullopt, + std::optional maximum_subset_size = std::nullopt); private: std::vector topological_ordering; @@ -58,7 +59,7 @@ private: bool has_started_searching = false; std::optional maximum_subset_size = std::nullopt; std::optional current_maximal_set = std::nullopt; - std::stack backtrack_points = std::stack(); + std::stack> backtrack_points; /** * @brief A small class which provides functionality for managing @@ -70,7 +71,7 @@ private: * with events that are its current maximal event set (i.e. * its `current_maximal_set`) */ - struct bookkeeper { + struct Bookkeeper { public: using topological_order_position = maximal_subsets_iterator::topological_order_position; @@ -86,7 +87,8 @@ private: /// bookkeeping that has been done thus far, can be added to the /// current candidate maximal set bool is_candidate_event(const UnfoldingEvent*) const; - } bookkeeper; + }; + Bookkeeper bookkeeper; void add_element_to_current_maximal_set(const UnfoldingEvent*); void remove_element_from_current_maximal_set(const UnfoldingEvent*); @@ -137,7 +139,7 @@ private: bool equal(const maximal_subsets_iterator& other) const { return current_maximal_set == other.current_maximal_set; } const EventSet& dereference() const { - static const EventSet empty_set = EventSet(); + static const EventSet empty_set; if (current_maximal_set.has_value()) { return current_maximal_set.value(); }