Assume I have a vector of grades, where the grade is
struct Grade{
const int grade;
const int ECTS; // weight
};
Is there a STL/range-v3 algorithm/algorithms that enable me to do this?
I know I could do it with std:: accumulate
with some fancy type as an accumulator(that remembers the sum of weights), but I am looking for a simpler alternative if one exists.