Please consider the following code:
template <typename T, typename P, T P:: *s> struct H {};
struct AA { int i; };
int main()
{
typedef int AA::*PI;
constexpr PI pi = &AA::i;
H<int, AA, &AA::i> h1; // OK
// H<int, AA, pi> h2; // compile error
}
I have member pointer pi pointing to AA::i.
pi is a constexpr variable. Why can't I use it as a template parameter, even though using &AA::i directly works?