Q:

Do all containers have a .size() function?

For a homework assignment I have to create a templatized standard deviation function that can be performed on any container.  Here's what I have:
template <typename Container>
double findMean(Container c, int count){
    double sum = 0;
    for (auto&& e : c){
        sum += e;
    }
    sum /= count;
    return sum;
}

template <typename Container>
double findStDev(Container c){
    double mean = findMean(c, c.size());
    std::cout << mean << std::endl;
    for (auto&& e : c){
        e -= mean;
        e *= e;
    }
    mean = sqrt(findMean(c, c.size()));
    return mean;
}

The first time I find the mean I want to divide by the full size of the container (n), but when I find it the second time for the standard deviation, I need to divide by size-1 (n-1).
Is the .size() function available for all c++ containers?

A:

Almost. By table 96 - container requirements in N3797, all containers in  the standard library must provide a member function size. It shall have constant execution time and return the value of distance(a.begin(),a.end()) for a container a.
However, there is one (and only one) exception mentioned later on: 

A forward_list satisfies all of the requirements of a container (Table 96), except that the size() member
  function is not provided.

(N3797 23.3.4.1 Clause 2)
That means that std::forward_list is indeed a standard container that does not have a member function size.

