我不能编译下面的代码重载模板函数错误C2688
namespace sequential_sort
{
template<class T>
void sort(std::list<T>& source)
{
sort(source.begin(), source.end()); //(1)
}
template<class Iter>
void sort(Iter begin, Iter end)
{
if(begin == end)
return;
typedef Iter::value_type value_type;
value_type value = *(begin);
Iter part = std::partition(begin, end, [&value](const value_type&->bool{return t < value;});
sort(begin, part);
Iter divide = part;
divide++;
sort(divide, end);
}
}
它说,在线路(1)我有错误C2688以重载函数调用暧昧。 我不明白为什么,重载函数甚至有不同数量的参数?
难道你的名字不是'sort'其他的功能的东西:
sort
你想用你可通过特定的大约两个参数解决这个问题?有'std :: sort'和参数相关的查找要考虑。 – juanchopanza