I want to use the SFINAE principle to check whether the instantiated template is a random access iterator. To do this, I used std::enable_if, but the compiler throws an error:
Cannot combine with previous 'type-name' declaration specifier
How can I fix it? I really need help to figure it out.
template<class RandomAccessIterator, class Compare>
typename std::enable_if<std::is_same<std::random_access_iterator_tag, RandomAccessIterator>::value>
void quick_sort(RandomAccessIterator first, RandomAccessIterator last, Compare compare) {
sorting(first, last, 0, last - first - 1, compare);
}