Is there a way to restrict the parameter type of a template function to only pointers or random-access iterators?
Say I am developing a sorting function which works
Use iterator traits:
static_assert( std::is_same<std::random_access_iterator_tag, typename std::iterator_traits<Iterator>::iterator_category>::value, "The mySort() function only accepts random access iterators or raw pointers to an array.\n");