template
class RedBlack{
protected:
……
static int (*compareKey)(T *k1, T *k2); //可以这样定义么,可以的话如何初始化它?
……
};
自己找到答案了,可以定义,初始化在类外:
int compareInt(int a, int *b);
typedef int (*PfunPintPint)(int, int*);
template<> PfunPintPint RedBlack::compareKey = compareInt;