标签: c++ templates inner-classes
可能重复: Why can't templates be declared in a function?
void fun () { template<typename T> struct InnerClass {}; }
给出错误。
error: expected primary-expression before ‘template’ error: expected ‘;’ before ‘template’
只是想知道,为什么?