Boost logo

Boost Users :

From: Eric Lemings (lemings_at_[hidden])
Date: 2006-07-28 17:57:57


Greetings,
 
I'm trying to come up with an algorithm that will "collapse" a sequence
of integer constants by adding like elements together. For example,
 
    typedef vector_c< int, 1,1,1,3,5,5,7,10,10 > input;
 
would become:
 
    typedef vector_c< int, 3, 3, 10, 7, 20 > result;
 
You can assume the sequence is already sorted. Would appreciate any
tips.
 
Thanks,
Eric.
 



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net