c++标准哪个网址查的啊? 我感觉它是在本作用域最后样的。 还有我最近在看c++模板全览这本书,我发现里面很多东西在vs2008里面实现都有一定的出入。 感觉还是直接英文的算了,没办法。 但不知道c++标准去哪查。
[/Quote]
google c++ committee, follow the first hit to find out standard c++ documents.
if the specialization is not instantiated previous to the instantiation of the
enclosing template, the point of instantiation is immediately before the point of instantiation of the enclosing template。
这里的enclosing template 是指什么意思啊?
Otherwise, the point of instantiation for such a specialization immediately precedes the namespace
scope declaration or definition that refers to the specialization。
the namespace
scope declaration or definition that refers to the specialization。这段谁能试着翻译一下。
c++ 11 14.6.4.1/1
For a function template specialization ... the point of instantiation for such a specialization immediately follows the namespace scope declaration or definition that refers to the specialization.
因此 f<int> 的 point of instantiation 在 main 函数定义结束以后。