0

I get C2768 'illegal use of explicit template arguments' when including (not even instantiating a template of the function) this code:

template<typename Container, typename It, typename Compare, enum class sort>
void _SortCollection(Container& container, It start, It end) {
    //... default
}

template<typename Container, typename It, typename Compare>
void _SortCollection<Container, It, Compare, sort::bubble>
                    (Container& container, It start, It end) { 
//bubble sort
}

Is there something i'm doing wrong here?

  • 1
    Note that identifiers beginning with underscore and an uppercase character are reserved for the implementation. There are many other names to choose from. – molbdnilo Feb 27 '22 at 11:32
  • Template function partial specialization is not allowed. E.g. you can't get there from here. There are [ways](https://stackoverflow.com/questions/8061456/c-function-template-partial-specialization) to subvert that, but none of them are particularly elegant or trivial (eye of the beholder notwithstanding). – WhozCraig Feb 27 '22 at 12:23

0 Answers0