【发布时间】:2009-12-03 11:01:25
【问题描述】:
编译器为什么会报错?
template<class T>
void ignore (const T &) {}
void f() {
ignore(std::endl);
}
编译器 VS2008 给出以下错误:cannot deduce template argument as function argument is ambiguous。
【问题讨论】:
-
无法推断模板参数,因为函数参数不明确