0
我读到有关模板这里http://publib.boulder.ibm.com/当我看到这一段代码,真糊涂我:复杂的模板函数
template<class T> class Y { };
template<class T, int i> class X {
public:
Y<T> f(char[20][i]) { return x; };
Y<T> x;
};
template<template<class> class T, class U, class V, class W, int i>
void g(T<U> (V::*)(W[20][i])) { };
int main()
{
Y<int> (X<int, 20>::*p)(char[20][20]) = &X<int, 20>::f;
g(p);
}
可否请你给我解释一下这行的意思?
Y<int> (X<int, 20>::*p)(char[20][20]) = &X<int, 20>::f;
我只是不能把握它的含义。感谢名单!
的成员函数
f
@jrok非常挑剔! –@jrok好吧,那是指向2维数组地址的常量指针,对吗? –
@Joseph我知道,但它是我的宠物狗:) – jrok