The main difference is that
irangeis a random-access range while
counting_rangeis based on Boost.Iterator's
counting_iteratorwhich uses all the underlying integers operations directly. Integers in C++ almost fit the iterator concept: the only thing missing is an
operator* as an identity operation and forwards everything else to the underlying type.