Skip to content

Commit

Permalink
Modernize std::accumulate call breaking compile
Browse files Browse the repository at this point in the history
  • Loading branch information
mmore500 committed Feb 13, 2024
1 parent 5c181b7 commit cdffaf1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion avida-core/source/main/cOrgMessagePredicate.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,12 @@ struct cOrgMessagePred_CountDemeMessages : public cOrgMessagePredicate {

virtual void Print(int update, std::ostream& out) {
out << update << " COUNT " <<
std::accumulate(m_msg_counts.begin(), m_msg_counts.end(), 0, apply2nd<MessageCounts::iterator, plus<int> >()) << " ";
std::accumulate(
std::begin(m_msg_counts),
std::end(m_msg_counts),
int{},
[](auto first, auto second) { return first + second.second; }
) << " ";
for(MessageCounts::iterator i=m_msg_counts.begin(); i!=m_msg_counts.end(); ++i) {
out << " " << i->second;
}
Expand Down

0 comments on commit cdffaf1

Please sign in to comment.