Re: ambiguous call to overloaded function
<cablepuff@gmail.com> ha scritto nel messaggio
news:1192037608.968242.295150@o80g2000hse.googlegroups.com...
#ifndef MEDIANDEF_HPP
#define MEDIANDEF_HPP
#include "median.hpp"
template <typename T,
template <typename ELEM, typename = std::allocator<ELEM> >
class CONT
void select_sort(CONT<T>& Array, typename CONT<T>::iterator iter,
const int& size, const int& step)
{
printf("Awesomely cool");
}
#endif
template <typename T,
template <typename ELEM, typename = std::allocator<ELEM> >
class CONT
extern void select_sort(CONT<T>&, typename CONT<T>::iterator, const
int&, const int&);
I don't understand neither the CONT-thing, nor the use of "extern" in this
context...
However, I've tried that, and it seems to compile fine with VC++7.1:
<code>
#include <iostream>
#include <vector>
template <typename ContainerT>
void select_sort( ContainerT & Array, typename ContainerT::iterator iter,
const int& size, const int& step)
{
std::cout << "Awesomely cool" << std::endl;
}
int main()
{
std::vector<int> my_vec(4, 4);
select_sort(my_vec, my_vec.begin(), 4, 2);
return 0;
}
</code>
....but I don't know if the template declaration I wrote is exactly what you
had in your mind...(maybe I have missed something...).
Giovanni