Generic sliding average in C++
Very good. There are small things that could be improved.

It is possible to give window_length type std::iterator_traits&lt;ForwardIterator&gt;::difference_type. I think std::size_t is fine for most cases.

ForwardIterator begin,
ForwardIterator end


Usually those are called first and last.

if (window_length == 0)
{
    std::stringstream ss;
    ss &lt;&lt; "Bad window_length: ";
    ss &lt;&lt; window_length;
    throw std::runtime_error{ss.str()};
}


Well, the result of ss.str() is obvious :) It is possible to write constexpr there, or throw the string right into the constructor. Also, runtime_error is a good fit, but it has child called invalid_argument, which perfectly matches the case.

if (count &lt; window_length)
{
    std::stringstream ss;
    ss &lt;&lt; "The length of the range (";
    ss &lt;&lt; count;
    ss &lt;&lt; ") is too short. Must be at least ";
    ss &lt;&lt; window_length;
    throw std::runtime_error{ss.str()};
}


I think that using std::stringstream is an overkill here. Throwing just "The length of the range is too short. It must be at least of length window_length" is pretty good by itself, since most IDEs will probably stop execution, so that programmers could have a look. Even if they had a catch for this, they would need to parse a string to be actually able to do something. I don't think it worth the troubles it brings.

Some caveats:

Currently if T = int the algorithm is going to produce somewhat incorrect results. May be you could write something like warning mechanism that will warn when integer type is used. I would consider #pragma message("your warning message here"). It might get portability problems but the code will still compile since unrecognized #pragmas are ignored.