dot-product

Dot product in C++ using generic algorithms

I´m sure there´s a clever one-liner using the C++ stl generic algorithms for implementing the dot product of the elements in any ordered container, such as a vector or list. I just don´t seem to remember it! The fancy implementation would be: template <class containerT> typename containerT::value_type dot_product (const containerT& lef...