template<typename It>
It ret_it Alg(It it1, It it2)
{
return AlgInternal(
it1,
it2,
std::iterator_traits<It>::iterator_category()
);
}
template<typename It>
It ret_it AlgInternal(
It it1,
It it2,
std::random_access_iterator_tag
)
{
// Makes use of random access iterator properties
}
template<typename It>
It ret_it AlgInternal(
It it1,
It it2,
std::forward_iterator_tag
)
{
// Uses only forward iterator properties
}
End of Listing