
Steven Watanabe wrote:
Phil Endecott wrote:
Something like this (probably full of syntax errors....)
template <typename Iter> void SpreadSort(Iter begin, Iter end) { .... generic code .... }
template <typename T> void SpreadSort< std::vector<T>::iterator >( std::vector<T>::iterator begin, std::vector<T>::iterator end) { SpreadSort(&(*begin), &(*end)); }
That doesn't work. The compiler can't deduce T.
True. Well, in this case since the SpreadSort template only works for integers then Steve could just specialise for std::vector<char,short,int,long,long long,etc>. Otherwise I guess something using enable_if is possible, but I'm not going to stick my neck out and guess how to write it with all these experts reading... Phil.