Quote:Original post by alvaro
I don't think my solution is that complicated. Here's some code:
*** Source Snippet Removed ***
EDIT: You don't have to use doubles if your weights are integers. Modifying the code I provided for integer weights should be trivial.
EDIT: Added a few comments
I appreciate the code, I'll look over it more thoroughly tomorrow. I forget but I think I've read that in a for loop var++ and ++var do the same thing, is this correct?
edit: Also, is there a way to force a templated argument to be of a numeric type?