kima2/src/core/sale.cpp

10 lines
237 B
C++

#include "sale.h"
#include <numeric>
int Sale::sumInCents()
{
int test = std::accumulate(articles_.begin(), articles_.end(), 0,
[](int a, Article* b) { return a + b->getPrice(); });
return test;
}