What kind of answer do you expect?
A formal and pedantic one? If so, then there's simply no answer to that question. C++ language does give you any formal opportunity to compare the effects of these two assignments. If you assigned ClassX::A
, you can only read ClassX::A
and not ClassX::B
. If you assigned ClassX::B
, you can only read ClassX::B
and not ClassX::A
. In other words, there's no meaningful reason to even care whether the effects are the same or not. The language simply does not allow you to care about it. If your code somehow relies on it, then its behavior is undefined, as far as formal C++ is concerned.
As for the real-life practical answer to that question... yes, the effects should be the same in any reasonable implementation of the language.