【发布时间】:2015-05-09 11:53:58
【问题描述】:
下面的代码工作正常,但我无法根据 C++ 标准的哪些点确定它应该是有效的。
template< class C, class signature >
void f(signature C::*ptr) { }
当C = A和signature = void(float, int)时,函数f会是
void f(void(A::*ptr)(float, int))
基于标准的哪些部分,模板是否适用于后者?
【问题讨论】:
-
@Daniel Frey 是的。我知道一切正常。我问:为什么这样有效?我在哪里可以在 C++ 标准中读到这样的事情是正确的。
标签: c++ templates pointers function-pointers language-lawyer