XBT_DEBUG("Snapshot %p of visited state %ld (exploration stack state %ld)", new_state->system_state.get(),
new_state->num, graph_state->get_num());
- auto [range_begin, range_end] =
- boost::range::equal_range(states_, new_state.get(), compare_pair_by_actor_count_and_used_heap());
+ auto [range_begin, range_end] = boost::range::equal_range(states_, new_state.get(), [](auto const& a, auto const& b) {
+ return std::make_pair(a->actor_count_, a->heap_bytes_used) < std::make_pair(b->actor_count_, b->heap_bytes_used);
+ });
for (auto i = range_begin; i != range_end; ++i) {
auto& visited_state = *i;
XBT_PUBLIC Exploration* create_communication_determinism_checker(const std::vector<char*>& args, bool with_dpor);
XBT_PUBLIC Exploration* create_udpor_checker(const std::vector<char*>& args);
-// FIXME: kill this template and use lambdas in boost::range_equal
-struct DerefAndCompareByActorsCountAndUsedHeap {
- template <class X, class Y> bool operator()(X const& a, Y const& b) const
- {
- return std::make_pair(a->actor_count_, a->heap_bytes_used) < std::make_pair(b->actor_count_, b->heap_bytes_used);
- }
-};
-static inline DerefAndCompareByActorsCountAndUsedHeap compare_pair_by_actor_count_and_used_heap()
-{
- return DerefAndCompareByActorsCountAndUsedHeap();
-}
-
} // namespace simgrid::mc
#endif
auto new_pair =
std::make_shared<VisitedPair>(pair->num, pair->prop_state_, pair->atomic_propositions, pair->app_state_);
- auto [res_begin, res_end] =
- boost::range::equal_range(acceptance_pairs_, new_pair.get(), compare_pair_by_actor_count_and_used_heap());
+ auto [res_begin,
+ res_end] = boost::range::equal_range(acceptance_pairs_, new_pair.get(), [](auto const& a, auto const& b) {
+ return std::make_pair(a->actor_count_, a->heap_bytes_used) < std::make_pair(b->actor_count_, b->heap_bytes_used);
+ });
if (pair->search_cycle)
for (auto i = res_begin; i != res_end; ++i) {
visited_pair =
std::make_shared<VisitedPair>(pair->num, pair->prop_state_, pair->atomic_propositions, pair->app_state_);
- auto [range_begin, range_end] =
- boost::range::equal_range(visited_pairs_, visited_pair.get(), compare_pair_by_actor_count_and_used_heap());
+ auto [range_begin,
+ range_end] = boost::range::equal_range(visited_pairs_, visited_pair.get(), [](auto const& a, auto const& b) {
+ return std::make_pair(a->actor_count_, a->heap_bytes_used) < std::make_pair(b->actor_count_, b->heap_bytes_used);
+ });
for (auto i = range_begin; i != range_end; ++i) {
const VisitedPair* pair_test = i->get();