I have a set of pairs defined as follow:
set< pair<UserEquipm ent*, double> > numberOfFreqSlo tsToAdd;
and I need to iterate through all the elements of the set in order
accumulate the second field of the pair (that is double). Is there any
way I can use the algorithm accumulate to accomplish this?
The following line of code
double unit = accumulate( numberOfFreqSlo tsToAdd.begin() ,
numberOfFreqSlo tsToAdd.end(), 0.0);
of course, won't work. Can you suggest anything similar using the
algorithm accumulate?
Thanks
Francesco
set< pair<UserEquipm ent*, double> > numberOfFreqSlo tsToAdd;
and I need to iterate through all the elements of the set in order
accumulate the second field of the pair (that is double). Is there any
way I can use the algorithm accumulate to accomplish this?
The following line of code
double unit = accumulate( numberOfFreqSlo tsToAdd.begin() ,
numberOfFreqSlo tsToAdd.end(), 0.0);
of course, won't work. Can you suggest anything similar using the
algorithm accumulate?
Thanks
Francesco
Comment