Is the compiler allowed to optimise out private data members?
问题 If the compiler can prove that a (private) member of a class is never used, including by potential friends, does the standard allow the compiler to remove this member from the memory footprint of the class? It is self-evident that this not possible for protected or public members at compile time, but there could be circumstances where it is possible regarding private data members for such a proof to be constructed. Related questions: Behind the scenes of public, private and protected (sparked