Use category_of to get correct iterator category.