你好我收到以下錯誤錯誤:預期模板的名稱前<令牌
templateatt.cpp:4:32: error: expected template-name before ‘<‘ token
templateatt.cpp:4:32: error: expected â{â before ‘<‘ token
templateatt.cpp:4:32: error: expected unqualified-id before ‘<‘ token
當我編譯下面的CPP文件:
#include<iostream>
template <class R, class T>
class mem_fun_t: unary_function<T*, R> {
R (T::*pmf)();
public:
explicit mem_fun_t(R (T::*p)()):pmf(p){}
R operator() (T *p) const { return (p->*pmf()); }
};
int main() {
return 0;
}
任何幫助將是巨大的。我堅持這一點。
編譯器和我,我們都看不到'unary_function'的任何定義... – PlasmaHH 2013-04-10 11:10:49