https://github.com/ekg/freebayes
Raw File
Tip revision: 1635a15917a444bb6aed9cba457b6a192f1f4962 authored by Erik Garrison on 06 March 2015, 17:56:48 UTC
Setting Release-Version v0.9.21
Tip revision: 1635a15
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