我正在努力理解这个规则,特别是下面的粗体句子(我的重点):
考虑注释#2在下面的代码片段:这是什么意思是说,功能类型f(int),但是t是const?
§14.8.2/3:执行此替换后,将执行8.3.5中描述的功能参数类型调整.[示例:参数类型"
void ()(const int, int[5])"变为"void(*)(int,int*)".-end example] [注意:函数参数声明中的顶级限定符不会影响函数类型,但仍会影响函数中函数参数变量的类型.- 尾注 ] [示例:Run Code Online (Sandbox Code Playgroud)template <class T> void f(T t); template <class X> void g(const X x); template <class Z> void h(Z, Z*); int main() { // #1: function type is f(int), t is non const f<int>(1); // #2: function type is f(int), t is const f<const int>(1); // #3: function type is g(int), x is const g<int>(1); // #4: …