https://github.com/ekg/freebayes
Raw File
Tip revision: a994e781423290df79453cc46da81fbd1c7160fc authored by Erik Garrison on 02 July 2013, 08:32:27 UTC
Setting Release-Version v9.9.1
Tip revision: a994e78
Sum.h
#ifndef __SUM_H
#define __SUM_H

#include <vector>

template <class T>
T sum(const std::vector<T>& v) {
    T result = 0;
    for (typename std::vector<T>::const_iterator i = v.begin(); i != v.end(); ++i) {
        result += *i;
    }
    return result;
}

#endif
back to top