The linker fails to find definition of Q::X
.
This is probably because std::pair<>
constructor takes arguments as references to const, and Q::X
is an l-value, hence it requires an external definition of Q::X
to be able to refer to that.
A portable fix:
int const Q::X;