Possible Duplicate:
Why can't templates be declared in a function?
void fun ()
{
template<typename T> struct InnerClass {};
}
gives errors.
error: expected primary-expression before ‘template’
error: expected ‘;’ before ‘template’
Just wanted to know, WHY ?