|
Boost : |
From: Phil Endecott (spam_from_boost_dev_at_[hidden])
Date: 2008-07-10 20:11:32
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.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk