Template within template: why “`>>' should be `> >' within a nested template argument list”

前端 未结 8 1385
无人及你
无人及你 2020-11-28 10:40

I know that when we are using template inside another template, we should write it like this:

vector > s;

and if we wr

8条回答
  •  Happy的楠姐
    2020-11-28 11:23

    It won't ever be ambiguous. This is proven by the fact that in C++0x you don't have to write a space between closing template >s any more.

    The thing is that the compilers would prefer to tokenize the input as context-independently as possible. Since C++ is not a context independent language anyway, adding just this one special case isn't going to make things particularly harder.

提交回复
热议问题