Originally std::count was:

template &lt;class InputIterator, class EqualityComparable, class Size&gt;
void count(InputIterator first, InputIterator last, 
           const EqualityComparable&amp; value,
           Size&amp; n);


In that function Size is a template parameter. It can be whatever you like, and it's your responsibility to make sure it's correct. It could be the longest type on your platform.

My suspicion is that when the newer form:

template &lt;class InputIterator, class EqualityComparable&gt;
iterator_traits&lt;InputIterator&gt;::difference_type
count(InputIterator first, InputIterator last, 
      const EqualityComparable&amp; value);


was added iterator_traits was already in existence, so re-using the existing type had the advantage that it kept the changes to the standard small and localised, compared to adding another typedef in iterator_traits.

Doing it this way, using iterator_traits as opposed to simply using std::size_type means that every possible iterator gets the option to specify exactly what type should be returned by std::count. This includes custom iterators which read from a network, or disk, which can use something much larger than either ptrdiff_t or size_type and friends. (It could be some kind of "BigInt" if needed). It also means that the user isn't responsible for deducing the appropriate type to use though, which can be tricky, precisely because of the custom iterator possibility. 

Why does the C++ standard algorithm "count" return a ptrdiff_t instead of size_t?
I am having new Mid-Continent kitchen cabinets installed.  The vendor has attempted to drill holes in the cabinets drawer faces for the "Pull Handles" that we selected.  I would think that this would be easy.  When he drills a 1/8" hole in the front of the drawer to mount the handle, the drill bit tears the surrounding wood surface finish around the 1/8" drilled hole.   And the "Foot print" of the Pull Handle does not cover up the torn finish.

So how do I drill a 1/8" hole without marring or tearing the wood surface around the hole?
