Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我该如何进行这项工作?当C++T=int似乎完全忽略它时,为什么它让我写?
T=int
template<class T=int> class Foo { public: T a; }; int main() { Foo f; //error: missing template arguments before ‘f’ }
Foo是一个模板,你还需要写:
Foo
Foo<> f; // ^^
你需要写:
Foo<> f